由于边界狭小,我无法开始用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
发布于 2019-03-13 13:44:30
您的主要错误是将y_train添加到您的algo中,如下所示:
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)顺便提一句,你真的相信id in X_train具有任何预测能力吗?为什么不把它也从功能中删除呢?
https://stackoverflow.com/questions/55142717
复制相似问题