data-cleaning

data-cleaning is a skill for Claude Code, Codex from param087/agent-ml-skills. It costs 43 tokens per session (750 once invoked), scanned A, original, MIT.

A guide to turning messy raw data into a consistent table ready for analysis or machine-learning models.

In plain words
What is it for?
Use it before creating model inputs or training a model, especially when the dataset contains nulls, duplicates, mixed types, or poor-quality categories.
Why use it?
It helps handle missing values, duplicates, incorrect data types, unusual values, and inconsistent category names. It also keeps test data from influencing the cleaning process, which can make model results misleading.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/param087/agent-ml-skills/data-cleaning
Any agent
npx skills add param087/agent-ml-skills --skill data-cleaning
Clone the repo
git clone --depth 1 https://github.com/param087/agent-ml-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for data-cleaning

README.md
[![agentmods](https://agentmods.dev/badge/skills/param087/agent-ml-skills/data-cleaning.svg)](https://agentmods.dev/skills/param087/agent-ml-skills/data-cleaning)
Your own site
<a href="https://agentmods.dev/skills/param087/agent-ml-skills/data-cleaning"><img src="https://agentmods.dev/badge/skills/param087/agent-ml-skills/data-cleaning.svg" alt="Measured on agentmods" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 750 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00043 $0.00750
Opus 5 $0.00022 $0.00375
Sonnet 5 $0.00009 $0.00150
Haiku 4.5 $0.00004 $0.00075

Measured 5d ago against content hash d658c800c8c3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

data-cleaning scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/data-cleaning/SKILL.md · 75 lines

How it starts

The opening of the file, as written. The whole thing — 75 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Data Cleaning

Overview

Cleaning turns raw data into a consistent, model-ready table without leaking information from the future or the test set. The golden rule: every statistic used to clean (means, medians, modes, bounds, category maps) must be learned from the training split only, then applied to validation/test.

When to use

  • Raw data has nulls, duplicates, mixed types, or junk categories.
  • Before feature-engineering and modeling.
  • After EDA flagged specific quality issues.

Workflow

  1. Deduplicate — exact and key-based duplicates. Decide which to keep (latest timestamp, highest completeness).
  2. Fix types — parse dates, cast numerics stored as strings, normalize booleans.
  3. Standardize categoricals — trim whitespace, unify case, map synonyms ("US"/"USA"/"United States").
  4. Handle missing values — choose per-column strategy (see below).
  5. Treat outliers — cap/winsorize or flag; never blindly delete.
  6. Validate — assert schema, ranges, and row counts after each step.

Missing-value strategy

Situation Strategy
Numeric, MCAR, small % Median impute (robust to skew)
Numeric, informative missingness Impute + add was_missing indicator
Categorical Impute with "Missing" as its own category
Time series Forward/backward fill within group
>50% missing Consider dropping the column

Reference snippet (leakage-safe)

from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer

X_train, X_test, y_train, y_test = train_test_split(
    X, y, test_size=0.2, random_state=42, stratify=y
)

# Fit imputers on TRAIN ONLY
num_imputer = SimpleImputer(strategy="median").fit(X_train[num_cols])
X_train[num_cols] = num_imputer.transform(X_train[num_cols])
X_test[num_cols]  = num_imputer.transform(X_test[num_cols])  # reuse train stats

Prefer doing this inside a Pipeline/ColumnTransformer (see the sklearn-pipelines skill) so leakage is impossible by construction.

Read the full file on GitHub · 75 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 75 lines · 43 tokens per session scan A d658c800c8c3

Subscribe to this mod's changes

data-cleaning is a skill published in the GitHub repository param087/agent-ml-skills (9 stars, last pushed 3mo ago), licensed MIT. It adds 43 tokens to every session and 750 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

spark-training-gotchas

Preflight and diagnose the ten known failure modes for ML training on NVIDIA DGX Spark. Use when a training run on DGX Spark fails to start, OOMs below the 128GB limit, slows down mid-run, or before any multi-hour training job on GB10.

wshobson/agents · 63 tokens

9router-stt

Speech-to-text via 9Router /v1/audio/transcriptions using OpenAI Whisper / Groq / Gemini / Deepgram / AssemblyAI / NVIDIA / HuggingFace models. Use when the user wants to transcribe audio, convert speech to text, or get subtitles from audio files.

decolua/9router · 63 tokens

9router

Entry point for 9Router — local/remote AI gateway with OpenAI-compatible REST for chat, image, TTS, embeddings, web search, web fetch. Use when the user mentions 9Router, NINEROUTERURL, or wants AI without writing provider boilerplate. This skill covers setup + indexes capability skills; fetch the relevant capability…

decolua/9router · 84 tokens

9router-embeddings

Generate vector embeddings via 9Router /v1/embeddings using OpenAI / Gemini / Mistral / Voyage / Nvidia / GitHub embedding models for RAG, semantic search, similarity. Use when the user wants embeddings, vectors, RAG, semantic search, or to embed text.

decolua/9router · 66 tokens

ultralytics-platform

This skill should be used when user asks to "upload my model to Ultralytics Platform", "push this run to the platform", "upload a dataset to platform", "download a dataset from platform", "search platform datasets", "start cloud training", "train on platform GPUs", "export a model on platform", "deploy a model…

fcakyon/claude-codex-settings · 112 tokens

best-practices

Transforms vague prompts into optimized Claude Code prompts. Adds verification, specific context, constraints, and proper phasing. Invoke with /best-practices.

MoizIbnYousaf/Ai-Agent-Skills · 35 tokens