Python SDK
fs.review()
SDK Reference: run a complete engineering review
def review( source: object, *, previous: object | None = None, target_column: str | None = None, enabled_reviewers: Sequence[str] | None = None, enabled_categories: Sequence[ReviewCategory] | None = None, reviewer_config: Mapping[str, Mapping[str, Any]] | None = None, max_correlation_columns: int = 100, max_frequency_table_size: int = 1000,) -> ReviewResult:Overview
Performs a comprehensive engineering review of a dataset. It orchestrates a multi-stage pipeline: resolving inputs, constructing context, executing registered built-in reviewers in isolation, generating ranked recommendations via the centralized Recommendation Engine, and computing the deterministic ML Readiness Score. The review reuses computed rule findings and profiles under the hood so no raw data is re-read or re-profiled during reviewer dispatch.
When to Use It
Use in Python scripts, data ingestion pipelines, or notebooks to evaluate a dataset's readiness for ML modeling in a single call. It consolidates schema checks, data quality audits, and target leakage diagnostics into a single structured result.
Parameters
- source:
Dataset|str|DataFrame. The input dataset path (CSV, Parquet, Excel) or in-memory DataFrame (pandas, Polars). - previous:
object | None(default None). Prior snapshot for diff-aware reviews. When provided, the DiffReviewer compares the current dataset against it and attaches theDatasetDiffResulttoresult.diff. - target_column:
str | None(default None). Name of the target column. Highly recommended to enable target leakage checks. - enabled_reviewers:
Sequence[str] | None(default None). Optional list of specific reviewer IDs to execute. - enabled_categories:
Sequence[ReviewCategory] | None(default None). Optional list of reviewer categories to execute (schema, quality, leakage, diff, feature_quality, custom). - reviewer_config:
Mapping[str, Mapping[str, Any]] | None(default None). Parameter overrides for specific reviewers (e.g. customized thresholds). - max_correlation_columns:
int(default 100). Cap limit for correlation matrix computation during profiling. - max_frequency_table_size:
int(default 1000). Frequency table storage cap.
Return Value
Returns a frozen ReviewResult dataclass containing:
engine_version:strrepresenting the Review Engine result schema version (currently"0.4.0").dataset_summary:DatasetSummarywith row and column count descriptors.generated_at: UTC timestamp.sections: Sorted sequence ofReviewSectionobjects representing the active reviewers' sections (sorted from critical to passed).recommendations: Flat, ranked, cross-section list ofRecommendationobjects generated by the centralized Recommendation Engine.overall_summary: Concise plain-text roll-up.score: An optionalMLReadinessScorecontaining overall rating and per-dimension breakdown.diff:DatasetDiffResult | None. Whenpreviousis provided, the DiffReviewer attaches the computed diff result; otherwiseNone.
SDK Example
import featuresmith as fsresult = fs.review( "train.csv", target_column="churn", reviewer_config={ "review.quality.missingness": {"threshold": 25.0}, "review.quality.cardinality": {"threshold": 0.40} })# Output summary and scoreprint(result.overall_summary)if result.score: print(f"ML Readiness: {result.score.overall}/100") for dim in result.score.dimensions: print(f" {dim.label}: {dim.score}/100")Rendering Review Output
The top-level featuresmith package re-exports fs.render() to generate formatted text reports:
import featuresmith as fsresult = fs.review("train.csv", target_column="churn")report_text = fs.render(result, target="console")print(report_text)fs.render(result: ReviewResult, target: str = "console") -> str formats the review sections, severity badges, and score scorecard into plain text suitable for terminal output or logging.
Output Example
# result.overall_summary'10 of 10 sections passed with 0 finding(s) identified across the review.'# result.score.overall100.0Common Workflows
- Continuous Integration Gates: Validate loaded files in pipeline tests and inspect findings programmatically to block merges when critical errors are uncovered.
- Dataset Triage: Run a quick review over multiple candidate datasets to determine which has the highest data quality and lowest target leakage before selecting a source.
Notes and Limitations
- Deterministic & Advisory: Recommendations are generated deterministically from computed findings and are purely advisory — nothing is auto-applied unless coded into your caller logic. Observability trend logs and HTML static reports are planned for future releases.
Related Documentation
See the CLI counterpart featuresmith review and the ML score reference fs.score().