def fit(self, X, y):
"""Fit a series of independent estimators to the dataset.
Parameters
----------
X : array, shape (n_samples, n_features, n_estimators)
The training input samples. For each data slice, a clone estimator
is fitted independently.
y : array, shape (n_samples,)
The target values.
Returns
-------
self : object
Return self.
"""
self._check_Xy(X, y)
self.estimators_ = list()
# For fitting, the parallelization is across estimators.
parallel, p_func, n_jobs = parallel_func(_sl_fit, self.n_jobs)
estimators = parallel(
p_func(self.base_estimator, split, y)
for split in np.array_split(X, n_jobs, axis=-1))
self.estimators_ = np.concatenate(estimators, 0)
return self
search_light.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录