我已经在sk上使用了度量,学习如何将度量精度与此模型进行比较:
# Model Accuracy, how often is the classifier correct?
a = y_test
b = df_train['Interest_Rate']
k = a.reshape(1, -1)
y = b.reshape(1, -1)
print("Accuracy:",metrics.accuracy_score(k, y))
但当我运行它时,为什么它会变成错误
raise ValueError(
ValueError: Expected 2D array, got 1D array instead:
array=[1 3 3 ... 1 3 2].
Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.
暂无答案!
目前还没有任何答案,快来回答吧!