DocumentationClassesIsotonicRegression

Class: IsotonicRegression

Isotonic regression model.

Read more in the User Guide.

Python Reference

Constructors

new IsotonicRegression()

new IsotonicRegression(opts?): IsotonicRegression

Parameters

ParameterTypeDescription
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?numberUpper bound on the highest predicted value (the maximum may still be lower). If not set, defaults to +inf.
opts.y_min?numberLower 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

PropertyTypeDefault valueDefined in
_isDisposedbooleanfalsegenerated/isotonic/IsotonicRegression.ts:21
_isInitializedbooleanfalsegenerated/isotonic/IsotonicRegression.ts:20
_pyPythonBridgeundefinedgenerated/isotonic/IsotonicRegression.ts:19
idstringundefinedgenerated/isotonic/IsotonicRegression.ts:16
optsanyundefinedgenerated/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

ParameterType
pythonBridgePythonBridge

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

ParameterTypeDescription
optsobject-
opts.sample_weight?ArrayLikeWeights. If set to undefined, all weights will be set to 1 (equal weights).
opts.X?number | ArrayLikeTraining data.
opts.y?ArrayLikeTraining 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

ParameterTypeDescription
optsobject-
opts.fit_params?anyAdditional fit parameters.
opts.X?ArrayLike[]Input samples.
opts.y?ArrayLikeTarget 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

ParameterTypeDescription
optsobject-
opts.input_features?anyIgnored.

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

ParameterTypeDescription
optsobject-
opts.routing?anyA 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

ParameterType
pyPythonBridge

Returns Promise<void>

Defined in generated/isotonic/IsotonicRegression.ts:65


predict()

predict(opts): Promise<ArrayLike>

Predict new data by linear interpolation.

Parameters

ParameterTypeDescription
optsobject-
opts.T?number | ArrayLikeData 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

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/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

ParameterTypeDescription
optsobject-
opts.sample_weight?string | booleanMetadata 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

ParameterTypeDescription
optsobject-
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

ParameterTypeDescription
optsobject-
opts.T?string | booleanMetadata 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

ParameterTypeDescription
optsobject-
opts.sample_weight?string | booleanMetadata 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

ParameterTypeDescription
optsobject-
opts.T?string | booleanMetadata 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

ParameterTypeDescription
optsobject-
opts.T?number | ArrayLikeData to transform.

Returns Promise<ArrayLike>

Defined in generated/isotonic/IsotonicRegression.ts:567