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
HomeDocsRule & Finding Models

Python SDK

Rule & Finding Models

SDK Reference: rule engine output objects

fs.analyze() runs the Profiling Engine and then the Rule Engine, returning a single frozen RuleResult. Rules are deterministic, isolated, and never fail the whole run: a rule that crashes is recorded in failed_rules instead.

RuleResult

python
1@dataclass(frozen=True, slots=True)
2class RuleResult:
3 profile: ProfileResult
4 findings: Sequence[RuleFinding]
5 executed_rules: Sequence[str]
6 execution_time_ms: float
7 failed_rules: Mapping[str, str] # rule ID -> error traceback
8
9 def to_dict(self) -> dict[str, Any]: ...

RuleFinding

A single issue identified by one rule. column_name is None for dataset-wide findings (for example duplicate rows).

python
1@dataclass(frozen=True, slots=True)
2class RuleFinding:
3 rule_id: str
4 rule_name: str
5 category: str # "quality" | "statistical" | "leakage" | "diff"
6 severity: str # "info" | "warning" | "critical"
7 column_name: str | None
8 title: str
9 description: str
10 evidence: Mapping[str, Any]
11 confidence: float = 1.0
12 id: str = ... # auto-generated UUID
13 metadata: Mapping[str, Any] = ...

category uses lowercase strings. The "diff" category is used by findings derived from a DatasetDiffResult via findings_from_diff().

Built-in Rules

All eight rules are enabled by default. Their defaults can be overridden per rule through the rule_config argument of fs.analyze():

Rule IDNameSeverityConfig Keys (defaults)
quality.missing_value_thresholdMissing Value Thresholdwarning (escalates to critical above 50%)threshold=20.0
quality.duplicate_rowsDuplicate Rowswarningthreshold=10.0
quality.constant_columnsConstant Columnswarning—
quality.fully_empty_columnsFully Empty Columnscritical—
statistical.high_cardinalityHigh Cardinalitywarningthreshold=0.50, min_cardinality=20
statistical.outliersOutlier Detectionwarningfactor=1.5 (IQR multiplier)
statistical.high_correlationHigh Correlationwarningthreshold=0.90
leakage.potential_leakagePotential Target Leakagecriticaltarget_column=None, threshold=0.99

The missing-value rule flags every column whose missing_percentage exceeds threshold. The high-cardinality rule flags categorical columns whose unique-ratio cardinality / non-missing exceeds threshold while cardinality is at least min_cardinality. The outlier rule flags numeric columns with values beyond [Q1 - factor*IQR, Q3 + factor*IQR].

Configuring Rules

python
1import featuresmith as fs
2
3result = fs.analyze(
4 "train.csv",
5 target_column="churn",
6 enabled_rules=[
7 "quality.missing_value_threshold",
8 "statistical.high_correlation",
9 ],
10 rule_config={
11 "quality.missing_value_threshold": {"threshold": 15.0},
12 "statistical.high_correlation": {"threshold": 0.85},
13 },
14)
15
16for finding in result.findings:
17 print(f"[{finding.severity}] {finding.title}")

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.