Exploratory data analysis
Use when first encountering a dataset or before any feature/model work, to systematically understand distributions, missingness, cardinality, and target relationshipsFrom its SKILL.md
npx -y skills add creyesp/datapowers --skill exploratory-data-analysisAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.7 KB, as published. Nobody here has run it
Exploratory Data Analysis
Overview
EDA is not "looking at the data". EDA is a structured pass that yields a committed data-quality report and an updated risk list for the spec.
Core principle: EDA outputs a document. If nothing was committed, EDA didn't happen.
When to Use
- First contact with a dataset for a given problem.
- Before declaring features.
- Before choosing a model class.
- After a major data refresh.
The Four Phases — Complete in Order
Phase 1: Univariate
For each column:
- dtype, null fraction, unique count.
- Histogram (numeric) or top-K + tail (categorical).
- Min, max, mean, median, std, p1, p99.
- Detect outliers with a rule, not vibes (IQR, z-score, domain rule).
Phase 2: Bivariate
- Pairwise correlations among numeric features (Spearman + Pearson).
- Mutual information for categorical-target pairs.
- Co-missingness pattern (which columns go null together).
Phase 3: Target-Conditional
- Distribution of each feature conditional on the target.
- Class balance + drift over time of class balance.
- Leakage screen: any feature suspiciously predictive on its own → flag.
Phase 4: Temporal
- Row counts over time (gaps, spikes, weekends).
- Mean / median of key features over time.
- Target rate over time (concept drift?).
- Feature freshness vs. label freshness (alignment).
Deliverable
Commit docs/datapowers/specs/<spec>-eda-report.md with:
- One section per phase.
- Plot artifacts in a sibling folder, referenced by relative path.
- An Updated Risks section feeding back into the spec's §8.
- A Decisions section: e.g., "drop column X (98% null)", "winsorize Y at p99", "use stratified split on Z".
Quick-Win Recipes
# Profile
import ydata_profiling
ydata_profiling.ProfileReport(df, minimal=True).to_file("eda/profile.html")
# Target-conditional histograms
import seaborn as sns
for col in numeric_cols:
sns.kdeplot(data=df, x=col, hue=target, common_norm=False)
# Leakage screen: single-feature AUC
from sklearn.metrics import roc_auc_score
for col in candidate_features:
auc = roc_auc_score(y, df[col].fillna(df[col].median()))
if auc > 0.85 or auc < 0.15:
print(f"LEAKAGE SUSPECT: {col} auc={auc:.3f}")
Anti-Patterns
| Anti-pattern | Why it bites |
|---|---|
| EDA in a notebook never committed | Findings die with the kernel |
| Skipping temporal pass | Concept drift only shows over time |
df.describe() and done | Means + std hide bimodality and outliers |
| Plotting without a hypothesis | Endless plot scrolls produce no decisions |
| Ignoring co-missingness | Imputation strategy depends on it |
Red Flags
- A feature has AUC > 0.9 alone → likely leakage.
- Target rate changes 5x across the date range → concept drift, splits must respect it.
- A column is 100% present in train and 90% null in test → upstream change.
- A categorical has cardinality near row count → likely an ID, will memorize.
Verification Checklist
- All four phases completed.
- EDA report committed.
- Updated risks fed back into experiment spec §8.
- Decisions list created (drops, transforms, split choice).
- Leakage screen run on every candidate feature.
Cross-References
- PREV:
datapowers:reproducible-data-versioning - REQUIRED FOR INVESTIGATIONS:
datapowers:hypothesis-driven-analysis - FEEDS INTO:
datapowers:feature-engineering-systematically,datapowers:validation-strategy-design,datapowers:preventing-data-leakage