Skip to content
Back to skills

Feature Engineering

ASecurity

Feature Engineering. Create, extract and select model inputs - feature extraction (PCA, SVD, TF-IDF, embeddings, signal features), feature engineering (date parts, cyclical encoding, lags, rolling windows, ratios, interactions, binning, target encoding, frequency encoding, geospatial), feature selection (mutual information, RFE, L1, stability selection), feature dictionary and ablation. Use for feature creation, feature construction, encoding categoricals, dimensionality reduction for modelin...

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 7, 2026
datarustgoapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 7, 2026

npx -y skills add Harrypatria/data-mining-ml --skill feature-engineering --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Feature Engineering?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Feature Engineering
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/harrypatria-feature-engineering/badge)](https://www.skillsdirectory.com/skills/harrypatria-feature-engineering)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: feature-engineering
description: Feature Engineering. Create, extract and select model inputs - feature extraction (PCA, SVD, TF-IDF, embeddings, signal features), feature engineering (date parts, cyclical encoding, lags, rolling windows, ratios, interactions, binning, target encoding, frequency encoding, geospatial), feature selection (mutual information, RFE, L1, stability selection), feature dictionary and ablation. Use for feature creation, feature construction, encoding categoricals, dimensionality reduction for modeling, or improving a machine learning model's inputs.
---

# Feature Engineering

## Two different ideas

- **Feature extraction** compresses raw or high-dimensional data into a compact representation (PCA, truncated SVD, NMF, TF-IDF, pretrained embeddings, FFT and rolling statistics). Always state what information is lost and how you inspected it: explained variance, reconstruction error, loadings.
- **Feature engineering** builds informative inputs from domain knowledge (ratios, lags, cyclical time, group aggregates, flags). Every feature needs a rationale.

## Rules

1. Each engineered feature has a one-line rationale and passes the leakage question: *would this value exist at prediction time?*
2. Features are computed inside the pipeline (`ColumnTransformer`, `FunctionTransformer` with a named importable function, or a custom transformer in `src/<package>/transformers.py`) so training and serving share code.
3. Anything that learns from data (encoders, binning edges, selectors, PCA, target encoding) is fitted on training folds only.
4. Lags and rolling windows use only past data: `shift(k)` with k above zero, trailing windows, grouped by entity, computed per snapshot.
5. Target encoding is out-of-fold: `sklearn.preprocessing.TargetEncoder` (cross-fitted in `fit_transform`) inside the pipeline.
6. Record a feature dictionary: name, source, transform, type, rationale, availability time. `mlkit.features.feature_dictionary()` writes it.

## Selection

| Family | Methods | Use when |
|---|---|---|
| Filter | variance threshold, mutual information, chi-squared, ANOVA F | Many features, quick screen |
| Wrapper | RFE, sequential selection | Moderate p, model-specific |
| Embedded | L1, elastic net, tree importance | Selection as part of fitting |
| Stability | Selection frequency across bootstrap resamples | Small n, need trustworthy sets |

Selection lives inside the pipeline and is evaluated with cross-validation. Remove leaky and near-duplicate features first.

## Ablation

Report the CV metric with and without each feature group (raw, ratios, lags, encodings) with fold spread. Keep groups whose gain exceeds the fold-to-fold noise.

## Output

- Pipeline code in `src/<package>/features.py`, imported by the notebook and the API.
- `artifacts/feature_dictionary.csv`.
- Ablation table under a findings heading.

Recipes with code: `references/feature-recipes.md`.

Files in this skill

  • SKILL.md2.9 KB
  • references/feature-recipes.md3.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.