AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Feature Engineering

skill-param087-agent-ml-skills-feature-engineering · by param087

Use when creating, encoding, scaling, or selecting features for ML models. Covers categorical encoding, numeric transforms, datetime/text/aggregation features, and leakage-safe target encoding.

No reviews yet
0 installs
34 views
0.0% view→install

Install

$ agentstack add skill-param087-agent-ml-skills-feature-engineering

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-param087-agent-ml-skills-feature-engineering)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Feature Engineering? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Feature Engineering

Overview

Feature engineering is where most model performance is won or lost. The aim is to express the signal in a form the model can use, while never letting information from the target or the test set leak into a feature.

When to use

  • After cleaning, before/iterating with modeling.
  • A model plateaus and you suspect under-expressed signal.
  • You have raw datetime, text, or relational data to turn into columns.

Encoding categoricals

| Cardinality | Encoder | Notes | |-------------|---------|-------| | Low (15) | Target/leave-one-out encoding | Must be cross-fitted to avoid leakage | | Ordinal meaning | Ordinal map | Preserve order (low<med<high) |

Numeric transforms

  • Skewed positive valueslog1p or Box-Cox/Yeo-Johnson.
  • ScalingStandardScaler for linear/NN, none needed for trees.
  • Binning → only when the relationship is genuinely non-monotonic.
  • Interactions → products/ratios of features with domain meaning (e.g., price / sqft).

Datetime features

ts = df["event_time"]
df["hour"] = ts.dt.hour
df["dayofweek"] = ts.dt.dayofweek
df["is_weekend"] = ts.dt.dayofweek.ge(5).astype(int)
df["month"] = ts.dt.month
# Cyclical encoding so 23:00 and 00:00 are close
import numpy as np
df["hour_sin"] = np.sin(2 * np.pi * df["hour"] / 24)
df["hour_cos"] = np.cos(2 * np.pi * df["hour"] / 24)

Leakage-safe target encoding

Target encoding must be fit out-of-fold, never on the rows it encodes:

from sklearn.model_selection import KFold
import numpy as np

def target_encode_oof(train, col, target, n_splits=5, smoothing=10):
    oof = np.zeros(len(train))
    prior = train[target].mean()
    kf = KFold(n_splits=n_splits, shuffle=True, random_state=42)
    for tr_idx, val_idx in kf.split(train):
        agg = train.iloc[tr_idx].groupby(col)[target].agg(["mean", "count"])
        smooth = (agg["mean"] * agg["count"] + prior * smoothing) / (agg["count"] + smoothing)
        oof[val_idx] = train.iloc[val_idx][col].map(smooth).fillna(prior).values
    return oof

Pitfalls

  • Target encoding fit on all rows → severe leakage, inflated CV, collapse in production.
  • Scaling fit on full data → use Pipeline so scaler fits on train folds only.
  • Aggregations over the whole timeline in time-series → only use past data (rolling windows with proper shift).
  • Creating thousands of features then trusting noisy importance — prefer a few well-motivated features + regularization.

Hand-off

Deliver a documented feature set (name, source, rationale) and ensure all transforms are wrapped in a fitted Pipeline for the model-evaluation and model-serving skills to reuse.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.