DocumentationClassesOrthogonalMatchingPursuitCV

Class: OrthogonalMatchingPursuitCV

Cross-validated Orthogonal Matching Pursuit model (OMP).

See glossary entry for cross-validation estimator.

Read more in the User Guide.

Python Reference

Constructors

new OrthogonalMatchingPursuitCV()

new OrthogonalMatchingPursuitCV(opts?): OrthogonalMatchingPursuitCV

Parameters

ParameterTypeDescription
opts?object-
opts.copy?booleanWhether the design matrix X must be copied by the algorithm. A false value is only helpful if X is already Fortran-ordered, otherwise a copy is made anyway.
opts.cv?numberDetermines the cross-validation splitting strategy. Possible inputs for cv are:
opts.fit_intercept?booleanWhether to calculate the intercept for this model. If set to false, no intercept will be used in calculations (i.e. data is expected to be centered).
opts.max_iter?numberMaximum numbers of iterations to perform, therefore maximum features to include. 10% of n_features but at least 5 if available.
opts.n_jobs?numberNumber of CPUs to use during the cross validation. undefined means 1 unless in a joblib.parallel_backend context. \-1 means using all processors. See Glossary for more details.
opts.verbose?number | booleanSets the verbosity amount.

Returns OrthogonalMatchingPursuitCV

Defined in generated/linear_model/OrthogonalMatchingPursuitCV.ts:25

Properties

PropertyTypeDefault valueDefined in
_isDisposedbooleanfalsegenerated/linear_model/OrthogonalMatchingPursuitCV.ts:23
_isInitializedbooleanfalsegenerated/linear_model/OrthogonalMatchingPursuitCV.ts:22
_pyPythonBridgeundefinedgenerated/linear_model/OrthogonalMatchingPursuitCV.ts:21
idstringundefinedgenerated/linear_model/OrthogonalMatchingPursuitCV.ts:18
optsanyundefinedgenerated/linear_model/OrthogonalMatchingPursuitCV.ts:19

Accessors

coef_

Get Signature

get coef_(): Promise<ArrayLike>

Parameter vector (w in the problem formulation).

Returns Promise<ArrayLike>

Defined in generated/linear_model/OrthogonalMatchingPursuitCV.ts:374


feature_names_in_

Get Signature

get feature_names_in_(): Promise<ArrayLike>

Names of features seen during fit. Defined only when X has feature names that are all strings.

Returns Promise<ArrayLike>

Defined in generated/linear_model/OrthogonalMatchingPursuitCV.ts:482


intercept_

Get Signature

get intercept_(): Promise<number | ArrayLike>

Independent term in decision function.

Returns Promise<number | ArrayLike>

Defined in generated/linear_model/OrthogonalMatchingPursuitCV.ts:347


n_features_in_

Get Signature

get n_features_in_(): Promise<number>

Number of features seen during fit.

Returns Promise<number>

Defined in generated/linear_model/OrthogonalMatchingPursuitCV.ts:455


n_iter_

Get Signature

get n_iter_(): Promise<number | ArrayLike>

Number of active features across every target for the model refit with the best hyperparameters got by cross-validating across all folds.

Returns Promise<number | ArrayLike>

Defined in generated/linear_model/OrthogonalMatchingPursuitCV.ts:428


n_nonzero_coefs_

Get Signature

get n_nonzero_coefs_(): Promise<number>

Estimated number of non-zero coefficients giving the best mean squared error over the cross-validation folds.

Returns Promise<number>

Defined in generated/linear_model/OrthogonalMatchingPursuitCV.ts:401


py

Get Signature

get py(): PythonBridge

Returns PythonBridge

Set Signature

set py(pythonBridge): void

Parameters

ParameterType
pythonBridgePythonBridge

Returns void

Defined in generated/linear_model/OrthogonalMatchingPursuitCV.ts:66

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/linear_model/OrthogonalMatchingPursuitCV.ts:122


fit()

fit(opts): Promise<any>

Fit the model using X, y as training data.

Parameters

ParameterTypeDescription
optsobject-
opts.fit_params?anyParameters to pass to the underlying splitter.
opts.X?ArrayLike[]Training data.
opts.y?ArrayLikeTarget values. Will be cast to X’s dtype if necessary.

Returns Promise<any>

Defined in generated/linear_model/OrthogonalMatchingPursuitCV.ts:139


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/linear_model/OrthogonalMatchingPursuitCV.ts:187


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/linear_model/OrthogonalMatchingPursuitCV.ts:79


predict()

predict(opts): Promise<any>

Predict using the linear model.

Parameters

ParameterTypeDescription
optsobject-
opts.X?anySamples.

Returns Promise<any>

Defined in generated/linear_model/OrthogonalMatchingPursuitCV.ts:223


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/linear_model/OrthogonalMatchingPursuitCV.ts:261


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/linear_model/OrthogonalMatchingPursuitCV.ts:311