Skip to content

Commit 76dc8ab

Browse files
authored
refactor: rename Metrics to ModelMetrics
1 parent 15427e2 commit 76dc8ab

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

mostlyai/qa/_html_report.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
HTML_REPORT_TEMPLATE,
2828
HTML_REPORT_EARLY_EXIT,
2929
)
30-
from mostlyai.qa.metrics import Metrics
30+
from mostlyai.qa.metrics import ModelMetrics
3131

3232
_LOG = logging.getLogger(__name__)
3333

@@ -54,7 +54,7 @@ def store_report(
5454
report_path: Path,
5555
report_type: Literal["model_report", "data_report"],
5656
workspace: TemporaryWorkspace,
57-
metrics: Metrics | None,
57+
metrics: ModelMetrics | None,
5858
meta: dict,
5959
acc_uni: pd.DataFrame,
6060
acc_biv: pd.DataFrame,

mostlyai/qa/metrics.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def trim_metric_precision(cls, value):
220220
return round(value, precision) if value is not None else None
221221

222222

223-
class Metrics(CustomBaseModel):
223+
class ModelMetrics(CustomBaseModel):
224224
accuracy: Accuracy | None = Field(
225225
default=None,
226226
description="Metrics regarding the accuracy of synthetic data, measured as the closeness of discretized lower "

mostlyai/qa/report.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
plot_store_univariates,
3737
plot_store_bivariates,
3838
)
39-
from mostlyai.qa.metrics import Metrics, Accuracy, Similarity, Distances
39+
from mostlyai.qa.metrics import ModelMetrics, Accuracy, Similarity, Distances
4040
from mostlyai.qa._sampling import calculate_embeddings, pull_data_for_accuracy, pull_data_for_embeddings
4141
from mostlyai.qa._common import (
4242
determine_data_size,
@@ -73,7 +73,7 @@ def report(
7373
max_sample_size_embeddings: int | None = None,
7474
statistics_path: str | Path | None = None,
7575
update_progress: ProgressCallback | None = None,
76-
) -> tuple[Path, Metrics | None]:
76+
) -> tuple[Path, ModelMetrics | None]:
7777
"""
7878
Generate HTML report and metrics for assessing synthetic data quality.
7979
@@ -353,7 +353,7 @@ def _calculate_metrics(
353353
sim_cosine_trn_syn: np.float64 | None = None,
354354
sim_auc_trn_hol: np.float64 | None = None,
355355
sim_auc_trn_syn: np.float64 | None = None,
356-
) -> Metrics:
356+
) -> ModelMetrics:
357357
do_accuracy = acc_uni is not None and acc_biv is not None
358358
do_distances = dcr_trn is not None
359359
do_similarity = sim_cosine_trn_syn is not None
@@ -412,7 +412,7 @@ def _calculate_metrics(
412412
)
413413
else:
414414
distances = Distances()
415-
return Metrics(
415+
return ModelMetrics(
416416
accuracy=accuracy,
417417
similarity=similarity,
418418
distances=distances,

0 commit comments

Comments
 (0)