绘制SVM预测值时出现真值错误

时间:2018-09-18 07:59:16

标签: python matplotlib svm

我在plot函数调用中遇到的主要错误:

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

回溯上下文:

Traceback (most recent call last):

File "<ipython-input-5-10061f33ba63>", line 16, in <module>
plt.show(ix_train)

File "/home/.local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 253, in show
return _show(*args, **kw)

File "/usr/lib/python2.7/dist-packages/ipykernel/pylab/backend_inline.py", line 41, in show
if close and Gcf.get_all_fig_managers():

1 个答案:

答案 0 :(得分:1)

您为static navigationOptions = ({navigation}) => ({ headerRight: ( <Button ... navigation.navigate("Login"); > Log out </Button> ) }) show提供了一个参数。这不是应该使用plt.show(something)的方式。 相反,您想绘制一些东西,然后显示以前创建的图,

show