2

我在其他笔记本中使用 CatBoostClassifier 运行了以下代码。但是,当我使用 CatBoostRegressor 使用相同的参数重复相同的过程时,我收到有关自定义记录器的错误。任何帮助,将不胜感激。

from catboost import CatBoostRegressor
from mlxtend.feature_selection import SequentialFeatureSelector as SFS
from sklearn.compose import ColumnTransformer

transformer = ColumnTransformer(
[('category', OneHotEncoder(), cat_cols),
('num', StandardScaler(), num_cols)],
remainder='passthrough')

sfs = SFS(CatBoostRegressor(iterations=100, verbose=False), 
           k_features=X_train.shape[1], 
           forward=True, 
           floating=False, 
           verbose=2,
           scoring='r2',
           cv=5)

sfs = sfs.fit(transformer.fit_transform(X_train), np.array(y_train))

> [Parallel(n_jobs=1)]: Using backend SequentialBackend with 1
> concurrent workers. [Parallel(n_jobs=1)]: Done   1 out of   1 |
> elapsed:    3.4s remaining:    0.0s Custom logger is already
> specified. Specify more than one logger at same time is not thread
> safe.Custom logger is already specified. Specify more than one logger
> at same time is not thread safe.
4

0 回答 0