agentleFS
kienbui1995kienbui1995/magic-powers/skills/feature-engineering/SKILL.md

feature-engineering

Skill0 starsChanged 8 months agoMITView on GitHub

Use when selecting, transforming, or creating features for ML models

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When preparing data for model training — selecting which signals to use, how to encode them, and what new features to derive.

    line 9
  2. Distinctive:

    Remove features with > 50% missing

    line 47
  3. Distinctive:

    Use permutation importance or SHAP for post-hoc selection

    line 48

“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Feature Engineering

When to Use

When preparing data for model training — selecting which signals to use, how to encode them, and what new features to derive.

Core Jobs

1. Understand the Data

Before engineering:

  • Distribution of each feature (histogram, describe())
  • Missing value rates
  • Correlation with target (mutual information, Pearson)
  • Correlation between features (avoid multicollinearity for linear models)

2. Handle Raw Features

Numeric:

  • Scale: StandardScaler (normal dist), MinMaxScaler (bounded), RobustScaler (outliers)
  • Transform: log(x+1) for skewed distributions

Categorical:

  • Low cardinality (< 15 values): one-hot encoding
  • High cardinality (> 50 values): target encoding, embedding
  • Ordinal: label encode with meaningful order

Text:

  • TF-IDF for sparse models
  • Embeddings (sentence-transformers) for semantic similarity

Temporal:

  • Extract: hour, day of week, month, is_weekend
  • Cyclical: sin/cos encoding for hour/day
  • Lag features: value at T-1, T-7, T-30

3. Create Derived Features

  • Ratios: clicks/impressions, revenue/user
  • Differences: current_price - avg_price
  • Aggregations: user's avg purchase in last 30 days
  • Interaction features: feature_A × feature_B (for linear models)

4. Feature Selection

  • Remove zero-variance features
  • Remove features with > 50% missing
  • Use permutation importance or SHAP for post-hoc selection
  • Regularization (L1/Lasso) for automatic selection

Key Outputs

  • Feature engineering pipeline (sklearn Pipeline or similar)
  • Feature importance report
  • Missing value and encoding strategy doc

Anti-Patterns

  • Feature leakage (using future data to predict past)
  • Fitting scalers on the full dataset (fit on train only)
  • Creating 200 features and not selecting — leads to overfitting
  • Forgetting to apply same transformations at inference time

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.