Skip to content

Commit

Permalink
Fixing example(for now)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wh1isper committed Dec 17, 2023
1 parent 443b332 commit 7624f25
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
16 changes: 1 addition & 15 deletions sdgx/models/components/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,7 @@ def _fit_continuous(self, data):
A ``ColumnTransformInfo`` object.
"""
column_name = data.columns[0]

# 这里进行了修改,用于防止未来的兼容性问题,同时避免出现以下警告
# ======================================================
# FutureWarning: Future versions of RDT
# will not support the 'model_missing_values' parameter.
# Please switch to using the 'missing_value_generation'
# parameter to select your strategy.
# ======================================================

# 修改前
# gm = ClusterBasedNormalizer(model_missing_values=True, max_clusters=min(len(data), 10))
# 修改后
gm = ClusterBasedNormalizer(
missing_value_generation="from_column", max_clusters=min(len(data), 10)
)
gm = ClusterBasedNormalizer(model_missing_values=True, max_clusters=min(len(data), 10))
gm.fit(data, column_name)
num_components = sum(gm.valid_component_indicator)

Expand Down
3 changes: 2 additions & 1 deletion sdgx/models/ml/single_table/ctgan.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from sdgx.models.components.transform import DataTransformer
from sdgx.models.components.utils import random_state
from sdgx.models.extension import hookimpl
from sdgx.models.ml.single_table.base import TorchSynthesizerModel


class Discriminator(Module):
Expand Down Expand Up @@ -110,7 +111,7 @@ def forward(self, input_):

# 目前针对了较大的数据进行内存占用上的优化
# 总体思路是采用分批 load 进内存的方法,优化其占用空间的大小
class CTGAN(SynthesizerModel):
class CTGAN(TorchSynthesizerModel):
"""Conditional Table GAN Synthesizer.
This is the core class of the CTGAN project, where the different components
Expand Down

0 comments on commit 7624f25

Please sign in to comment.