使用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
最新推荐文章于 2024-06-09 14:04:54 发布