Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up test_benchmark_single_table_realtabformer_no_metrics integration test #382

Merged
merged 2 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions sdgym/synthesizers/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
)

from sdgym.synthesizers.base import BaselineSynthesizer, MultiSingleTableBaselineSynthesizer
from sdgym.synthesizers.realtabformer import RealTabFormerSynthesizer
from sdgym.synthesizers.sdv import SDVRelationalSynthesizer, SDVTabularSynthesizer

SYNTHESIZER_MAPPING = {
Expand All @@ -19,6 +20,7 @@
'TVAESynthesizer': TVAESynthesizer,
'PARSynthesizer': PARSynthesizer,
'HMASynthesizer': HMASynthesizer,
'RealTabFormerSynthesizer': RealTabFormerSynthesizer,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes to make create_sdv_synthesizer_variant work with RealTabFormerSynthesizer.

}


Expand Down Expand Up @@ -55,6 +57,8 @@ def create_sdv_synthesizer_variant(display_name, synthesizer_class, synthesizer_
baseclass = SDVTabularSynthesizer
if synthesizer_class == 'HMASynthesizer':
baseclass = SDVRelationalSynthesizer
if synthesizer_class == 'RealTabFormerSynthesizer':
baseclass = RealTabFormerSynthesizer

class NewSynthesizer(baseclass):
"""New Synthesizer class.
Expand Down
12 changes: 10 additions & 2 deletions tests/integration/test_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,18 @@ def test_benchmark_single_table_basic_synthsizers():
def test_benchmark_single_table_realtabformer_no_metrics():
"""Test it without metrics."""
# Run

custom_synthesizer = create_sdv_synthesizer_variant(
display_name='RealTabFormerSynthesizer',
synthesizer_class='RealTabFormerSynthesizer',
synthesizer_parameters={'epochs': 2},
)
output = sdgym.benchmark_single_table(
synthesizers=['RealTabFormerSynthesizer'],
sdv_datasets=['student_placements'],
synthesizers=[],
custom_synthesizers=[custom_synthesizer],
sdv_datasets=['fake_companies'],
sdmetrics=[],
limit_dataset_size=True,
)

# Assert
Expand Down
Loading