CatBoost 边框

CatBoost border

由于边框太小,我无法开始使用 catboost 进行 catboost 学习。

X = pandas.read_csv("../input/x_y_test/X.csv")
X_test = pandas.read_csv("../input/x_y_test/X_test.csv")
y = pandas.read_csv("../input/y-data/y.csv")

X = X.reset_index(drop = True)
X_test = X_test.reset_index(drop = True)
y = y.reset_index(drop = True)

X_train, X_val, y_train, y_val = train_test_split(X, y, test_size = .3, random_state = 1337)

X_train = X_train.reset_index(drop = True) 
X_val = X_val.reset_index(drop = True)
y_train = y_train.reset_index(drop = True)
y_val = y_val.reset_index(drop = True)

model_cb = CatBoostClassifier(eval_metric = "Accuracy", n_estimators = 1200, random_seed = 70)
model_cb.fit(X_train, y_train, eval_set = (X_val, y_val), use_best_model = True)

所以我得到了

CatboostError: catboost/libs/metrics/metric.cpp:3929: All train targets are greater than border 0.5

数据

https://drive.google.com/drive/folders/1m7bNIs0mZQQkAsvkETB3n6j62p9QJX39?usp=sharing

你的主要错误是你将 y_train 喂给你的算法:

    id  skilled
0   138177  0
1   36214   0
2   103206  1
3   22699   1
4   96145   1

我相信你真正想要的只是 y_train.skilled

运行 在你试穿之前像下面这样重新分配,你就可以走了:

y_train = y_train.skilled # just skill is enough 
y_val = y_val.skilled # just skill is enough

model_cb = CatBoostClassifier(eval_metric = "Accuracy", n_estimators = 1200, random_seed = 70)
model_cb.fit(X_train, y_train, eval_set = (X_val, y_val), use_best_model = True)

顺便说一句,你真的相信 idX_train 中具有任何预测能力。为什么不把它也从功能中删除?