# Path: splearn/utils/validation.py
# def check_rdd(rdd, expected_dtype):
#     """Wrapper function to check_rdd_dtype. Raises TypeError in case of dtype
#     mismatch.
# 
#     Parameters:
#     -----------
#     rdd: splearn.BlockRDD
#         The RDD to check
#     expected_dtype: {type, list of types, tuple of types, dict of types}
#         Expected type(s). If the RDD is a DictRDD the parameter type is
#         restricted to dict.
#     """
#     if not check_rdd_dtype(rdd, expected_dtype):
#         raise TypeError("{0} dtype mismatch.".format(rdd))


import operator
import numpy as np
import scipy.sparse as sp
from sklearn.base import copy
from sklearn.linear_model.base import LinearRegression
from ..utils.validation import check_rdd
    n_jobs : The number of jobs to use for the computation.
        If -1 all CPUs are used. This will only provide speedup for
        n_targets > 1 and sufficient large problems.

    Attributes
    ----------
    coef_ : array, shape (n_features, ) or (n_targets, n_features)
        Estimated coefficients for the linear regression problem.
        If multiple targets are passed during the fit (y 2D), this
        is a 2D array of shape (n_targets, n_features), while if only
        one target is passed, this is a 1D array of length n_features.
    intercept_ : array
        Independent term in the linear model.

    """

    def fit(self, Z):
        """
        Fit linear model.

        Parameters
        ----------
        Z : DictRDD with (X, y) values
            X containing numpy array or sparse matrix - The training data
            y containing the target values

        Returns
        -------
        self : returns an instance of self.
        """

# Path: splearn/utils/validation.py
# def check_rdd(rdd, expected_dtype):
#     """Wrapper function to check_rdd_dtype. Raises TypeError in case of dtype
#     mismatch.
# 
#     Parameters:
#     -----------
#     rdd: splearn.BlockRDD
#         The RDD to check
#     expected_dtype: {type, list of types, tuple of types, dict of types}
#         Expected type(s). If the RDD is a DictRDD the parameter type is
#         restricted to dict.
#     """
#     if not check_rdd_dtype(rdd, expected_dtype):
#         raise TypeError("{0} dtype mismatch.".format(rdd))


# Path: splearn/linear_model/base.py
import operator
import numpy as np
import scipy.sparse as sp
from sklearn.base import copy
from sklearn.linear_model.base import LinearRegression
from ..utils.validation import check_rdd

    n_jobs : The number of jobs to use for the computation.
        If -1 all CPUs are used. This will only provide speedup for
        n_targets > 1 and sufficient large problems.

    Attributes
    ----------
    coef_ : array, shape (n_features, ) or (n_targets, n_features)
        Estimated coefficients for the linear regression problem.
        If multiple targets are passed during the fit (y 2D), this
        is a 2D array of shape (n_targets, n_features), while if only
        one target is passed, this is a 1D array of length n_features.
    intercept_ : array
        Independent term in the linear model.

    """

    def fit(self, Z):
        """
        Fit linear model.

        Parameters
        ----------
        Z : DictRDD with (X, y) values
            X containing numpy array or sparse matrix - The training data
            y containing the target values

        Returns
        -------
        self : returns an instance of self.
        """

        check_rdd(Z, {'X': (sp.spmatrix, np.ndarray)})