'Fit the model using X, y as training data.
Parameters
X : array-like, shape = [n_samples, n_features]
Training data.
y : array-like, shape = [n_samples]
Target values. Will be cast to X\'s dtype if necessary
Returns
self : object
Returns an instance of self.'

def fit(self, X, y):

    (X, y) = check_X_y(X, y, ['csr', 'csc'], y_numeric=True, ensure_min_samples=2, estimator=self)
    X = as_float_array(X, copy=False)
    (n_samples, n_features) = X.shape
    (X, y, X_offset, y_offset, X_scale) = self._preprocess_data(X, y, self.fit_intercept, self.normalize)
    (estimator_func, params) = self._make_estimator_and_params(X, y)
    memory = self.memory
    if (memory is None):
        memory = Memory(cachedir=None, verbose=0)
    elif isinstance(memory, six.string_types):
        memory = Memory(cachedir=memory, verbose=0)
    elif (not isinstance(memory, Memory)):
        raise ValueError("'memory'    should    either    be    a    string    or    a    sklearn.externals.joblib.Memory    instance,    got    'memory={!r}'    instead.".format(type(memory)))
    scores_ = memory.cache(_resample_model, ignore=['verbose', 'n_jobs', 'pre_dispatch'])(estimator_func, X, y, scaling=self.scaling, n_resampling=self.n_resampling, n_jobs=self.n_jobs, verbose=self.verbose, pre_dispatch=self.pre_dispatch, random_state=self.random_state, sample_fraction=self.sample_fraction, **params)
    if (scores_.ndim == 1):
        scores_ = scores_[:, np.newaxis]
    self.all_scores_ = scores_
    self.scores_ = np.max(self.all_scores_, axis=1)
    return self
