Class: IsotonicRegression
Isotonic regression model.
Read more in the User Guide.
Constructors
new IsotonicRegression()
new IsotonicRegression(
opts
?):IsotonicRegression
Parameters
Parameter | Type | Description |
---|---|---|
opts ? | object | - |
opts.increasing ? | boolean | "auto" | Determines whether the predictions should be constrained to increase or decrease with X . ‘auto’ will decide based on the Spearman correlation estimate’s sign. |
opts.out_of_bounds ? | "nan" | "clip" | "raise" | Handles how X values outside of the training domain are handled during prediction. |
opts.y_max ? | number | Upper bound on the highest predicted value (the maximum may still be lower). If not set, defaults to +inf. |
opts.y_min ? | number | Lower bound on the lowest predicted value (the minimum value may still be higher). If not set, defaults to -inf. |
Returns IsotonicRegression
Defined in generated/isotonic/IsotonicRegression.ts:23
Properties
Property | Type | Default value | Defined in |
---|---|---|---|
_isDisposed | boolean | false | generated/isotonic/IsotonicRegression.ts:21 |
_isInitialized | boolean | false | generated/isotonic/IsotonicRegression.ts:20 |
_py | PythonBridge | undefined | generated/isotonic/IsotonicRegression.ts:19 |
id | string | undefined | generated/isotonic/IsotonicRegression.ts:16 |
opts | any | undefined | generated/isotonic/IsotonicRegression.ts:17 |
Accessors
f_
Get Signature
get f_():
Promise
<any
>
The stepwise interpolating function that covers the input domain X
.
Returns Promise
<any
>
Defined in generated/isotonic/IsotonicRegression.ts:709
increasing_
Get Signature
get increasing_():
Promise
<boolean
>
Inferred value for increasing
.
Returns Promise
<boolean
>
Defined in generated/isotonic/IsotonicRegression.ts:734
py
Get Signature
get py():
PythonBridge
Returns PythonBridge
Set Signature
set py(
pythonBridge
):void
Parameters
Parameter | Type |
---|---|
pythonBridge | PythonBridge |
Returns void
Defined in generated/isotonic/IsotonicRegression.ts:52
X_max_
Get Signature
get X_max_():
Promise
<number
>
Maximum value of input array X_
for right bound.
Returns Promise
<number
>
Defined in generated/isotonic/IsotonicRegression.ts:628
X_min_
Get Signature
get X_min_():
Promise
<number
>
Minimum value of input array X_
for left bound.
Returns Promise
<number
>
Defined in generated/isotonic/IsotonicRegression.ts:601
X_thresholds_
Get Signature
get X_thresholds_():
Promise
<ArrayLike
>
Unique ascending X
values used to interpolate the y = f(X) monotonic function.
Returns Promise
<ArrayLike
>
Defined in generated/isotonic/IsotonicRegression.ts:655
y_thresholds_
Get Signature
get y_thresholds_():
Promise
<ArrayLike
>
De-duplicated y
values suitable to interpolate the y = f(X) monotonic function.
Returns Promise
<ArrayLike
>
Defined in generated/isotonic/IsotonicRegression.ts:682
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/isotonic/IsotonicRegression.ts:108
fit()
fit(
opts
):Promise
<any
>
Fit the model using X, y as training data.
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.sample_weight ? | ArrayLike | Weights. If set to undefined , all weights will be set to 1 (equal weights). |
opts.X ? | number | ArrayLike | Training data. |
opts.y ? | ArrayLike | Training target. |
Returns Promise
<any
>
Defined in generated/isotonic/IsotonicRegression.ts:125
fit_transform()
fit_transform(
opts
):Promise
<any
[]>
Fit to data, then transform it.
Fits transformer to X
and y
with optional parameters fit_params
and returns a transformed version of X
.
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.fit_params ? | any | Additional fit parameters. |
opts.X ? | ArrayLike [] | Input samples. |
opts.y ? | ArrayLike | Target values (undefined for unsupervised transformations). |
Returns Promise
<any
[]>
Defined in generated/isotonic/IsotonicRegression.ts:171
get_feature_names_out()
get_feature_names_out(
opts
):Promise
<any
>
Get output feature names for transformation.
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.input_features ? | any | Ignored. |
Returns Promise
<any
>
Defined in generated/isotonic/IsotonicRegression.ts:217
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
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.routing ? | any | A MetadataRequest encapsulating routing information. |
Returns Promise
<any
>
Defined in generated/isotonic/IsotonicRegression.ts:255
init()
init(
py
):Promise
<void
>
Initializes the underlying Python resources.
This instance is not usable until the Promise
returned by init()
resolves.
Parameters
Parameter | Type |
---|---|
py | PythonBridge |
Returns Promise
<void
>
Defined in generated/isotonic/IsotonicRegression.ts:65
predict()
predict(
opts
):Promise
<ArrayLike
>
Predict new data by linear interpolation.
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.T ? | number | ArrayLike | Data to transform. |
Returns Promise
<ArrayLike
>
Defined in generated/isotonic/IsotonicRegression.ts:291
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
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.sample_weight ? | ArrayLike | Sample 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 ? | ArrayLike | True values for X . |
Returns Promise
<number
>
Defined in generated/isotonic/IsotonicRegression.ts:327
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
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.sample_weight ? | string | boolean | Metadata routing for sample_weight parameter in fit . |
Returns Promise
<any
>
Defined in generated/isotonic/IsotonicRegression.ts:375
set_output()
set_output(
opts
):Promise
<any
>
Set output container.
See Introducing the set_output API for an example on how to use the API.
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.transform ? | "default" | "pandas" | "polars" | Configure output of transform and fit_transform . |
Returns Promise
<any
>
Defined in generated/isotonic/IsotonicRegression.ts:413
set_predict_request()
set_predict_request(
opts
):Promise
<any
>
Request metadata passed to the predict
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
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.T ? | string | boolean | Metadata routing for T parameter in predict . |
Returns Promise
<any
>
Defined in generated/isotonic/IsotonicRegression.ts:451
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
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.sample_weight ? | string | boolean | Metadata routing for sample_weight parameter in score . |
Returns Promise
<any
>
Defined in generated/isotonic/IsotonicRegression.ts:491
set_transform_request()
set_transform_request(
opts
):Promise
<any
>
Request metadata passed to the transform
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
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.T ? | string | boolean | Metadata routing for T parameter in transform . |
Returns Promise
<any
>
Defined in generated/isotonic/IsotonicRegression.ts:531
transform()
transform(
opts
):Promise
<ArrayLike
>
Transform new data by linear interpolation.
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.T ? | number | ArrayLike | Data to transform. |
Returns Promise
<ArrayLike
>
Defined in generated/isotonic/IsotonicRegression.ts:567