【发布时间】:2018-01-15 00:55:46
【问题描述】:
我正在使用混淆矩阵模块将类预测结果与实际值进行比较。
val= ... #shape (3000,1,30) dtype float32
pred = ... #shape (3000,1,30) dtype float32
cnf_matrix = confusion_matrix(val, pred) #ERROR HERE
我收到了这个错误:
Traceback(最近一次调用最后一次):文件“vis.py”,第 757 行,在 cnf_matrix=confusion_matrix(y_test, y_pred) 文件 "C:\Anaconda\envs\nn35\lib\site-packages\sklearn\metrics\classification.py", 第 240 行,在混淆矩阵中 y_type, y_true, y_pred = _check_targets(y_true, y_pred) 文件 "C:\Anaconda\envs\nn35\lib\site-packages\sklearn\metrics\classification.py", 第 89 行,在 _check_targets 中 raise ValueError("{0} is not supported".format(y_type)) ValueError: unknown is not supported
我做错了什么?
【问题讨论】:
标签: scikit-learn