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.
new MultiOutputRegressor(opts?: object): MultiOutputRegressor;
Name | Type | Description |
---|---|---|
opts? |
object |
- |
opts.estimator? |
any |
An estimator object implementing fit and predict. |
opts.n_jobs? |
number |
The 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. |
Defined in: generated/multioutput/MultiOutputRegressor.ts:23
Disposes of the underlying Python resources.
Once dispose()
is called, the instance is no longer usable.
dispose(): Promise<void>;
Promise
<void
>
Defined in: generated/multioutput/MultiOutputRegressor.ts:99
Fit the model to data, separately for each output variable.
fit(opts: object): Promise<any>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.X? |
ArrayLike |
The input data. |
opts.fit_params? |
any |
Parameters passed to the estimator.fit method of each step. |
opts.sample_weight? |
ArrayLike |
Sample weights. If undefined , then samples are equally weighted. Only supported if the underlying regressor supports sample weights. |
opts.y? |
ArrayLike |
Multi-output targets. An indicator matrix turns on multilabel estimation. |
Promise
<any
>
Defined in: generated/multioutput/MultiOutputRegressor.ts:116
Get metadata routing of this object.
Please check User Guide on how the routing mechanism works.
get_metadata_routing(opts: object): Promise<any>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.routing? |
any |
A MetadataRouter encapsulating routing information. |
Promise
<any
>
Defined in: generated/multioutput/MultiOutputRegressor.ts:174
Initializes the underlying Python resources.
This instance is not usable until the Promise
returned by init()
resolves.
init(py: PythonBridge): Promise<void>;
Name | Type |
---|---|
py |
PythonBridge |
Promise
<void
>
Defined in: generated/multioutput/MultiOutputRegressor.ts:55
Incrementally fit the model to data, for each output variable.
partial_fit(opts: object): Promise<any>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.X? |
ArrayLike |
The input data. |
opts.partial_fit_params? |
any |
Parameters 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? |
ArrayLike |
Sample weights. If undefined , then samples are equally weighted. Only supported if the underlying regressor supports sample weights. |
opts.y? |
ArrayLike |
Multi-output targets. |
Promise
<any
>
Defined in: generated/multioutput/MultiOutputRegressor.ts:212
Predict multi-output variable using model for each target variable.
predict(opts: object): Promise<ArrayLike>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.X? |
ArrayLike |
The input data. |
Promise
<ArrayLike
>
Defined in: generated/multioutput/MultiOutputRegressor.ts:274
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.
score(opts: object): Promise<number>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
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.sample_weight? |
ArrayLike |
Sample weights. |
opts.y? |
ArrayLike |
True values for X . |
Promise
<number
>
Defined in: generated/multioutput/MultiOutputRegressor.ts:311
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:
set_fit_request(opts: object): Promise<any>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.sample_weight? |
string | boolean |
Metadata routing for sample\_weight parameter in fit . |
Promise
<any
>
Defined in: generated/multioutput/MultiOutputRegressor.ts:364
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:
set_partial_fit_request(opts: object): Promise<any>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.sample_weight? |
string | boolean |
Metadata routing for sample\_weight parameter in partial\_fit . |
Promise
<any
>
Defined in: generated/multioutput/MultiOutputRegressor.ts:406
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:
set_score_request(opts: object): Promise<any>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.sample_weight? |
string | boolean |
Metadata routing for sample\_weight parameter in score . |
Promise
<any
>
Defined in: generated/multioutput/MultiOutputRegressor.ts:448
boolean
=false
Defined in: generated/multioutput/MultiOutputRegressor.ts:21
boolean
=false
Defined in: generated/multioutput/MultiOutputRegressor.ts:20
PythonBridge
Defined in: generated/multioutput/MultiOutputRegressor.ts:19
string
Defined in: generated/multioutput/MultiOutputRegressor.ts:16
any
Defined in: generated/multioutput/MultiOutputRegressor.ts:17
Estimators used for predictions.
estimators_(): Promise<any>;
Promise
<any
>
Defined in: generated/multioutput/MultiOutputRegressor.ts:486
Names of features seen during fit. Only defined if the underlying estimators expose such an attribute when fit.
feature_names_in_(): Promise<ArrayLike>;
Promise
<ArrayLike
>
Defined in: generated/multioutput/MultiOutputRegressor.ts:540
Number of features seen during fit. Only defined if the underlying estimator
exposes such an attribute when fit.
n_features_in_(): Promise<number>;
Promise
<number
>
Defined in: generated/multioutput/MultiOutputRegressor.ts:513
py(): PythonBridge;
PythonBridge
Defined in: generated/multioutput/MultiOutputRegressor.ts:42
py(pythonBridge: PythonBridge): void;
Name | Type |
---|---|
pythonBridge |
PythonBridge |
void
Defined in: generated/multioutput/MultiOutputRegressor.ts:46