Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- preprocessor = ColumnTransformer(
- transformers=[
- ('scaler', StandardScaler(), numerical_features) # масштабируем численные признаки
- ],
- remainder='passthrough' # остальные признаки остаются без изменений
- )
- # Создание пайплайна
- cbc_pipeline = Pipeline([
- ('preprocessor', preprocessor),
- #('imputer', SimpleImputer(strategy='median')),
- ('clf', CatBoostClassifier(random_seed=STATE,
- cat_features=categorical_features,
- eval_metric='F1',
- auto_class_weights='Balanced',
- verbose=100))
- ]
- )
- # Обучение модели
- cbc_pipeline.fit(X_train, y_train)
- Ошибка:
- CatBoostError Traceback (most recent call last)
- <ipython-input-51-4f605af09d07> in <cell line: 22>()
- 20
- 21 # Обучение модели
- ---> 22 cbc_pipeline.fit(X_train, y_train)
- 7 frames
- /usr/local/lib/python3.10/dist-packages/catboost/core.py in _get_features_indices(features, feature_names)
- 323 for f in features:
- 324 if isinstance(f, STRING_TYPES):
- --> 325 raise CatBoostError("features parameter contains string value '{}' but feature names "
- 326 "for a dataset are not specified".format(f))
- 327 return features
- CatBoostError: features parameter contains string value 'пол' but feature names for a dataset are not specified
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement