'Fit the model using X as training data and y as target values
Parameters
X : {array-like, sparse matrix, BallTree, KDTree}
Training data. If array or matrix, shape [n_samples, n_features],
or [n_samples, n_samples] if metric=\'precomputed\'.
y : {array-like, sparse matrix}
Target values, array of float values, shape = [n_samples]
or [n_samples, n_outputs]'

def fit(self, X, y):

    if (not isinstance(X, (KDTree, BallTree))):
        (X, y) = check_X_y(X, y, 'csr', multi_output=True)
    self._y = y
    return self._fit(X)
