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

Examples & Tutorials

Production-grade implementations demonstrating Featuresmith SDK pipelines, interactive Jupyter tutorials, automated CI/CD quality gates, and custom rule design.

Official Jupyter Tutorial Notebooks

Follow our step-by-step interactive learning path located in examples/notebooks/. Every notebook includes real code, problem statements, output interpretations, and best practices.

Getting Started & Dataset Profiling

01. Getting Started with Featuresmith

Learn how to load datasets (fs.load), run deterministic profiling (fs.profile), conduct automated reviews (fs.review), and extract ML readiness scores (fs.score).

01_getting_started.ipynb
View Source
Dataset Review Engine & 10 Reviewers

02. Complete Dataset Review Walkthrough

Explore the 10 automated reviewers evaluating schema health, data types, missingness spikes, duplicate records, constant columns, high cardinality, distributions, feature quality, leakage risk, and snapshot deltas.

02_dataset_review.ipynb
View Source
ML Readiness Score & Health Dimensions

03. Understanding the ML Readiness Score

Deep dive into the 0–100 quality scorecard, mathematical dimension weights, category breakdowns, and actionable remediation suggestions.

03_ml_readiness_score.ipynb
View Source
Intelligent Leakage Detection

04. Detecting Data Leakage before Training

Master target correlation detectors, timestamp anomalies, identifier shapes, post-outcome names, and duplicate target copies using 6 specialized pattern detectors.

04_leakage_detection.ipynb
View Source
Dataset Diff Engine (fs.diff)

05. Comparing Dataset Versions with Dataset Diff

Compare dataset snapshot versions (v1 vs v2) to detect schema drift, missingness spikes, distribution shifts, and receive an overall health verdict.

05_dataset_diff.ipynb
View Source
End-to-End Validation Pipeline Gate

06. End-to-End ML Dataset Validation Workflow

Build an automated Python pre-training quality gate function that validates datasets, enforces score thresholds, and halts pipelines on critical findings.

06_end_to_end_workflow.ipynb
View Source
Extending BaseRule & Custom Rules

07. Custom Rules & Advanced Extensions

Extend BaseRule to write domain-specific quality checks, register custom rules in RuleRegistry, and evaluate them against ProfileResult.

07_custom_rules_and_extensions.ipynb
View Source

Python SDK Pipeline

This pipeline script demonstrates loading data, executing automated dataset code reviews, extracting scorecards, and running snapshot comparisons via fs.diff().

pipeline.py
python
1import featuresmith as fs
2
3def run_featuresmith_pipeline(data_path: str, target: str):
4 # 1. Load data into normalized Dataset wrapper
5 print(f"Loading dataset from {data_path}...")
6 dataset = fs.load(data_path)
7 print(f"Loaded {dataset.row_count} rows across {dataset.column_count} columns.")
8
9 # 2. Perform automated dataset code review with 10 reviewers
10 print("Running automated dataset review...")
11 review_result = fs.review(dataset, target_column=target)
12
13 # 3. Extract explainable 0–100 ML Readiness Scorecard
14 scorecard = fs.score(review_result)
15 if scorecard:
16 print(f"ML Readiness Score: {scorecard.overall:.1f} / 100")
17 print("Dimension Breakdown:")
18 for dim in scorecard.dimensions:
19 print(f" - {dim.label:<20}: {dim.score:5.1f}/100 ({len(dim.contributing_findings)} findings)")
20
21 # 4. Compare with baseline dataset snapshot (Dataset Diff)
22 diff_res = fs.diff(data_path, "baseline.csv", target_column=target)
23 print(f"Dataset Health Verdict: {diff_res.summary.overall_health.upper()}")
24
25if __name__ == "__main__":
26 run_featuresmith_pipeline("customer_churn.csv", target="churn_label")

CI/CD Quality Gate

Integrate the Featuresmith CLI into your GitHub Actions workflow. Deterministic exit code gating ensures broken or leaked datasets never reach training.

data-quality-gate.yml
yaml
1# .github/workflows/data-quality-gate.yml
2name: Data Quality Gate
3
4on:
5 push:
6 branches: [ main ]
7 schedule:
8 - cron: '0 0 * * *' # Daily pipeline audits
9
10jobs:
11 audit:
12 runs-on: ubuntu-latest
13 steps:
14 - name: Checkout code
15 uses: actions/checkout@v4
16
17 - name: Set up Python
18 uses: actions/setup-python@v5
19 with:
20 python-version: '3.11'
21
22 - name: Install dependencies
23 run: |
24 pip install featuresmith-cli
25
26 - name: Audit dataset quality & leakage
27 run: |
28 # Gate CI build on review findings
29 featuresmith review data/train.csv --target churn_label --format json --output report.json
30
31 - name: Upload audit report
32 if: always()
33 uses: actions/upload-artifact@v4
34 with:
35 name: data-audit-report
36 path: report.json

Designing Custom Rules

Extend the BaseRule abstraction to create custom deterministic check rules. This example detects numeric columns with zero standard deviation.

zero_variance.py
python
1from featuresmith.core.profile_result import ProfileResult
2from featuresmith.rules.base import BaseRule
3from featuresmith.core.rule_finding import RuleFinding
4
5class ZeroVarianceRule(BaseRule):
6 """Detect numeric columns with zero standard deviation."""
7
8 @property
9 def id(self) -> str:
10 return "statistical.zero_variance"
11
12 @property
13 def name(self) -> str:
14 return "Zero Variance Columns"
15
16 @property
17 def description(self) -> str:
18 return "Flags numeric columns with no observed variance."
19
20 @property
21 def category(self) -> str:
22 return "statistical"
23
24 @property
25 def severity(self) -> str:
26 return "warning"
27
28 @property
29 def enabled_by_default(self) -> bool:
30 return True
31
32 def evaluate(self, profile: ProfileResult) -> list[RuleFinding]:
33 findings: list[RuleFinding] = []
34 for col_name, numeric_profile in profile.numeric_profiles.items():
35 if numeric_profile.std_dev == 0.0:
36 findings.append(
37 RuleFinding(
38 rule_id=self.id,
39 rule_name=self.name,
40 category=self.category,
41 severity=self.severity,
42 column_name=col_name,
43 title="Zero Variance Detected",
44 description=f"Column '{col_name}' has standard deviation of 0.0.",
45 evidence={"std_dev": numeric_profile.std_dev}
46 )
47 )
48 return findings

Included Real-World Example Datasets

The Titanic dataset is bundled in the repository (no setup needed). The other datasets are generated or downloaded with the example preparation scripts in the project root:

python examples/download_datasets.py # optional: network fetch for raw datasets python examples/prepare_datasets.py

Iris Classification

Source: scikit-learn (load_iris)

Canonical clean benchmark dataset containing 0 missing values and clean feature ranges. Serves as a 100/100 baseline.

Rows: 150
Cols: 5
Target: species
Score: 100.0/100 (PASSED)

Titanic Classification

Source: OpenML (titanic)

Historical survival dataset containing cabin null spikes, free text columns, and age missingness. Triggers missing value and data type findings.

Rows: 891
Cols: 12
Target: survived
Score: 86.9/100 (WARNINGS)

California Housing

Source: scikit-learn (fetch_california_housing)

Continuous spatial housing metrics for regression. Triggers distribution skewness and kurtosis structural findings.

Rows: 20,640
Cols: 9
Target: median_house_value
Score: 90.0/100 (WARNINGS)

Customer Churn & Leakage

Source: Telco Churn Dataset

Telecom subscriber records containing synthetic target leakage columns. Triggers 4 intelligent leakage pattern detectors.

Rows: 7,043
Cols: 24
Target: churn_label
Score: 94.4/100 (CRITICAL LEAKAGE)

Retail Sales Snapshot

Source: Superstore Transactions

Transactional sales dataset used to demonstrate Dataset Diff (fs.diff) snapshot version comparisons (v1 vs v2).

Rows: 1,000
Cols: 10
Score: Verdict: REGRESSED

Ready to inspect performance?

Review Featuresmith's loading, profiling, review, and score benchmarks.

View Benchmarks
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.