skforecast/skforecast-ai/feature-selection
- community
Checking that the SKILL.md file is still in the repository.
Selects the most relevant lags, window features, and exogenous variables using sklearn feature selectors (RFECV, SelectFromModel). Covers single-series and multi-series selection with force inclusion and subsampling. Use when the user has many features and wants to identify the most important ones.
Install
npx vskill@latest install skforecast/skforecast-ai/feature-selectionSKILL.md
The same SKILL.md was published earlier as skforecast/skforecast/feature-selection.
Feature Selection
When to Use
Feature selection is an optional refinement, not a step on the critical path. It is usually run once a forecaster is already trained and tuned, to trim the feature set and reduce model complexity, rather than to improve accuracy. It is also the slowest step in the pipeline, since the selector refits the estimator many times.
Use feature selection when:
- You have many lags or exogenous variables and want to reduce overfitting
- You want to identify which features matter most
- You need to speed up inference or training by removing irrelevant features
After a large reduction, re-run hyperparameter-optimization: the best parameters for the full feature set are not necessarily best for the trimmed one.
Related skills
- Prerequisite:
autocorrelation-and-lag-selection(generate an informed candidate set of lags before running the selector) - Prerequisite:
feature-engineering(create the rolling, calendar, and exogenous features that the selector will rank) - Next:
hyperparameter-optimization(re-tune the estimator on the reduced feature set)
Single Series
select_features works with ForecasterRecursive and ForecasterDirect.
Multi-Series
select_features_multiseries works with ForecasterRecursiveMultiSeries and ForecasterDirectMultiVariate.
Note: When used withForecasterDirectMultiVariate,selected_lagsis returned as adict(one entry per series) instead of alist.
Force Inclusion
Select Only Specific Feature Types
Common Mistakes
- Using the wrong selector: RFECV works best for recursive feature elimination. For faster selection, use
SelectFromModel. - Too small subsample: If
subsampleis too small, selection may be unreliable. Use at least 0.3. - Not updating forecaster: After selection, update the forecaster with
forecaster.set_lags(selected_lags)— the original is not modified in place byselect_features. - Running on full dataset: Always run on training data only (
y_train,exog_train). - Confusing `selected_window_features` with `RollingFeatures`: The returned
selected_window_featuresis a list of feature name strings (e.g.['roll_mean_7', 'roll_std_14']), not theRollingFeaturesobject itself. Use these names to verify which window features were kept, but pass the originalRollingFeaturesinstance to the forecaster.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskforecast_ai/skills/feature-selection/SKILL.md
Popularity
- Repository stars
- 51
- Repository forks
- 8
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/skforecast/skforecast-ai/feature-selection)