-
Notifications
You must be signed in to change notification settings - Fork 541
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Intro dummy table for speedup models case (#92)
- Loading branch information
Showing
3 changed files
with
77 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,26 @@ | ||
from pathlib import Path | ||
|
||
import pandas as pd | ||
import pytest | ||
|
||
from sdgx.models.statistics.single_table.copula import GaussianCopulaSynthesizer | ||
from sdgx.utils import get_demo_single_table | ||
|
||
|
||
def test_gaussian_copula(demo_single_table_path): | ||
demo_data, discrete_cols = get_demo_single_table(Path(demo_single_table_path).parent) | ||
@pytest.fixture | ||
def dummy_data(dummy_single_table_path): | ||
yield pd.read_csv(dummy_single_table_path) | ||
|
||
|
||
@pytest.fixture | ||
def discrete_cols(dummy_data): | ||
yield [col for col in dummy_data.columns if not col.startswith("feature")] | ||
|
||
|
||
def test_gaussian_copula(dummy_data, discrete_cols): | ||
model = GaussianCopulaSynthesizer(discrete_cols) | ||
model.fit(demo_data) | ||
model.fit(dummy_data) | ||
|
||
sampled_data = model.sample(10) | ||
assert len(sampled_data) == 10 | ||
assert sampled_data.columns.tolist() == dummy_data.columns.tolist() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters