Featuresmith Icon
Featuresmith
  • Docs
  • SDK
  • CLI
  • Examples
  • Roadmap
v0.4.0
Documentation

Getting Started

  • Introduction
  • Installation
  • Quick Start
  • Tutorial Notebooks
  • Benchmarks
  • Development Setup
  • Contributing

Core Concepts

  • Architecture Overview
  • Dataset Layer
  • Connectors
  • Profiling Engine
  • Rule Engine
  • Dataset Review Engine
  • ML Readiness Score
  • Target Leakage Detection
  • Dataset Diff Engine
  • Target Column Concept
  • Mental Model & Workflow
  • Interpreting Findings
  • Workflow Cheat Sheet
  • Beginner Glossary

Python SDK

  • load()
  • profile()
  • analyze()
  • review()
  • diff()
  • score()
  • plan()
  • Dataset
  • Data Models
  • Profile Models
  • Rule & Finding Models
  • Review Models
  • Score Models
  • Leakage Models
  • Diff Models
  • Exceptions
  • Plugins

CLI Reference

  • analyze
  • review
  • diff
  • score
  • plan
  • Configuration

Guides

  • CI/CD Integration
  • Custom Rules
  • Writing Plugins

Resources

  • Release Notes
  • FAQ
  • Troubleshooting
DocsGuide

Getting Started

  • Introduction
  • Installation
  • Quick Start
  • Tutorial Notebooks
  • Benchmarks
  • Development Setup
  • Contributing

Core Concepts

  • Architecture Overview
  • Dataset Layer
  • Connectors
  • Profiling Engine
  • Rule Engine
  • Dataset Review Engine
  • ML Readiness Score
  • Target Leakage Detection
  • Dataset Diff Engine
  • Target Column Concept
  • Mental Model & Workflow
  • Interpreting Findings
  • Workflow Cheat Sheet
  • Beginner Glossary

Python SDK

  • load()
  • profile()
  • analyze()
  • review()
  • diff()
  • score()
  • plan()
  • Dataset
  • Data Models
  • Profile Models
  • Rule & Finding Models
  • Review Models
  • Score Models
  • Leakage Models
  • Diff Models
  • Exceptions
  • Plugins

CLI Reference

  • analyze
  • review
  • diff
  • score
  • plan
  • Configuration

Guides

  • CI/CD Integration
  • Custom Rules
  • Writing Plugins

Resources

  • Release Notes
  • FAQ
  • Troubleshooting
HomeDocsTarget Leakage Detection

Core Concepts

Target Leakage Detection

Catch target correlations, timestamp anomalies, and outcome clones

Target leakage is one of the most dangerous bugs in applied machine learning. It occurs when features contain information from the target variable or future state that would not be available at inference time.

Why Target Leakage is Dangerous

Models trained on leaked features achieve deceptively high validation metrics (e.g. 99.9% ROC-AUC or near-zero loss) during development. However, when deployed to production where future outcome labels do not exist, the model fails completely.

Real-World Example

Suppose you are building a customer churn prediction model with target churn_label (1 = churned, 0 = active):

  • Leaked Feature: Including account_cancellation_date or refund_processed_amount.
  • The Bug: An account cancellation date is only recorded after a customer churns. In production at prediction time, cancellation dates are blank for active customers, causing the model to break.

The 6 Implemented Pattern Detectors

  • 1. Target Correlation Detector: Flags features with Pearson correlation ≥ 0.99 with the target.
  • 2. Identifier Shape Detector: Flags near-unique numeric ID columns correlated with the target outcome.
  • 3. Timestamp Detector: Flags timestamp columns encoding post-outcome temporal data.
  • 4. Future Information Detector: Flags columns named like outcome labels (e.g. refund_status).
  • 5. Duplicate Target Detector: Detects near-identical transformed copies or encodings of the target.
  • 6. Suspicious Correlation Detector: Flags unexpected strong feature correlations (≥ 0.95).

Explore

  • Quick Start
  • Python SDK
  • CLI Reference
  • Examples
Featuresmith Icon
Featuresmith

Open-source data profiling and validation for Python engineers.

Documentation

  • Introduction
  • Quick Start
  • Python SDK
  • CLI Reference

Community

  • GitHub
  • Discussions
  • Issues
  • Contributing

Project

  • Roadmap
  • Release status
  • Benchmarks
  • Changelog
  • Examples

Legal

  • Apache 2.0 License
  • Code of Conduct
  • Security

© 2026 Featuresmith Contributors. Released under the Apache 2.0 License.

Built by Aditya Gangwani in the open.