def fit(self, X, y, *args, **kwargs):
X = np.asanyarray(X)
y = np.asanyarray(y)
# Centering Data
X, y, X_offset, y_offset, X_scale, precompute, Xy = \
_pre_fit(X, y, None, self.precompute, self.normalize,
self.fit_intercept, copy=False)
# Calling the class-specific train method
self._fit(X, y, *args, **kwargs)
# Fitting the intercept if required
self._set_intercept(X_offset, y_offset, X_scale)
self._trained = True
return self
评论列表
文章目录