File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99model are not checked.
1010"""
1111
12+ import tempfile as tf
13+
1214import numpy as np
1315import pandas as pd
1416
@@ -120,9 +122,10 @@ def test_save_load():
120122
121123 ctgan = CTGANSynthesizer (epochs = 1 )
122124 ctgan .fit (data , discrete_columns )
123- ctgan .save ("test_ctgan.pkl" )
124125
125- ctgan = CTGANSynthesizer .load ("test_ctgan.pkl" )
126+ with tf .TemporaryDirectory () as temporary_directory :
127+ ctgan .save (temporary_directory + "test_tvae.pkl" )
128+ ctgan = CTGANSynthesizer .load (temporary_directory + "test_tvae.pkl" )
126129
127130 sampled = ctgan .sample (1000 )
128131 assert set (sampled .columns ) == {'continuous' , 'discrete' }
Original file line number Diff line number Diff line change 99model are not checked.
1010"""
1111
12+ import tempfile as tf
13+
1214import numpy as np
1315import pandas as pd
1416
@@ -70,11 +72,12 @@ def test_save_load():
7072 })
7173 discrete_columns = ['discrete' ]
7274
73- tvae = TVAESynthesizer (epochs = 1 )
75+ tvae = TVAESynthesizer (epochs = 10 )
7476 tvae .fit (data , discrete_columns )
75- tvae .save ("test_tvae.pkl" )
7677
77- tvae = TVAESynthesizer .load ("test_tvae.pkl" )
78+ with tf .TemporaryDirectory () as temporary_directory :
79+ tvae .save (temporary_directory + "test_tvae.pkl" )
80+ tvae = TVAESynthesizer .load (temporary_directory + "test_tvae.pkl" )
7881
7982 sampled = tvae .sample (1000 )
8083 assert set (sampled .columns ) == {'continuous' , 'discrete' }
You can’t perform that action at this time.
0 commit comments