成功解决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')


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


相关文章
|
2月前
|
TensorFlow 算法框架/工具 Python
【Tensorflow】Found unexpected keys that do not correspond to any Model output: dict_keys([‘model_outp
文章讨论了在使用Tensorflow 2.3时遇到的错误信息:"Found unexpected keys that do not correspond to any Model output: dict_keys(['model_output']). Expected: ['dense']"。这个问题通常发生在模型的输出层命名与model.fit_generator的生成器函数中返回的值的键不匹配时。
35 1
|
3月前
|
开发者 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
73 0
Sklearn|报错<Expected 2D array, got 1D array instead:...>的3种解决办法
Sklearn|报错<Expected 2D array, got 1D array instead:...>的3种解决办法
解决AttributeError: ‘model‘ object has no attribute ‘copy‘
原因是没有使用model.state_dict()进行模型保存,但是使用了model.load_state_dict()加载模型。这两者要配套使用。
385 0
|
Python
完美解决 TypeError: Invalid shape (3, 224, 224) for image data
完美解决 TypeError: Invalid shape (3, 224, 224) for image data
875 0
|
PyTorch 算法框架/工具
AttributeError: ‘model’ object has no attribute ‘copy’-pytorch
AttributeError: ‘model’ object has no attribute ‘copy’-pytorch
|
Python
ValueError: Object arrays cannot be loaded when allow_pickle=False 解决方法
ValueError: Object arrays cannot be loaded when allow_pickle=False
423 0
ValueError: Object arrays cannot be loaded when allow_pickle=False 解决方法