Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, min_obs=10):
"""Initialize the OneHotEncoder class object.
Args:
min_obs (int): minimum number of observations required to create
a dummy variable
label_encoder (LabelEncoder): LabelEncoder that transofrm
"""
self.min_obs = min_obs
self.label_encoder = LabelEncoder(min_obs)
elif isinstance(n_emb, list):
if not n_emb:
self.n_emb = [None] * len(cat_cols)
else:
assert len(cat_cols) == len(n_emb)
self.n_emb = n_emb
else:
raise ValueError('n_emb should be int or list')
self.min_obs = min_obs
self.n_epoch = n_epoch
self.batch_size = batch_size
self.cv = cv
self.random_state = random_state
self.lbe = LabelEncoder(min_obs=self.min_obs)