Module: Synthra::QualityMetrics
- Defined in:
- lib/synthra/quality_metrics.rb
Overview
Data Quality Metrics
Analyze generated data for quality, realism, and distribution. Useful for validating test data quality and debugging generation issues.
Defined Under Namespace
Classes: Analyzer, GenerationResult, QualityReport
Class Method Summary collapse
-
.analyze(records, schema: nil) ⇒ QualityReport
Analyze a collection of records.
-
.generate_with_quality(schema_name, count: 100, **options) ⇒ GenerationResult
Generate data with quality report.
Class Method Details
.analyze(records, schema: nil) ⇒ QualityReport
Analyze a collection of records
25 26 27 28 29 30 |
# File 'lib/synthra/quality_metrics.rb', line 25 def analyze(records, schema: nil) schema = Synthra.registry.schema(schema.to_s) if schema.is_a?(String) analyzer = Analyzer.new(records, schema) analyzer.analyze end |
.generate_with_quality(schema_name, count: 100, **options) ⇒ GenerationResult
Generate data with quality report
39 40 41 42 43 44 45 |
# File 'lib/synthra/quality_metrics.rb', line 39 def generate_with_quality(schema_name, count: 100, **) schema = Synthra.registry.schema(schema_name) records = schema.generate_many(count, **) report = analyze(records, schema: schema) GenerationResult.new(records, report) end |