mars.learn.ensemble.BlockwiseVotingRegressor#

class mars.learn.ensemble.BlockwiseVotingRegressor(estimator: BaseEstimator)[源代码]#

Blockwise training and ensemble voting regressor.

This regressor trains on blocks / partitions of tensors or DataFrames. A cloned version of estimator will be fit independently on each block or partition of the data.

Prediction is done by the ensemble of learned models.

警告

Ensure that your data are sufficiently shuffled prior to training! If the values of the various blocks / partitions of your dataset are not distributed similarly, the regressor will give poor results.

参数

estimator (Estimator) –

estimators_#

The collection of fitted sub-estimators that are estimator fitted on each partition / block of the inputs.

Type

list of regressors

示例

>>> import mars.tensor as mt
>>> from mars.learn.ensemble import BlockwiseVotingRegressor
>>> from sklearn.linear_model import LinearRegression
>>> from sklearn.datasets import make_classification
>>> X, y = make_classification(n_samples=100_000)
>>> X, y = mt.tensor(X, chunk_size=10_0000), mt.tensor(y, chunk_size=10_0000)
>>> subestimator = LinearRegression()
>>> clf = BlockwiseVotingRegressor(subestimator)
>>> clf.fit(X, y)
__init__(estimator: BaseEstimator)#

Methods

__init__(estimator)

fit(X, y[, session, run_kwargs])

get_params([deep])

Get parameters for this estimator.

predict(X[, session, run_kwargs])

score(X, y[, sample_weight])

Return the coefficient of determination \(R^2\) of the prediction.

set_params(**params)

Set the parameters of this estimator.