Skip to content

Documentation for ModelSelector

Model Selector - based on feature_importance.

Apply feature selection on specific estimator and its importance scores.

__init__(self, estimator_obj, threshold=1e-05, percentile=False) special

Initialize the object.

Parameters:

Name Type Description Default
estimator_obj BaseEstimator

Estimator with fit/tranform and possibility of feature_importance.

required
threshold float

If percentile == True: Lower Bound for required importance score to keep. If percentile == True: percentage to keep (ordered features by feature_importance)

1e-05
percentile bool

Percent of features to keep.

False
Source code in photonai/modelwrapper/feature_selection.py
def __init__(self, estimator_obj: BaseEstimator, threshold: float = 1e-5, percentile: bool = False):
    """
    Initialize the object.

    Parameters:
        estimator_obj:
            Estimator with fit/tranform and possibility of feature_importance.

        threshold:
            If percentile == True:
                Lower Bound for required importance score to keep.
            If percentile == True:
                percentage to keep (ordered features by feature_importance)

        percentile:
            Percent of features to keep.

    """
    self.threshold = threshold
    self.estimator_obj = estimator_obj
    self.selected_indices = []
    self.percentile = percentile
    self.importance_scores = []
    self.n_original_features = None