Select Features from Model¶
Meta-transformer for selecting features based on importance weight. Only works for models with coef or feature_importances attributes.
Documentation¶
Model based feature selection. Important features are selected based on a trained estimator’s importance scores. It is typically used with models that have a coef or feature_importances attribute, such as linear models or tree-based models (e.g., LogisticRegression or RandomForestClassifier).
It uses the model’s learned coefficients or importances to determine which features to keep. You can specify a threshold (default or custom) to decide which features are considered important enough to retain.
The given data is transformed to get a reduced feature set. This helps improve model performance by removing less useful or redundant features. It’s particularly useful in pipelines and when you’re trying to automate feature selection based on model insights.
Definition¶
Input ports¶
- model
Type: modelDescription: Input model- in-data
Type: tableDescription: Input data
Output ports¶
- out-data
Type: tableDescription: Output data- features
Type: tableDescription: Features
Configuration¶
- threshold (threshold)
The threshold value to use for feature selection. Features whose absolute importance value is greater or equal are kept while the others are discarded. If “median” (resp. “mean”), then the
thresholdvalue is the median (resp. the mean) of the feature importances. A scaling factor (e.g., “1.25*mean”) may also be used. If None and if the estimator has a parameter penalty set to l1, either explicitly or implicitly (e.g, Lasso), the threshold used is 1e-5. Otherwise, “mean” is used by default.
Implementation¶
- class node_application.SelectFromModel[source]