Skip to content

Commit

Permalink
Add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
fealho committed Sep 10, 2024
1 parent 7390e34 commit 82948e6
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/integration/test_load_demo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from ctgan import CTGAN, load_demo


def test_load_demo():
"""End-to-end test to load and synthesize data."""
# Setup
discrete_columns = [
'workclass',
'education',
'marital-status',
'occupation',
'relationship',
'race',
'sex',
'native-country',
'income',
]
ctgan = CTGAN(epochs=1)

# Run
data = load_demo()
ctgan.fit(data, discrete_columns)
samples = ctgan.sample(1000, condition_column='native-country', condition_value='United-States')

# Assert
assert samples.shape == (1000, 15)
assert all([col[0] != ' ' for col in samples.columns])
assert not samples.isna().any().any()

0 comments on commit 82948e6

Please sign in to comment.