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
HomeDocsLeakage Models

Python SDK

Leakage Models

SDK Reference: leakage detection objects

Target leakage occurs when a feature carries information from the future or from the target itself, giving a model an unfair advantage at training time. The review.leakage reviewer runs named pattern detectors against the frozen profile; each detector emits LeakageFinding objects.

LeakageFinding

python
1@dataclass(frozen=True, slots=True)
2class LeakageFinding:
3 pattern: str # detector ID that produced this finding
4 column_name: str
5 title: str
6 rationale: str
7 evidence: Mapping[str, Any]
8 confidence: float # 0.0 to 1.0
9 severity: str # "info" | "warning" | "critical"
10 suggested_action: str

The Six Built-in Detectors

Pattern IDDetectorWhat It Flags
target_correlationTarget CorrelationColumns with extreme correlation to the declared target.
identifierIdentifier ShapeID-like columns that also correlate with the target.
timestampTimestamp LeakageDatetime columns that extend past a declared prediction cutoff.
future_infoFuture InformationColumns named like the outcome, or datetime columns extending past a declared event timestamp.
duplicate_targetDuplicate Target InformationColumns that are a near-deterministic copy or transform of the target.
suspicious_correlationSuspicious CorrelationSuspicious correlations with a secondary signal, never magnitude alone.

Detectors run through builtin_detectors() and are supplied to the review.leakage reviewer. Detector findings carry a confidence label: High at or above 0.7, Medium at or above 0.4, and Low below that.

From Detectors to Review Findings

The leakage reviewer merges detector findings into the shared RuleFinding schema so every section speaks the same language:

  • One pattern on a column becomes a finding with rule_id = "leakage.<pattern>".
  • Several patterns on the same column are merged into a single finding with rule_id = "leakage.multiple_patterns", keeping the worst severity and the highest confidence.
  • The original pattern, confidence level, rationale, and suggested action are preserved in the finding's evidence and metadata.

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.