Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if y is bool convert it into numerical #431

Merged
merged 3 commits into from
Dec 3, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
if y is bool convert it into numerical
  • Loading branch information
mausam3407 committed Nov 21, 2023
commit 0be576d5665cd57abfa036f2ef9abcf29cefe517
2 changes: 1 addition & 1 deletion category_encoders/cat_boost.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def __init__(self, verbose=0, cols=None, drop_invariant=False, return_df=True,

def _fit(self, X, y, **kwargs):
X = X.copy(deep=True)

y = y.astype('double') #Incase y is bool.
self._mean = y.mean()
self.mapping = {col: self._fit_column_map(X[col], y) for col in self.cols}

Expand Down