DocumentationClassesMultiOutputRegressor

Class: MultiOutputRegressor

Multi target regression.

This strategy consists of fitting one regressor per target. This is a simple strategy for extending regressors that do not natively support multi-target regression.

Python Reference

Constructors

new MultiOutputRegressor()

new MultiOutputRegressor(opts?): MultiOutputRegressor

Parameters

ParameterTypeDescription
opts?object-
opts.estimator?anyAn estimator object implementing fit and predict.
opts.n_jobs?numberThe number of jobs to run in parallel. fit, predict and partial_fit (if supported by the passed estimator) will be parallelized for each target. When individual estimators are fast to train or predict, using n_jobs > 1 can result in slower performance due to the parallelism overhead. undefined means 1 unless in a joblib.parallel_backend context. \-1 means using all available processes / threads. See Glossary for more details.

Returns MultiOutputRegressor

Defined in generated/multioutput/MultiOutputRegressor.ts:23

Properties

PropertyTypeDefault valueDefined in
_isDisposedbooleanfalsegenerated/multioutput/MultiOutputRegressor.ts:21
_isInitializedbooleanfalsegenerated/multioutput/MultiOutputRegressor.ts:20
_pyPythonBridgeundefinedgenerated/multioutput/MultiOutputRegressor.ts:19
idstringundefinedgenerated/multioutput/MultiOutputRegressor.ts:16
optsanyundefinedgenerated/multioutput/MultiOutputRegressor.ts:17

Accessors

estimators_

Get Signature

get estimators_(): Promise<any>

Estimators used for predictions.

Returns Promise<any>

Defined in generated/multioutput/MultiOutputRegressor.ts:455


feature_names_in_

Get Signature

get feature_names_in_(): Promise<ArrayLike>

Names of features seen during fit. Only defined if the underlying estimators expose such an attribute when fit.

Returns Promise<ArrayLike>

Defined in generated/multioutput/MultiOutputRegressor.ts:509


n_features_in_

Get Signature

get n_features_in_(): Promise<number>

Number of features seen during fit. Only defined if the underlying estimator exposes such an attribute when fit.

Returns Promise<number>

Defined in generated/multioutput/MultiOutputRegressor.ts:482


py

Get Signature

get py(): PythonBridge

Returns PythonBridge

Set Signature

set py(pythonBridge): void

Parameters

ParameterType
pythonBridgePythonBridge

Returns void

Defined in generated/multioutput/MultiOutputRegressor.ts:42

Methods

dispose()

dispose(): Promise<void>

Disposes of the underlying Python resources.

Once dispose() is called, the instance is no longer usable.

Returns Promise<void>

Defined in generated/multioutput/MultiOutputRegressor.ts:98


fit()

fit(opts): Promise<any>

Fit the model to data, separately for each output variable.

Parameters

ParameterTypeDescription
optsobject-
opts.fit_params?anyParameters passed to the estimator.fit method of each step.
opts.sample_weight?ArrayLikeSample weights. If undefined, then samples are equally weighted. Only supported if the underlying regressor supports sample weights.
opts.X?ArrayLikeThe input data.
opts.y?ArrayLikeMulti-output targets. An indicator matrix turns on multilabel estimation.

Returns Promise<any>

Defined in generated/multioutput/MultiOutputRegressor.ts:115


get_metadata_routing()

get_metadata_routing(opts): Promise<any>

Get metadata routing of this object.

Please check User Guide on how the routing mechanism works.

Parameters

ParameterTypeDescription
optsobject-
opts.routing?anyA MetadataRouter encapsulating routing information.

Returns Promise<any>

Defined in generated/multioutput/MultiOutputRegressor.ts:166


init()

init(py): Promise<void>

Initializes the underlying Python resources.

This instance is not usable until the Promise returned by init() resolves.

Parameters

ParameterType
pyPythonBridge

Returns Promise<void>

Defined in generated/multioutput/MultiOutputRegressor.ts:55


partial_fit()

partial_fit(opts): Promise<any>

Incrementally fit the model to data, for each output variable.

Parameters

ParameterTypeDescription
optsobject-
opts.partial_fit_params?anyParameters passed to the estimator.partial_fit method of each sub-estimator. Only available if enable_metadata_routing=True. See the User Guide.
opts.sample_weight?ArrayLikeSample weights. If undefined, then samples are equally weighted. Only supported if the underlying regressor supports sample weights.
opts.X?ArrayLikeThe input data.
opts.y?ArrayLikeMulti-output targets.

Returns Promise<any>

Defined in generated/multioutput/MultiOutputRegressor.ts:202


predict()

predict(opts): Promise<ArrayLike>

Predict multi-output variable using model for each target variable.

Parameters

ParameterTypeDescription
optsobject-
opts.X?ArrayLikeThe input data.

Returns Promise<ArrayLike>

Defined in generated/multioutput/MultiOutputRegressor.ts:255


score()

score(opts): Promise<number>

Return the coefficient of determination of the prediction.

The coefficient of determination \(R^2\) is defined as \((1 - \frac{u}{v})\), where \(u\) is the residual sum of squares ((y_true \- y_pred)\*\* 2).sum() and \(v\) is the total sum of squares ((y_true \- y_true.mean()) \*\* 2).sum(). The best possible score is 1.0 and it can be negative (because the model can be arbitrarily worse). A constant model that always predicts the expected value of y, disregarding the input features, would get a \(R^2\) score of 0.0.

Parameters

ParameterTypeDescription
optsobject-
opts.sample_weight?ArrayLikeSample weights.
opts.X?ArrayLike[]Test samples. For some estimators this may be a precomputed kernel matrix or a list of generic objects instead with shape (n_samples, n_samples_fitted), where n_samples_fitted is the number of samples used in the fitting for the estimator.
opts.y?ArrayLikeTrue values for X.

Returns Promise<number>

Defined in generated/multioutput/MultiOutputRegressor.ts:291


set_fit_request()

set_fit_request(opts): Promise<any>

Request metadata passed to the fit method.

Note that this method is only relevant if enable_metadata_routing=True (see sklearn.set_config). Please see User Guide on how the routing mechanism works.

The options for each parameter are:

Parameters

ParameterTypeDescription
optsobject-
opts.sample_weight?string | booleanMetadata routing for sample_weight parameter in fit.

Returns Promise<any>

Defined in generated/multioutput/MultiOutputRegressor.ts:339


set_partial_fit_request()

set_partial_fit_request(opts): Promise<any>

Request metadata passed to the partial_fit method.

Note that this method is only relevant if enable_metadata_routing=True (see sklearn.set_config). Please see User Guide on how the routing mechanism works.

The options for each parameter are:

Parameters

ParameterTypeDescription
optsobject-
opts.sample_weight?string | booleanMetadata routing for sample_weight parameter in partial_fit.

Returns Promise<any>

Defined in generated/multioutput/MultiOutputRegressor.ts:379


set_score_request()

set_score_request(opts): Promise<any>

Request metadata passed to the score method.

Note that this method is only relevant if enable_metadata_routing=True (see sklearn.set_config). Please see User Guide on how the routing mechanism works.

The options for each parameter are:

Parameters

ParameterTypeDescription
optsobject-
opts.sample_weight?string | booleanMetadata routing for sample_weight parameter in score.

Returns Promise<any>

Defined in generated/multioutput/MultiOutputRegressor.ts:419