如何在将 CatboostClassifier 用于 Multiclass 问题时使用“class_weights”。文档说它应该是一个列表,但是我需要按什么顺序放置权重?我有一个标签数组,其中包含从 -2 到 +2 的 15 个类,包括十进制数,与其他类相比,类 0 的密度要高得多。请帮忙。谢谢,
我尝试了二进制类,它更容易使用,但对多类一无所知。
cb_model_step1 = run_catboost(X_train, y_train_new, X_test, y_test_new, n_estimators = 1000, verbose=100, eta = 0.3, loss_function = 'MultiClassOneVsAll', class_weights = counter_new)
cb = CatBoostClassifier(thread_count=4, n_estimators=n_estimators, max_depth=10, class_weights = class_weights, eta=eta, loss_function = loss_function)