Page type: Article / Wiki · Category: Computer science / Artificial intelligence
Data Leakage
Data leakage is the accidental presence of information in training that would not be available at prediction time, including the label itself hidden in a feature.
Overview
Data leakage is the accidental presence of information in training that would not be available at prediction time, including the label itself hidden in a feature.
Metrics look excellent. Deployment fails. Leakage is a methodology bug, not a flex.
Definition
Forms include shuffling before splitting time series, scaling with the test set included, and IDs or future values encoded as features.
Duplicate rows across train and test, or patients appearing in both splits, are leakage too.
This wiki page is a checklist in spirit, not a scandal blog.
Why the distinction matters
A stunning number that cannot be reproduced on truly new data is often leakage or an overused test set.
Target leakage is especially quiet: a column that is a consequence of the label, not a cause available up front.
Core pieces
- A prediction-time story: what will we know then?
- A split that respects that story.
- A feature list audited against that story.
- A pipeline that fits scalers only on training folds.
If a tutorial skips these pieces and jumps to a demo, you are watching a product, not reading a definition.
Worked intuition
Predicting “will this patient be admitted” using a feature that is the admission ward code. The ward is the future. The metric is a lie.
That cartoon has cousins in every domain: invoice paid flags, post-event comments, filename prefixes that encode the class.
Common confusions
- Random splits on temporal data.
- Tuning until the test number is pretty.
- Leaving IDs in the file because “the model will ignore them.” It might not.
- Preprocessing the whole matrix, then splitting.
Limits
Leakage can be subtle in text and images (a timestamp in a corner, a document ID in a header).
Removing leakage can make the number drop. That drop is honesty, not failure.
Practical checks
- Write the serving schema first.
- Split the way production splits (time, site, person).
- Fit preprocessing inside the training fold.
- Inspect the most important features for “future smell.”
What a careful page refuses
It refuses fake precision, fake timelines, and vendor adjectives that are not part of the definition.
Removing leakage can make the number drop. That drop is honesty, not failure.
Related pages
See also: training and inference, evaluation metrics, feature representation.
Glossary
- Target leakage: features that smuggle the label.
- Train–test contamination: examples or statistics shared across the split.
- Pipeline leak: preprocessing that saw the test data.
How to use this wiki page
Read the definition, then the confusions, then the checks. The FAQ is last on purpose: it should not replace the definition.
If you cite this page, cite the limitation that matches your use, not only the first sentence.
FAQ
Is a high score always leakage?
No. But it is a reason to hunt.
Can cross-validation leak?
Yes, if preprocessing sits outside the folds.
Does shuffling text files leak?
If the same document is in both sides, yes.
Why this page exists in the collection
Data Leakage sits in a Article / Wiki slot with category Computer science / Artificial intelligence. That pairing is not decoration: readers should be able to tell a research note from a listing, and a home page from a wiki overview, before they quote a sentence out of context.
The one-line job of the page is this: Wiki article on data leakage: test information entering training, including target leakage in features.
If you only remember one constraint, remember the lead: Page type: Article / Wiki · Category: Computer science / Artificial intelligence
The page is written for computer science readers who will either teach from it, cite it, or use it as a map. It is not written as a press release and it does not invent measurements that were not collected.
Scope and non-scope, stated slowly
In scope: the practice and documents around Computer science, Artificial intelligence, data leakage, evaluation. Out of scope: ranking offices, promising outcomes, or turning a classroom into a market.
A useful test is whether a sentence still holds if you remove adjectives. “A prediction-time story: what will we know then?” is the kind of object this page is willing to talk about because it can be pointed at.
Another object on the table is “A split that respects that story.”. If your question is actually about something else—private casework, live filings, clinical advice, or product pricing—stop and go to a qualified channel.
Non-scope also includes gossip about named minors, unnamed “secret” datasets, and any request to hide a limitation because it makes the story less tidy.
Walking through the checklist in full sentences
Item 1. A prediction-time story: what will we know then? Treat this as something you could put on a table in a meeting about Data Leakage. If you cannot point to an artifact, a date, or a named owner for it, it is not yet evidence; it is a wish. Write the missing piece before you scale the idea across a year of computer science work.
Item 2. A split that respects that story. Treat this as something you could put on a table in a meeting about Data Leakage. If you cannot point to an artifact, a date, or a named owner for it, it is not yet evidence; it is a wish. Write the missing piece before you scale the idea across a year of computer science work.
Item 3. A feature list audited against that story. Treat this as something you could put on a table in a meeting about Data Leakage. If you cannot point to an artifact, a date, or a named owner for it, it is not yet evidence; it is a wish. Write the missing piece before you scale the idea across a year of computer science work.
Item 4. A pipeline that fits scalers only on training folds. Treat this as something you could put on a table in a meeting about Data Leakage. If you cannot point to an artifact, a date, or a named owner for it, it is not yet evidence; it is a wish. Write the missing piece before you scale the idea across a year of computer science work.
Item 5. Random splits on temporal data. Treat this as something you could put on a table in a meeting about Data Leakage. If you cannot point to an artifact, a date, or a named owner for it, it is not yet evidence; it is a wish. Write the missing piece before you scale the idea across a year of computer science work.
Item 6. Tuning until the test number is pretty. Treat this as something you could put on a table in a meeting about Data Leakage. If you cannot point to an artifact, a date, or a named owner for it, it is not yet evidence; it is a wish. Write the missing piece before you scale the idea across a year of computer science work.
Item 7. Leaving IDs in the file because “the model will ignore them.” It might not. Treat this as something you could put on a table in a meeting about Data Leakage. If you cannot point to an artifact, a date, or a named owner for it, it is not yet evidence; it is a wish. Write the missing piece before you scale the idea across a year of computer science work.
Item 8. Preprocessing the whole matrix, then splitting. Treat this as something you could put on a table in a meeting about Data Leakage. If you cannot point to an artifact, a date, or a named owner for it, it is not yet evidence; it is a wish. Write the missing piece before you scale the idea across a year of computer science work.
A longer narrative of the problem
People usually meet Data Leakage as a short slogan. The slogan travels faster than the log. Then a team is surprised when a term ends and the only remaining trace is a folder of unused files.
The longer story is operational. Someone has to name the text, the hour, the owner, and the thing students or readers will produce. Without that, Computer science, Artificial intelligence, data leakage, evaluation becomes wallpaper.
Consider a week in which A prediction-time story: what will we know then? is supposed to happen, but A split that respects that story. is competing for the same hour. The honest publication names the collision instead of adding a new poster.
Consider also the quiet failure: the work is done, but nobody can find it next month because the filename is “final-final-v3”. Documentation is part of the method, not an afterthought for Data Leakage.
None of this requires a new brand of software. It requires a calendar, a named artifact, and a sentence about what will not be claimed. That is the tone of this page.
Worked scenario A: a careful trial
A small team decides to trial one idea from Data Leakage for four weeks, not a year. They write the question in one sentence copied from the lead: Page type: Article / Wiki · Category: Computer science / Artificial intelligence
Week 1 is setup: they identify the artifact that will count as “done.” It should be as concrete as A prediction-time story: what will we know then?. They also write the exclusion: they will not claim effects they did not measure.
Week 2 is the first real run. They expect friction around A split that respects that story.. They log what was skipped and why, in language a substitute colleague could understand.
Week 3 is a repair week. They drop one extra ambition so A feature list audited against that story. can actually finish. Repair is not failure; it is the method.
Week 4 is a write-up of two pages: what happened, what they will keep, what they will not repeat. They cite this page as a map, not as proof.
Worked scenario B: the over-scoped version that fails
A different team announces Data Leakage as a whole-institution priority in the same week they have reports, a public event, and a system migration. Nothing is named as the single artifact.
They create a dashboard. The dashboard cannot answer whether A prediction-time story: what will we know then? occurred. It can only show that a file was uploaded.
By week six the original lead—Page type: Article / Wiki · Category: Computer science / Artificial intelligence—is no longer mentioned in meetings. People mention “the initiative.” Initiatives do not leave notebooks.
The recovery is embarrassing and simple: shrink back to one unit, one owner, one collected task, and the limits already written on this page.
A twelve-week implementation sketch
- Week 1: Name the question Data Leakage is actually asking.
- Week 2: Inventory current documents related to Computer science, Artificial intelligence, data leakage, evaluation.
- Week 3: Pick one artifact as concrete as: A prediction-time story: what will we know then?.
- Week 4: Write the non-claims in language copied from this page’s limits.
- Week 5: Run a tiny version that still includes A split that respects that story..
- Week 6: Log skips; do not hide them in a highlight reel.
- Week 7: Repair the calendar so A feature list audited against that story. can finish.
- Week 8: Share a two-page note with a colleague who was not in the room.
- Week 9: Decide whether to stop, continue, or redesign.
- Week 10: If continuing, freeze the definition of “done” for the next month.
- Week 11: Check that citations still point at dated sources, not at rumours.
- Week 12: Retire leftover files that contradict the lead: Page type: Article / Wiki · Category: Computer science / Artificial intelligence
This calendar is a sketch for Data Leakage, not a contract. If a public deadline in computer science collides with a week, move the week—do not pretend both happened.
If you skip logging, you are back to slogans. The sketch exists to make skipping visible.
Documentation pack
- A one-sentence question taken from Data Leakage.
- The dated lead as published: Page type: Article / Wiki · Category: Computer science / Artificial intelligence
- A list of in-scope objects, starting with A prediction-time story: what will we know then?.
- A list of out-of-scope requests (advice, rankings, invented rates).
- Names of owners for A split that respects that story. and a substitute if they are away.
- A filename convention that includes a date.
- A citation line that includes limits.
- Links to sibling pages in Computer science.
- A retirement note for superseded files.
- A short glossary so newcomers do not invent synonyms.
If the pack cannot fit in a folder a new colleague can open in five minutes, it is too baroque for Data Leakage.
Pretty templates are optional. Dates and owners are not.
Error catalog
- Asking the page to do casework, medical advice, or live filings.
- Citing an unofficial look-alike domain as the primary source.
- Publishing identifiable information that the method said to remove.
- Quoting Data Leakage as if it measured an outcome it explicitly refused to measure.
- Scaling across all of computer science before a four-week trial exists.
- Treating A prediction-time story: what will we know then? as optional theatre while keeping the slogan.
- Letting an undated PDF outrank the dated page.
- Hiding the collision between A split that respects that story. and a hard calendar event.
- Mixing page type Article / Wiki with a different genre in the same citation.
- Inventing a percentage because a meeting wanted a percentage.
Each error is recoverable if you name it early. It is expensive if it becomes the public story of the work.
The cheapest prevention for Data Leakage is to reread the non-claims before you present.
Glossary for this page
- Data Leakage — the document you are reading, with page type Article / Wiki and category Computer science / Artificial intelligence.
- Artifact — a thing you could hold up, such as: A prediction-time story: what will we know then?
- Lead — the opening claim: Page type: Article / Wiki · Category: Computer science / Artificial intelligence
- Limit — a sentence that forbids a nicer claim than the method can carry.
- Computer science — the home section of this page, not a licence to speak for every office in the world.
- Date — the difference between a publication and a rumour.
- Owner — the person who can change A split that respects that story. without a mystery committee.
- Sibling page — another title in the same section, listed below when available.
Reader checklist before you cite or adopt
- Can you state the job of Data Leakage without adjectives?
- Can you point at A prediction-time story: what will we know then? in a real folder or classroom?
- Is every number (if any) sourced, or did you add none because none were collected?
- Does the citation include the limit that belongs with Computer science, Artificial intelligence, data leakage, evaluation?
- Would a substitute colleague know what “done” looks like next week?
- Have you avoided promising a ranking, a cure, or a guaranteed placement?
- Is the page type still honestly Article / Wiki?
- Is the category still honestly Computer science / Artificial intelligence?
If you fail two checks, do not cite yet. Fix the file or shrink the claim.
This checklist is part of Data Leakage, not a generic poster.
What “good enough” looks like without fake scores
Good enough for Data Leakage is a dated artifact, a named owner, and a next step that survived contact with a calendar.
It is not a launch photograph. It is not a dashboard that cannot answer whether A prediction-time story: what will we know then? happened.
It is certainly not a claim that Computer science, Artificial intelligence, data leakage, evaluation has been “solved.” Solved is a word this collection tries not to use.
If you need a number, collect one that matches the question, then publish the instrument. Until then, write in sentences.
Teaching notes
If you teach Data Leakage, give students a primary object first: a form, a lab page, a syllabus line, a model card, a gazette. Then give them this page as a map of how to talk about that object.
A good thirty-minute seminar: (1) read the lead, (2) mark the non-claims, (3) try to apply A prediction-time story: what will we know then? to a public document you did not write.
Do not ask students to harvest private data. Do not ask them to impersonate an office. Do not ask them to produce a rate you would not defend.
Assessment can be a two-page memo that cites this page and one official source, with the date of capture written on the first line. That is enough to see whether computer science literacy is happening.
For information officers and editors
If you maintain public pages in computer science, steal the habits, not the adjectives: date, owner, next step, non-claim.
Data Leakage will age. Put a review month on it. If you cannot review it, do not let it remain the featured link.
When legal, medical, or emergency readers arrive, your first job is to send them to a qualified channel. Education pages that pretend to be those channels cause harm.
When you quote Data Leakage in a newsletter, quote a limit next to the attractive sentence. Attractive sentences travel; limits do not, unless you chain them.
Notes on wiki genre
A wiki overview defines, distinguishes, and lists failure modes. It does not sell a library or a timeline to imaginary general intelligence.
Data Leakage should be cited for the distinction it draws, not as proof that a product works.
If a tutorial skips evaluation and jumps to a demo, it is not this page.
Update the glossary if a word starts meaning three things in your course. Do not pretend the field is settled.
Related pages in this collection
- Overfitting and Regularization — Wiki article on overfitting: fitting the training sample too closely, and regularization as a family of restraints.
- Natural Language Processing (Introduction) — Wiki introduction to NLP as computational work on text and speech, with tasks and limits.
- Evaluation Metrics in Machine Learning — Wiki overview of evaluation metrics: accuracy is not always the right score, and the split matters.
- Computer Vision (Introduction) — Wiki introduction to computer vision: making predictions from images or video, with task names and failure modes.
- Unsupervised Learning — Wiki article on unsupervised learning: finding structure in data without task labels.
These titles share the Computer science section with Data Leakage. They are not duplicates. Read the page type before you mix citations.
If a sibling contradicts this page, prefer the dated limits on each page rather than blending them into a mash-up claim.
Plain-language recap
Data Leakage is a Article / Wiki page in Computer science / Artificial intelligence. Its job is: Wiki article on data leakage: test information entering training, including target leakage in features.
Do the concrete thing (A prediction-time story: what will we know then?). Write down what you will not claim. Date the file. Name an owner for A split that respects that story..
Do not invent rates. Do not use this page as a clinic, a court, or a marketplace. Do not strip the limits off the attractive sentences.
If you do only that, the collection has done enough work for one reading.
Versioning and review
When you locally adapt Data Leakage, keep a version line: date, editor, what changed, what did not.
A change to the lead is a new document. A change to an example can be a minor note.
Review at least when the surrounding computer science calendar jumps (new term, new statute text, new dataset version).
If nobody is named to review it, the page is already on its way to becoming folklore.