Example #1
0
class TestPytorchDPSynthesizer_DPGAN:
    def setup(self):
        self.dpgan = PytorchDPSynthesizer(DPGAN(), GeneralTransformer())

    def test_fit(self):
        self.dpgan.fit(df)
        assert self.dpgan.gan.generator

    def test_sample(self):
        self.dpgan.fit(df)
        sample_size = len(df)
        synth_data = self.dpgan.sample(sample_size)
        assert synth_data.shape == df.shape
Example #2
0
class TestPytorchDPSynthesizer_PATECTGAN:
    def setup(self):
        self.patectgan = PytorchDPSynthesizer(PATECTGAN(), None)

    def test_fit(self):
        self.patectgan.fit(
            df, categorical_columns=['sex', 'educ', 'race', 'married'])
        assert self.patectgan.gan.generator

    def test_sample(self):
        self.patectgan.fit(
            df, categorical_columns=['sex', 'educ', 'race', 'married'])
        sample_size = len(df)
        synth_data = self.patectgan.sample(sample_size)
        assert synth_data.shape == df.shape
Example #3
0
 def setup(self):
     self.patectgan = PytorchDPSynthesizer(
         PATECTGAN(regularization='dragan'), None)
Example #4
0
 def setup(self):
     self.patectgan = PytorchDPSynthesizer(PATECTGAN(), None)
Example #5
0
 def setup(self):
     self.dpctgan = PytorchDPSynthesizer(DPCTGAN(), None)
Example #6
0
 def setup(self):
     self.dpgan = PytorchDPSynthesizer(DPGAN(), GeneralTransformer())
Example #7
0
 def setup(self):
     self.patectgan = PytorchDPSynthesizer(
         PATECTGAN(loss='wasserstein', regularization='dragan'), None)
Example #8
0
 def setup(self):
     self.pategan = PytorchDPSynthesizer(PATEGAN(), GeneralTransformer())
Example #9
0
 def QuailSynth(epsilon):
     return PytorchDPSynthesizer(preprocessor=None,
                     gan=PATECTGAN(loss='cross_entropy', batch_size=50, pack=1, sigma=5.0))