scikit出现Reshape your data either using X.reshape(-1, 1) if your


使用scikit 预测时出现reshape警告时

classifier.fit(feature_vector, feature_label)
 for i in test_vector:
    print classifier.predict(i).
将 i 使用resheap()得以解决问题,如下所示:

classifier.fit(feature_vector, feature_label) in test_vector: print classifier.predict(numpy.array(i).reshape(1, -1))

你可能感兴趣的:(scikit出现Reshape your data either using X.reshape(-1, 1) if your)