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
HomeDocsfs.score()

Python SDK

fs.score()

SDK Reference: extract or calculate ML Readiness Score

python
1def score(result: ReviewResult) -> MLReadinessScore | None:

Overview

Extracts or computes the ML Readiness Score of a dataset. When the provided ReviewResult already carries a score, it is returned directly; otherwise, the score is calculated deterministically from the findings in the result's review sections. This function is a lightweight read-only accessor and never re-runs the data profiling or rule execution stages.

When to Use It

Use when you need to inspect the quality breakdown of a dataset across named dimensions after a review has run. It allows you to check specific dimension ratings, review why points were deducted, and gather suggestions on how to improve the overall score.

Parameters

  • result: ReviewResult. An existing result object produced by fs.review().

Return Value

Returns an MLReadinessScore dataclass (or None if no dimensions are applicable) containing:

  • scoring_version: str (currently "0.3.0").
  • overall: float score scaled from 0.0 to 100.0, representing the weighted average of all applicable dimensions.
  • dimensions: Sequence of DimensionScore objects carrying metrics for Schema Health, Missing Values, Feature Quality, Distribution Health, Leakage Risk, Data Quality, and Consistency.

Each DimensionScore includes a score, weight, rationale, contributing_findings, and suggested_actions.

SDK Example

python
1import featuresmith as fs
2
3result = fs.review("data.csv", target_column="label")
4score = fs.score(result)
5
6if score:
7 print(f"Overall Score: {score.overall}/100")
8 for dim in score.dimensions:
9 if dim.score < 100.0:
10 print(f"[{dim.label}] Rationale: {dim.rationale}")
11 print(f" Actions to improve: {dim.suggested_actions}")

Scoring Formula

Each dimension starts at a perfect score of 100.0. Deductions are subtracted based on the severity of the findings in the corresponding section:

  • Critical Finding: -30.0 points
  • Warning Finding: -15.0 points
  • Info Finding: -5.0 points

The overall score is calculated as the weighted average:

overall = sum(dim.score * dim.weight) / sum(dim.weight)

Inapplicable dimensions are omitted and their weights are renormalized automatically, ensuring that regression-only datasets are not unfairly penalized for missing classification-specific metrics.

Notes and Limitations

  • Read-Only Accessor: fs.score() does not trigger any profiling or rule-evaluation runs. It is completely derived from pre-existing findings.
  • Configuration Status: Configuration of custom weights in a .featuresmith.yml file is deferred. The score currently uses uniform default weights (1.0).

Related Documentation

See the review SDK reference fs.review() and the CLI scorecard overview featuresmith score.

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.