Skip to content

Commit

Permalink
integration tests 1
Browse files Browse the repository at this point in the history
  • Loading branch information
R-Palazzo committed Feb 3, 2025
1 parent 2568fe7 commit ce7187a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ dependencies = [
'copulas>=0.11.0',
'tqdm>=4.29',
'plotly>=5.19.0',
'xgboost>=1.1.0'
]

[project.urls]
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from sdmetrics.demos import load_demo
from sdmetrics.single_table.data_augmentation import BinaryClassifierPrecisionEfficacy


class TestBinaryClassifierPrecisionEfficacy:
def test_end_to_end(self):
"""Test the metric end-to-end."""
# Setup
real_data, synthetic_data, metadata = load_demo(modality='single_table')
real_training, real_validation = real_data.train_test_split(test_size=0.2, random_state=0)

# Run
score_breakdown = BinaryClassifierPrecisionEfficacy.compute_breakdown(
real_training_data=real_training,
synthetic_data=synthetic_data,
real_validation_data=real_validation,
metadata=metadata,
prediction_column_name='gender',
minority_class_label='F',
classifier='XGBoost',
fixed_recall_value=0.8,
)

# Assert
assert 'real_data_baseline' in score_breakdown

0 comments on commit ce7187a

Please sign in to comment.