Select Features from Model

../../../../_images/select_model.svg

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: model
Description: Input model
in-data
Type: table
Description: Input data

Output ports

out-data
Type: table
Description: Output data
features
Type: table
Description: 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 threshold value 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]