Python SDK
fs.analyze()
SDK Reference: comprehensive analysis
python
def analyze( source: object, *, target_column: str | None = None, enabled_rules: list[str] | None = None, rule_config: dict[str, Any] | None = None, max_correlation_columns: int = 100, max_frequency_table_size: int = 1000,) -> RuleResult:Combines loading, profiling, and rules auditing into a single public SDK endpoint.
When to Use It
Use when you want to compute statistical profiles and evaluate quality rules simultaneously to obtain a list of flagged RuleFinding objects.
Arguments
- source:
Dataset|str|DataFrame. Input data or path. - target_column:
str | None(default None). Target column name. Required for target leakage checks. - enabled_rules:
list[str] | None(default None). Explicit rule IDs to evaluate. If omitted, runs all defaults. - rule_config:
dict[str, Any] | None. Keyword argument config overrides for specific rules. - max_correlation_columns:
int(default 100). Cap limit for correlation matrix computation. - max_frequency_table_size:
int(default 1000). Frequency table storage cap.
Return Value
Returns a frozen RuleResult dataclass containing profile (ProfileResult), findings (sequence of RuleFinding), executed_rules, execution_time_ms, and failed_rules (mapping of rule ID to error traceback).
Exceptions
ConnectorError: Raised if the source dataset fails to load before profiling.
Example
python
import featuresmith as fsresult = fs.analyze( "train.csv", target_column="churn", rule_config={ "quality.missing_value_threshold": {"threshold": 30.0}, "statistical.high_correlation": {"threshold": 0.85}, })print(f"Executed {len(result.executed_rules)} rules with {len(result.findings)} findings.")for finding in result.findings: print(f"[{finding.severity}] {finding.title} in {finding.column_name}")