IsotonicRegression
Isotonic regression model.
Read more in the User Guide.
Python Reference (opens in a new tab)
Constructors
constructor()
Signature
new IsotonicRegression(opts?: object): IsotonicRegression;
Parameters
Name | 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. Default Value true |
opts.out_of_bounds? | "nan" | "clip" | "raise" | Handles how X values outside of the training domain are handled during prediction. Default Value 'nan' |
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
Defined in: generated/isotonic/IsotonicRegression.ts:23 (opens in a new tab)
Methods
dispose()
Disposes of the underlying Python resources.
Once dispose()
is called, the instance is no longer usable.
Signature
dispose(): Promise<void>;
Returns
Promise
<void
>
Defined in: generated/isotonic/IsotonicRegression.ts:111 (opens in a new tab)
fit()
Fit the model using X, y as training data.
Signature
fit(opts: object): Promise<any>;
Parameters
Name | Type | Description |
---|---|---|
opts | object | - |
opts.X? | number | ArrayLike | Training data. |
opts.sample_weight? | ArrayLike | Weights. If set to undefined , all weights will be set to 1 (equal weights). |
opts.y? | ArrayLike | Training target. |
Returns
Promise
<any
>
Defined in: generated/isotonic/IsotonicRegression.ts:128 (opens in a new tab)
fit_transform()
Fit to data, then transform it.
Fits transformer to X
and y
with optional parameters fit\_params
and returns a transformed version of X
.
Signature
fit_transform(opts: object): Promise<any[]>;
Parameters
Name | Type | Description |
---|---|---|
opts | object | - |
opts.X? | ArrayLike [] | Input samples. |
opts.fit_params? | any | Additional fit parameters. |
opts.y? | ArrayLike | Target values (undefined for unsupervised transformations). |
Returns
Promise
<any
[]>
Defined in: generated/isotonic/IsotonicRegression.ts:179 (opens in a new tab)
get_feature_names_out()
Get output feature names for transformation.
Signature
get_feature_names_out(opts: object): Promise<any>;
Parameters
Name | Type | Description |
---|---|---|
opts | object | - |
opts.input_features? | any | Ignored. |
Returns
Promise
<any
>
Defined in: generated/isotonic/IsotonicRegression.ts:230 (opens in a new tab)
get_metadata_routing()
Get metadata routing of this object.
Please check User Guide on how the routing mechanism works.
Signature
get_metadata_routing(opts: object): Promise<any>;
Parameters
Name | Type | Description |
---|---|---|
opts | object | - |
opts.routing? | any | A MetadataRequest encapsulating routing information. |
Returns
Promise
<any
>
Defined in: generated/isotonic/IsotonicRegression.ts:270 (opens in a new tab)
init()
Initializes the underlying Python resources.
This instance is not usable until the Promise
returned by init()
resolves.
Signature
init(py: PythonBridge): Promise<void>;
Parameters
Name | Type |
---|---|
py | PythonBridge |
Returns
Promise
<void
>
Defined in: generated/isotonic/IsotonicRegression.ts:65 (opens in a new tab)
predict()
Predict new data by linear interpolation.
Signature
predict(opts: object): Promise<ArrayLike>;
Parameters
Name | Type | Description |
---|---|---|
opts | object | - |
opts.T? | number | ArrayLike | Data to transform. |
Returns
Promise
<ArrayLike
>
Defined in: generated/isotonic/IsotonicRegression.ts:308 (opens in a new tab)
score()
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.
Signature
score(opts: object): Promise<number>;
Parameters
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 . |
Returns
Promise
<number
>
Defined in: generated/isotonic/IsotonicRegression.ts:345 (opens in a new tab)
set_fit_request()
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:
Signature
set_fit_request(opts: object): Promise<any>;
Parameters
Name | 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:398 (opens in a new tab)
set_output()
Set output container.
See Introducing the set_output API for an example on how to use the API.
Signature
set_output(opts: object): Promise<any>;
Parameters
Name | Type | Description |
---|---|---|
opts | object | - |
opts.transform? | "default" | "pandas" | Configure output of transform and fit\_transform . |
Returns
Promise
<any
>
Defined in: generated/isotonic/IsotonicRegression.ts:438 (opens in a new tab)
set_predict_request()
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:
Signature
set_predict_request(opts: object): Promise<any>;
Parameters
Name | Type | Description |
---|---|---|
opts | object | - |
opts.T? | string | boolean | Metadata routing for T parameter in predict . |
Returns
Promise
<any
>
Defined in: generated/isotonic/IsotonicRegression.ts:477 (opens in a new tab)
set_score_request()
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:
Signature
set_score_request(opts: object): Promise<any>;
Parameters
Name | 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:518 (opens in a new tab)
set_transform_request()
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:
Signature
set_transform_request(opts: object): Promise<any>;
Parameters
Name | Type | Description |
---|---|---|
opts | object | - |
opts.T? | string | boolean | Metadata routing for T parameter in transform . |
Returns
Promise
<any
>
Defined in: generated/isotonic/IsotonicRegression.ts:560 (opens in a new tab)
transform()
Transform new data by linear interpolation.
Signature
transform(opts: object): Promise<ArrayLike>;
Parameters
Name | Type | Description |
---|---|---|
opts | object | - |
opts.T? | number | ArrayLike | Data to transform. |
Returns
Promise
<ArrayLike
>
Defined in: generated/isotonic/IsotonicRegression.ts:597 (opens in a new tab)
Properties
_isDisposed
boolean
=false
Defined in: generated/isotonic/IsotonicRegression.ts:21 (opens in a new tab)
_isInitialized
boolean
=false
Defined in: generated/isotonic/IsotonicRegression.ts:20 (opens in a new tab)
_py
PythonBridge
Defined in: generated/isotonic/IsotonicRegression.ts:19 (opens in a new tab)
id
string
Defined in: generated/isotonic/IsotonicRegression.ts:16 (opens in a new tab)
opts
any
Defined in: generated/isotonic/IsotonicRegression.ts:17 (opens in a new tab)
Accessors
X_max_
Maximum value of input array X\_
for right bound.
Signature
X_max_(): Promise<number>;
Returns
Promise
<number
>
Defined in: generated/isotonic/IsotonicRegression.ts:659 (opens in a new tab)
X_min_
Minimum value of input array X\_
for left bound.
Signature
X_min_(): Promise<number>;
Returns
Promise
<number
>
Defined in: generated/isotonic/IsotonicRegression.ts:632 (opens in a new tab)
X_thresholds_
Unique ascending X
values used to interpolate the y = f(X) monotonic function.
Signature
X_thresholds_(): Promise<ArrayLike>;
Returns
Promise
<ArrayLike
>
Defined in: generated/isotonic/IsotonicRegression.ts:686 (opens in a new tab)
f_
The stepwise interpolating function that covers the input domain X
.
Signature
f_(): Promise<any>;
Returns
Promise
<any
>
Defined in: generated/isotonic/IsotonicRegression.ts:740 (opens in a new tab)
increasing_
Inferred value for increasing
.
Signature
increasing_(): Promise<boolean>;
Returns
Promise
<boolean
>
Defined in: generated/isotonic/IsotonicRegression.ts:765 (opens in a new tab)
py
Signature
py(): PythonBridge;
Returns
PythonBridge
Defined in: generated/isotonic/IsotonicRegression.ts:52 (opens in a new tab)
Signature
py(pythonBridge: PythonBridge): void;
Parameters
Name | Type |
---|---|
pythonBridge | PythonBridge |
Returns
void
Defined in: generated/isotonic/IsotonicRegression.ts:56 (opens in a new tab)
y_thresholds_
De-duplicated y
values suitable to interpolate the y = f(X) monotonic function.
Signature
y_thresholds_(): Promise<ArrayLike>;
Returns
Promise
<ArrayLike
>
Defined in: generated/isotonic/IsotonicRegression.ts:713 (opens in a new tab)