Skip to content
Back to skills

Ml Tabular Modeling

ASecurity

Build, tune and debug supervised machine learning models on tabular data (classification and regression) in the project's own stack, such as scikit-learn, XGBoost, LightGBM, CatBoost or statsmodels. Use when engineering features, preventing target or train-test leakage, choosing a cross-validation scheme (grouped, stratified), setting a baseline, tuning hyperparameters, handling class imbalance, calibrating probabilities, explaining a model with feature importance or SHAP, or making a modelin...

  • 19 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 29, 2026
ai-agentspythongosql

Security analysis

A100/100

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

Scanned November 29, 2026

npx -y skills add khoavd18/skills --skill ml-tabular-modeling --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ml Tabular Modeling?

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

Security grade badge for Ml Tabular Modeling
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/khoavd18-ml-tabular-modeling/badge)](https://www.skillsdirectory.com/skills/khoavd18-ml-tabular-modeling)

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: ml-tabular-modeling
description: Build, tune and debug supervised machine learning models on tabular data (classification and regression) in the project's own stack, such as scikit-learn, XGBoost, LightGBM, CatBoost or statsmodels. Use when engineering features, preventing target or train-test leakage, choosing a cross-validation scheme (grouped, stratified), setting a baseline, tuning hyperparameters, handling class imbalance, calibrating probabilities, explaining a model with feature importance or SHAP, or making a modeling notebook reproducible. Not for forecasting a time series (use time-series-forecasting), metric interpretation and model comparison (use ml-model-evaluation) or hypothesis tests and A/B tests (use statistics-experimentation).
---

# ML Tabular Modeling

Builds a model that will still work on next month's rows: leak-free features, an honest validation scheme, and a baseline to beat before anything clever.

## Inputs

- The prediction question: what is predicted, for which unit (one row per ...), **at what moment**, and what decision uses it.
- The dataset with its grain, the target definition and the time each feature becomes known. Business costs of errors and acceptance criteria are `UNKNOWN` until the owner states them.

## Procedure

1. **Detect the stack**: libraries and versions in requirements or notebooks, existing pipelines, data access (SQL, files) and how experiments are tracked. Follow the project's conventions.
2. **Frame the problem**: unit of prediction, prediction time, target window, label source. Write it down before touching features; most leakage comes from a vague prediction time.
3. **Profile and scan for leakage**: hand unfamiliar data to **data-profiling-engineer**; run [leakage_scan.py](scripts/leakage_scan.py) on the modeling table. Review every flagged column against the prediction time. Checklist in [leakage-and-validation.md](references/leakage-and-validation.md).
4. **Split first**: a final test set chosen by the deployment reality (later period, unseen customers or stores, random only when rows are truly independent). Never look at it until the end.
5. **Validation scheme**: stratified K-fold for independent rows, grouped K-fold when an entity has several rows, time-ordered splits when time matters (see **time-series-forecasting** for forecasting).
6. **Baselines**: majority class or mean, then a simple linear or tree model. Every later model must beat these on the same folds.
7. **Pipeline**: all fitted preprocessing (imputation, scaling, encoding, target encoding, feature selection, resampling) inside a pipeline fitted on training folds only. Patterns in [modeling-playbook.md](references/modeling-playbook.md).
8. **Iterate and tune** on cross-validation: features first, then model family, then a bounded hyperparameter search with a fixed seed and budget. Record each run.
9. **Imbalance and calibration**: prefer class weights and threshold choice over resampling; check calibration when probabilities are used as probabilities.
10. **Explain**: permutation importance on held-out data; SHAP for local explanations, described as associations, not causes.
11. **Hand off** the frozen model to **ml-model-evaluation** for one test-set evaluation.

## Rules

- A feature is allowed only if its value is known at prediction time. When unsure, it is `UNKNOWN` and stays out.
- Never fit anything (scaler, encoder, imputer, SMOTE, feature selection) on data that includes validation or test rows.
- Feature importance is not causality; causal claims go to **statistics-experimentation**.
- Do not drop rows or outliers to improve a score; record every exclusion with its reason and count.
- Keep personal data minimal; do not use protected attributes as features without an explicit, documented decision.
- Apply the [ML quality contract](../ml-model-evaluation/references/ml-quality-contract.md).

## Outputs

A reproducible pipeline (script or notebook), the problem framing, a leakage review, cross-validation results against baselines with fold spread, the selected model with its experiment record, and open questions for the data owner.

## Hand-offs

Exploring a new table → **data-profiling-engineer**. Feature extraction in SQL → **sql-analytics-expert**. Pandas mechanics → **python-data-analyst**. Final metrics, thresholds and model comparison → **ml-model-evaluation**.

Files in this skill

  • SKILL.md4.3 KB
  • references/leakage-and-validation.md2.7 KB
  • references/modeling-playbook.md3.6 KB
  • scripts/leakage_scan.py9.3 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.

View all in ai-agents →

Comments

Loading comments…

Newsletter

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