feature-engineering — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited feature-engineering (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
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.
| Cardinality | Encoder | Notes |
|---|---|---|
| Low (<15), tree model | One-hot or native categorical | LightGBM/CatBoost handle natively |
| Low, linear model | One-hot | Drop-first to avoid collinearity |
| High (>15) | Target/leave-one-out encoding | Must be cross-fitted to avoid leakage |
| Ordinal meaning | Ordinal map | Preserve order (low<med<high) |
log1p or Box-Cox/Yeo-Johnson.StandardScaler for linear/NN, none needed for trees.price / sqft).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)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 oofPipeline so scaler fits on train folds only.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.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.