if not self.cols:
return X
X, _ = self.target_encode(
X, y,
mapping=self.mapping,
cols=self.cols,
After Change
if not self.cols:
return X
X = self.ordinal_encoder.transform(X)
if self.handle_unknown == "error":
if X[self.cols].isnull().any():
raise ValueError("Unexpected categories found in dataframe")
X = self.target_encode(X)
if self.drop_invariant:
for col in self.drop_cols:
X.drop(col, 1, inplace=True)