Cataboost模型训练

时间:2018-12-28 09:00:47

标签: machine-learning data-science catboost

我正在使用catboost训练我的模型,这给我键入错误: 代码:

x_train = x_train.astype(np.float32)
x_test = x_test.astype(np.float32)
y_train = y_train.astype(np.float32)
y_test = y_test.astype(np.float32)

train_pool = Pool(x_train, y_train, cat_features=[]) # cat_features=[0,2,5])
test_pool = Pool(x_test)

cb = CatBoostRegressor(iterations=400,
                         learning_rate=0.02,
                         depth=12,
                         eval_metric='RMSE')
cb.fit(train_pool)

错误:

/opt/conda/lib/python3.6/site-packages/catboost/core.py in _init(self, data, label, cat_features, pairs, weight, group_id, group_weight, subgroup_id, pairs_weight, baseline, feature_names)
    635         if feature_names is not None:
    636             self._check_feature_names(feature_names, features_count)
--> 637         self._init_pool(data, label, cat_features, pairs, weight, group_id, group_weight, subgroup_id, pairs_weight, baseline, feature_names)
    638 
    639 

_catboost.pyx in _catboost._PoolBase._init_pool()

_catboost.pyx in _catboost._PoolBase._init_pool()

TypeError: unhashable type: 'numpy.ndarray'

我已经将所有内容都转换为float32,并且所有列都是数字。有人可以帮我在这里了解问题吗?

0 个答案:

没有答案