Skip to content

Commit

Permalink
Merge pull request #772 from a-szulc/master
Browse files Browse the repository at this point in the history
change X.iloc[:, 1] to X[column_name] so there is no warning from pandas (fixes #750)
  • Loading branch information
pplonski authored Sep 2, 2024
2 parents 2b6aa16 + 2cdb009 commit bef7984
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions supervised/algorithms/catboost.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,10 @@ def fit(
for i in range(X.shape[1]):
if PreprocessingUtils.is_categorical(X.iloc[:, i]):
self.cat_features += [i]
X.iloc[:, i] = X.iloc[:, i].astype(str)
col_name = X.columns[i]
X[col_name] = X[col_name].astype(str)
if X_validation is not None:
X_validation.iloc[:, i] = X_validation.iloc[:, i].astype(str)
X_validation[col_name] = X_validation[col_name].astype(str)

eval_set = None
if X_validation is not None and y_validation is not None:
Expand Down

0 comments on commit bef7984

Please sign in to comment.