成功解决TypeError: Singleton array array('data_input/xgboost/data_RentListingInquries/RentListingInqurie

简介: 成功解决TypeError: Singleton array array('data_input/xgboost/data_RentListingInquries/RentListingInqurie

解决问题


TypeError: Singleton array array('data_input/xgboost/data_RentListingInquries/RentListingInquries_FE_train_libsvm.txt',

     dtype='  



解决思路


类型错误:Singleton array array('data_input/xgboost/ data_rentlistinginq/ RentListingInquries_FE_train_libsvm.txt',dtype=' 不能其将视为有效集合。



解决方法


读入文件有错误,所以代码需要下边更新!


dump_svmlight_file(y_train, dpath + 'RentListingInquries_FE_train_libsvm.txt',X_train_sparse)

改为

dump_svmlight_file(X_train_sparse, dpath + 'RentListingInquries_FE_train_libsvm.txt')


哈哈,大功告成!后期有出现错误,待更新……


相关文章
|
1月前
isinstance 和 type 的区别
isinstance 和 type 的区别。
35 6
|
5月前
|
开发者 Python
【Python】已解决:TypeError: descriptor ‘index‘ for ‘list‘ objects doesn‘t apply to a ‘str‘ object
【Python】已解决:TypeError: descriptor ‘index‘ for ‘list‘ objects doesn‘t apply to a ‘str‘ object
151 0
YOLO V5出现RuntimeError: result type Float can‘t be cast to the desired output type long int解决方法
YOLO V5出现RuntimeError: result type Float can‘t be cast to the desired output type long int解决方法
714 0
Sklearn|报错<Expected 2D array, got 1D array instead:...>的3种解决办法
Sklearn|报错<Expected 2D array, got 1D array instead:...>的3种解决办法
|
编解码 搜索推荐 算法
Data-Data Objects and Attribute Types| 学习笔记
快速学习 Data-Data Objects and Attribute Types。
Data-Data Objects and Attribute Types| 学习笔记
Python typeError: a bytes-like object is required, not ‘str’ Solution
Python typeError: a bytes-like object is required, not ‘str’ Solution
TypeError: sequence item 0: expected string, int found
TypeError: sequence item 0: expected string, int found