我有一个形状为x_test
的数据框((1672, 9376)
),其对象是:
<1672x9376 sparse matrix of type '<class 'numpy.float64'>'
with 14108 stored elements in Compressed Sparse Row format>
我正试图将这些数据传递到sklearn的score()
方法中,以免像这样对标签数据进行标记:
classifier.score(x_test, y_test)
但是我收到此错误:
ValueError: could not broadcast input array from shape (0) into shape (1672)
我的y_test
的形状为(1672,)
x_test
内容
(Pdb) self.x_test[1,1]
0.0
(Pdb) self.x_test[1,2]
0.0
(Pdb) self.x_test[1,:]
<1x9376 sparse matrix of type '<class 'numpy.float64'>'
with 1 stored elements in Compressed Sparse Row format>