我有这样的数据集:
print(X_test.dtypes)
metric1 int64
rank float64
device_type int8
NA_estimate float64
当我尝试对这个数据集进行预测时,会出现以下错误:
y_test_pred_xgb = clf_xgb.predict(xgb.DMatrix(X_test))
TypeError: Not supported type for data.<class 'xgboost.core.DMatrix'>
我搜索了一会儿,但只发现了关于object
变量数据类型引起问题的讨论。我的数据还有其他问题吗,还是问题出在其他地方?我已经查看了各种博客和Kaggle的代码,但没有找到解决方法。
as.type()
将 int8 更改为 int64?同时,请检查您的数字变量中是否只有数值。 - jared_mamrot