Sklearn Feature Selection
AI-generatedSummary
Select best features from input data using scikit-learn feature selection methods.
Inputs
- method — Feature selection method to use (selectKBest, selectPercentile, varianceThreshold, rfe).
- featureColumns (required) — Comma‑separated list of feature column names.
- targetColumn (required) — Name of the target column.
- k — Number of top features to select (used with selectKBest or rfe).
- percentile — Percent of features to keep (0‑100) (used with selectPercentile).
- threshold — Variance threshold below which features are removed (used with varianceThreshold).
- scoreFunc — Score function for selectKBest or selectPercentile.
- estimator — Base estimator for RFE.
- pythonPath — Path to the Python executable with scikit-learn installed.
Output shape
list of items containing transformed data and feature selection metadata
each item includes 'selected_features' and the transformed feature array; optional fields may be present (feature_scores, feature_variances, feature_rankings). On error an 'error' field may be returned.
Examples
Example 1: Select top 5 classification features using ANOVA F-score
method=selectKBest, k=5, scoreFunc=f_classif, featureColumns=age,income,education, targetColumn=label
Example 2: Perform Recursive Feature Elimination with a Random Forest classifier
method=rfe, estimator=RandomForestClassifier, k=10, featureColumns=feature1,feature2,feature3, targetColumn=target