# mars.learn.ensemble.BlockwiseVotingRegressor#

class mars.learn.ensemble.BlockwiseVotingRegressor(estimator: sklearn.base.BaseEstimator)[source]#

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.

Warning

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.

Parameters

estimator (Estimator) –

estimators_#

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

Type

list of regressors

Examples

>>> 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: sklearn.base.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.