deepmol.feature_selection package

Submodules

deepmol.feature_selection.base_feature_selector module

class BaseFeatureSelector(feature_selector)[source]

Bases: ABC, Transformer

Abstract class for feature selection. A BaseFeatureSelector uses features present in a Dataset object to select the most important ones. FeatureSelectors which are subclasses of this class should always operate over Dataset Objects.

select_features(other_object, inplace=False, **kwargs)

Method that modifies an input object inplace or on a copy.

Parameters:
  • self (object) – The class instance object.

  • other_object (object) – The object to apply the method to.

  • inplace (bool) – Whether to apply the method in place.

  • kwargs (dict) – Keyword arguments to pass to the method.

Returns:

new_object – The new object.

Return type:

object

class BorutaAlgorithm(estimator: callable | None = None, task: str = 'classification', support_weak: bool = False, n_estimators: int | str = 1000, perc: int = 100, alpha: float = 0.05, two_step: bool = True, max_iter: int = 100, random_state: int | None = None, verbose: int = 0)[source]

Bases: BaseFeatureSelector

Class for Boruta feature selection.

Boruta is an all-relevant feature selection method. It is based on the idea that all features are relevant until proven irrelevant. The algorithm is an iterative procedure that consists of two phases: the first phase randomly permutes the feature values and evaluates the performance of the classifier. The second phase eliminates the features that are less important than their shadow features. The shadow features are copies of the original features that are randomly permuted. The algorithm stops when all features are either declared important or declared irrelevant.

class KbestFS(k: int = 10, score_func: callable = <function f_classif>)[source]

Bases: BaseFeatureSelector

Class for K best feature selection.

Select features according to the k-highest scores.

class LowVarianceFS(threshold: float = 0.3)[source]

Bases: BaseFeatureSelector

Class for Low Variance feature selection. Feature selector that removes all features with low-variance.

class PercentilFS(percentil: int = 10, score_func: callable = <function f_classif>)[source]

Bases: BaseFeatureSelector

Class for percentil feature selection.

Select features according to a percentile of the highest scores.

class RFECVFS(estimator: callable | None = None, step: int | float = 1, min_features_to_select: int = 1, cv: int | callable | Iterable | None = None, scoring: str | callable | None = None, verbose: int = 0, n_jobs: int = -1)[source]

Bases: BaseFeatureSelector

Class for RFECV feature selection.

Feature ranking with recursive feature elimination and cross-validated selection of the best number of features.

class SelectFromModelFS(estimator: callable | None = None, threshold: str | float | None = None, prefit: bool = False, norm_order: int = 1, max_features: int | None = None)[source]

Bases: BaseFeatureSelector

Class for Select From Model feature selection.

Meta-transformer for selecting features based on importance weights.

Module contents