hidimstat.BaseVariableImportance#

class hidimstat.BaseVariableImportance[source]#

Bases: BaseEstimator

Base class for variable importance methods.

This class provides a foundation for implementing variable importance methods, including feature selection based on importance scores and p-values.

Attributes:
importances_array-like of shape (n_features,), default=None

The computed importance scores for each feature.

pvalues_array-like of shape (n_features,), default=None

The computed p-values for each feature.

selections_array-like of shape (n_features,), default=None

Binary mask indicating selected features.

Methods

selection(k_best=None, percentile=None, threshold=None, threshold_pvalue=None)

Selects features based on importance scores and/or p-values using various criteria.

_check_importance()

Checks if importance scores and p-values have been computed.

selection(k_best=None, percentile=None, threshold=None, threshold_pvalue=None)[source]#

Selects features based on variable importance. In case several arguments are different from None, the returned selection is the conjunction of all of them.

Parameters:
k_bestint, optional, default=None

Selects the top k features based on importance scores.

percentilefloat, optional, default=None

Selects features based on a specified percentile of importance scores.

thresholdfloat, optional, default=None

Selects features with importance scores above the specified threshold.

threshold_pvaluefloat, optional, default=None

Selects features with p-values below the specified threshold.

Returns:
selectionarray-like of shape (n_features,)

Binary array indicating the selected features.

get_metadata_routing()[source]#

Get metadata routing of this object.

Please check User Guide on how the routing mechanism works.

Returns:
routingMetadataRequest

A MetadataRequest encapsulating routing information.

get_params(deep=True)[source]#

Get parameters for this estimator.

Parameters:
deepbool, default=True

If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns:
paramsdict

Parameter names mapped to their values.

set_params(**params)[source]#

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.

Parameters:
**paramsdict

Estimator parameters.

Returns:
selfestimator instance

Estimator instance.