Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 3
0
 def setup(self):
     self.patectgan = PytorchDPSynthesizer(
         PATECTGAN(regularization='dragan'), None)
Ejemplo n.º 4
0
 def setup(self):
     self.patectgan = PytorchDPSynthesizer(PATECTGAN(), None)
Ejemplo n.º 5
0
 def setup(self):
     self.dpctgan = PytorchDPSynthesizer(DPCTGAN(), None)
Ejemplo n.º 6
0
 def setup(self):
     self.dpgan = PytorchDPSynthesizer(DPGAN(), GeneralTransformer())
Ejemplo n.º 7
0
 def setup(self):
     self.patectgan = PytorchDPSynthesizer(
         PATECTGAN(loss='wasserstein', regularization='dragan'), None)
Ejemplo n.º 8
0
 def setup(self):
     self.pategan = PytorchDPSynthesizer(PATEGAN(), GeneralTransformer())
Ejemplo n.º 9
0
 def QuailSynth(epsilon):
     return PytorchDPSynthesizer(preprocessor=None,
                     gan=PATECTGAN(loss='cross_entropy', batch_size=50, pack=1, sigma=5.0))