'Fit the model from data in X.
Parameters
X : array-like, shape (n_samples, n_features)
Training vector, where n_samples in the number of samples
and n_features is the number of features.
Returns
self : object
Returns the instance itself.'

def fit(self, X, y=None):

    X = check_array(X, accept_sparse='csr', copy=self.copy_X)
    K = self._get_kernel(X)
    self._fit_transform(K)
    if self.fit_inverse_transform:
        sqrt_lambdas = np.diag(np.sqrt(self.lambdas_))
        X_transformed = np.dot(self.alphas_, sqrt_lambdas)
        self._fit_inverse_transform(X_transformed, X)
    self.X_fit_ = X
    return self
