BackwardSelectionFeatureSelector
BackwardSelectionFeatureSelector
dataclass
¶
BackwardSelectionFeatureSelector(
objective_metric: Optional[str] = None,
maximize_objective: Optional[bool] = None,
removal_ratio: Optional[float] = None,
removal_count: Optional[int] = None,
variable_importance: Optional[str] = None,
allow_structural_variable_importance: bool = False,
allow_model_self_evaluation_and_variable_importances: bool = True,
)
Bases: AbstractFeatureSelector
Greedy backward feature selector.
Attributes:
| Name | Type | Description |
|---|---|---|
removal_ratio |
Optional[float]
|
Ratio of the features are removed at each iteration. The
smaller the value, the more accurate but the more expensive the results.
Note that at lease one feature is removed at each round. Only one of
|
removal_count |
Optional[int]
|
Number of the features are removed at each iteration. The
smaller the value, the more accurate but the more expensive the results.
Only one of |
variable_importance |
Optional[str]
|
Name of the variable importance used to drive the
feature selection. Should be one of the keys of
|
allow_structural_variable_importance |
bool
|
If True, structural variable importances can be used to drive to the feature selection. If false and if only structural variable importances are available, raises an error. |
allow_model_self_evaluation_and_variable_importances |
bool
|
If True, and if the model produces a self evaluation and corresponding variable importances, use those values directly. If false, use the provided validation dataset to evaluate and compute the variable importances of the model. |
allow_model_self_evaluation_and_variable_importances
class-attribute
instance-attribute
¶
allow_structural_variable_importance
class-attribute
instance-attribute
¶
get_objective_score ¶
Gets the score of a metric to optimize. The greater the better.
run ¶
run(
learner: GenericLearner,
ds: InputDataset,
valid: Optional[InputDataset] = None,
verbose: Optional[Union[int, bool]] = None,
) -> ModelType
Runs the feature selector.