Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:Sdv dev SDV Run Diagnostic

From Leeroopedia
Knowledge Sources
Domains Data_Quality, Diagnostics
Last Updated 2026-02-14 00:00 GMT

Overview

Wrapper for the SDMetrics DiagnosticReport, checking structural validity and coverage of synthetic data within SDV workflows.

Description

The run_diagnostic function wraps sdmetrics.reports.single_table.diagnostic_report.DiagnosticReport (or multi-table variant). It checks data validity, structure, and coverage.

Usage

Call after generating synthetic data to check for structural issues.

Code Reference

Source Location

  • Repository: SDV
  • File: sdv/evaluation/single_table.py (L38-61), sdv/evaluation/multi_table.py (L33-53)

Signature

def run_diagnostic(real_data, synthetic_data, metadata, verbose=True):
    """Run diagnostic report for synthetic data.

    Args:
        real_data (pd.DataFrame or dict): Real data.
        synthetic_data (pd.DataFrame or dict): Synthetic data.
        metadata (Metadata): Metadata describing the data.
        verbose (bool): Print summary. Defaults to True.

    Returns:
        DiagnosticReport: Diagnostic report object.
    """

Import

from sdv.evaluation.single_table import run_diagnostic
# or for multi-table:
from sdv.evaluation.multi_table import run_diagnostic

I/O Contract

Inputs

Name Type Required Description
real_data pd.DataFrame or dict Yes Real data
synthetic_data pd.DataFrame or dict Yes Synthetic data
metadata Metadata Yes Metadata describing the data
verbose bool No Print summary (default: True)

Outputs

Name Type Description
return value DiagnosticReport Diagnostic report with validity, structure, and coverage checks

Usage Examples

from sdv.evaluation.single_table import run_diagnostic

diagnostic = run_diagnostic(real_data, synthetic_data, metadata)
print(f"Diagnostic score: {diagnostic.get_score()}")
details = diagnostic.get_details(property_name='Data Validity')
print(details)

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment