-
-
Clean sample: 0 problems, 0 warnings and 2 notes, with nothing flagged under label leakage.
-
The landing page's limits: leakage through two columns together is not found, and the probes are linear.
-
Leaky sample: "cancellation_date" alone reaches held-out accuracy 0.998 and a logistic probe out-of-fold AUC of 0.99.
-
The single-column scores for all 11 columns of the leaky sample: two flagged at AUC 0.99, the rest from 0.45 to 0.68.
-
The landing page: the headline, and the app checking the synthetic leaky sample live in the violet painted panel.
-
Shifted split sample: a classifier tells test rows from training rows (AUC 1.00), and "signup_date" alone is listed first.
The story
Say Nora downloads a customer churn file for a class project. Her first model scores 99% on its test set, then fails on new customers. The usual check is the test score and a glance at the rows, which look fine. But the score comes from the same file, so when the file gives the answer away, the score is fooled too. Datasheet Desk checks the file, not the model: small models trained on the file itself measure leakage and drift before you train. In the synthetic leaky sample, cancellation_date is filled in only after a customer leaves, and a logistic regression on it alone reaches an out-of-fold AUC of 0.99. In the shifted split sample, a classifier fully separates test rows from training rows and names signup_date first. The clean sample gets no problems and no warnings. The probes are linear, so a target that is 1 only inside a middle range slips past them, and leakage through two columns together is not found. Next time Nora's score looks too good, she will know which column to ask about.
Try it in two minutes
Open https://bananatruck.github.io/datasheet-desk/app/ (or press "Open the app" on https://bananatruck.github.io/datasheet-desk/) and press "Leaky sample". You should see 4 problems and 9 warnings, each with its method and measured value. Then press "Clean sample": 0 problems and 0 warnings. Then press "Shifted split sample": a file with its own split column whose test rows come from a later period with higher prices. It shows 1 warning: a classifier tells the test rows from the training rows with out-of-fold AUC 1.00, and the finding names the columns that drive it. Then press "Save datasheet (.md)". All three samples are synthetic, generated from fixed seeds by a script in the repository; no outside data is used. Your own CSV file works the same way, and it never leaves the browser tab.
The AI in this project
- Method: small logistic and linear regression models, trained in the browser on the file itself, as diagnostic probes. One-column logistic leakage probes predict the target from each column alone (one-vs-rest for 3 to 20 classes; for a numeric target, one-column linear regressions scored by out-of-fold R²); adversarial validation trains a classifier to tell the file's test rows from its training rows. Every score is out of fold: an AUC from seeded 5-fold stratified cross-validation, or for a numeric target an R² from 5 seeded folds, on at most 5,000 rows.
- Role: they measure the file, they do not predict anything for the user. A probe AUC near 1 for one column is a leakage signal; an adversarial AUC well above 0.5 says the test rows differ from the training rows, and the one-column AUCs name the columns that differ.
- Code: written from scratch in TypeScript (
src/analysis/model.ts,probes.ts,auc.ts,folds.ts), running in the page's web worker with no library. No language model is used, and nothing is uploaded. - Representative input and output, from the built-in samples: - Input
churn-leaky.csv(2,000 synthetic customers plus planted copies, targetchurned). Output finding:"cancellation_date" alone predicts the target suspiciously well, measuredheld-out accuracy 0.998 vs majority baseline 0.802 (normalised gain 0.988) on 415 held-out rows; logistic probe out-of-fold AUC 0.99. - Inputchurn-shifted.csv(its ownsplitcolumn; test rows from a later period with higher prices). Output finding:A classifier can tell the test rows from the training rows (AUC 1.00), measuredout-of-fold AUC 1.00 on 2000 rows (500 test, 1500 training), with the evidence"signup_date" alone: out-of-fold AUC 1.00,"monthly_spend" alone: out-of-fold AUC 0.72and"plan" alone: out-of-fold AUC 0.60.
Inspiration
Most disappointing models are not caused by the model. They are caused by the file: a column that is only filled in after the outcome, the same customer on both sides of the train and test split, a target that drifts over time while the split is random. A careful reviewer catches these before training, but most people training on a downloaded CSV do not have a careful reviewer.
What it does
Datasheet Desk is a browser-only tool for someone about to train a model on a CSV file. Drop the file in, pick the target column (it is guessed for you), and get three groups of checks:
- Label leakage: columns that predict the target suspiciously well on their own (held-out accuracy of a one-column lookup model against the majority baseline, and the out-of-fold score of a one-column probe, AUC of a logistic regression for a target with up to 20 classes or R² of a linear regression for a numeric one, both shown for every column), columns that restate the target, and identifier-like columns.
- Train and test contamination: exact duplicates, near duplicates, rows that repeat with a different label, and how many test rows have a copy in training, measured on a seeded split and as an expected count over all random splits. When the file has its own split column, adversarial validation: a logistic regression trained to tell test rows from training rows, with its cross-validated AUC and the columns that drive it.
- The basics: missing values per column, constant and near-constant columns, mixed types in one column, impossible values, class imbalance, rows with the wrong number of fields, and date columns where the target changes over time so a random split leaks the future.
Every finding states its method, its threshold and the measured value, with row numbers or example values as evidence. Nothing is described as certain when it is a heuristic. Then it writes a short datasheet for the file (what it contains, how it was checked, what was found, what was not checked) that you can save as Markdown.
How we built it
- TypeScript with no runtime dependencies (the only third-party files in the built site are three self-hosted fonts), built with Vite into a static site for GitHub Pages: a landing page whose hero runs the app live on the leaky sample, and the app at /app/.
- An incremental CSV parser feeds a web worker, so a 50 MB file is read without freezing the page. The repository's browser test generates a 50 MB file (870,168 rows) and fails if any gap between animation frames exceeds 250 ms; in its runs on a shared 2-core machine the longest gap was between 17 and 67 ms.
- The models are tested on synthetic data with a known answer: a planted leaking column is found, an unrelated column scores within 0.1 of AUC 0.5, a shifted test split is detected and a random one is not, and the AUC function matches hand-worked cases with ties.
- Each check is a small module with unit tests (Vitest). A seeded generator writes the three sample files, and the tests assert that the committed files match it, that every planted problem in the leaky file is found with the planted count, that the clean file has no problem and no warning, and that the shifted split sample gives exactly the adversarial validation warning.
- GitHub Actions runs lint, type-check, unit tests, build and the headless Chromium browser test on every push.
Challenges we ran into
- Quantile bins can straddle a gap in the values, which hid a planted leak in an early test: a column with values 0 to 6 for one class and 100 to 106 for the other scored only 0.89. Columns with 50 or fewer distinct values now keep each value as its own key.
- A target with thousands of distinct values (for example an ID chosen by mistake) would need huge count tables; the leakage check now counts sparsely and skips targets with more than 1,000 values, and says so.
- Keeping the page responsive meant streaming the file through a decoder into a parser that accepts chunks of any size, including a quote or a line ending split across two chunks.
Accomplishments that we're proud of
- Every finding carries its own method and number, so a reader can disagree with the threshold instead of trusting a verdict.
- The "not checked" list is part of every report.
- The tests prove the tool finds each planted problem with the exact planted count, and passes the clean file.
What we learned
Simple, stated methods go a long way: a one-column lookup model and a duplicate key catch most of the leakage that ruins beginner projects, and they are easy to explain on screen.
Limitations and how it was tested
- A known failure case: the probes are linear, so a numeric column whose target is 1 only inside a middle range scores near AUC 0.5 on the probe. Only the one-column lookup model's bins catch it; a unit test pins both halves of that behaviour.
- A genuinely strong feature is also flagged as single-feature leakage; the finding asks whether the column is known at prediction time.
- Leakage through two columns together, and leakage that needs domain knowledge, are not found.
- UTF-8 text files only; the whole file is held in the browser's memory. The models are fitted on at most 5,000 rows; the leakage probes need a target with at most 20 classes or a numeric one, and adversarial validation needs a file with its own split column.
- How the main feature was tested: 156 unit tests (Vitest) check the AUC against hand-worked cases with ties, the folds and the seeded sample, that a planted leaking column scores above 0.99 out of fold while a shuffled label stays within 0.08 of 0.5, that a shifted test split is detected and a random one is not, and that every planted problem in the samples is found with its exact count. A headless Chromium test of the production build (49 checks) checks the landing page's live hero and its pause control, presses all three sample buttons in the app, checks the findings on screen, saves the datasheet, and reads a generated 50 MB file without blocking the page for 250 ms or more.
How it was made
Built by AI coding agents directed by the author, Kesh, who chose the idea and the scope; all of it was written during the event window (first commit 2026-12-01), with no pre-existing code. Third-party components are development tools (Vite, Vitest, TypeScript, ESLint with typescript-eslint and globals, @types/node, Playwright for Python), all MIT or Apache-2.0, and three typefaces bundled into the site (Space Grotesk, DM Sans and JetBrains Mono, SIL Open Font License 1.1), all listed in the README; the built site ships no third-party runtime library. The demo video's narration voice is ElevenLabs text-to-speech, reading a script written for this project.
What's next
- A group split check when the file names a group column (for example a customer or patient ID).
- Two-column leakage scores for the strongest pairs.
- Excel and Parquet input.
Built With
- css3
- eslint
- github
- github-actions
- html5
- logistic-regression
- machine-learning
- playwright
- python
- typescript
- vite
- vitest
- web-workers