我对分类功能进行了编码,并尝试使用hstack对其进行连接,但出现以下错误
从scipy.sparse导入hstack X_tr = hstack((lb_train_ng,lb_train_rt,X_train_av_std,X_train_chl_std,X_train_mn_std,X_train_l_std,X_train_lo_std))。tocsr()
ValueError跟踪(最近的呼叫 最后)在() 1从scipy.sparse导入vstack ----> 2 X_tr = vstack((lb_train_ng,lb_train_rt,X_train_av_std,X_train_chl_std,X_train_mn_std,X_train_l_std,X_train_lo_std))。tocsr() 3 X_cr = vstack((lb_cv_ng,lb_cv_rt,X_train_av_std,X_cv_chl_std,X_cv_mn_std,X_cv_l_std,X_cv_lo_std))。tocsr() 4 X_te = vstack((lb_test_ng,lb_test_rt,X_train_av_std,X_test_chl_std,X_test_mn_std,X_test_l_std,X_test_lo_std))。tocsr() 5
2帧/usr/local/lib/python3.6/dist-packages/numpy/core/numeric.py 以asarray(a,dtype,order) 536 537“”“ -> 538返回数组(a,dtype,copy = False,order = order) 539 540
ValueError:无法将形状为(34226,5)的输入数组广播到 形状(34226)