I'm unable to plot the data for classification algo using numpy as it throws this error ValueError: x and y must be the same size
My data in the data variable look like this:
[[ 34.62365962 78.02469282 0. ]
[ 30.28671077 43.89499752 0. ]
[ 35.84740877 72.90219803 0. ]
[ 60.18259939 86.3085521 1. ]
[ 79.03273605 75.34437644 1. ]
[ 45.08327748 56.31637178 0. ]
[ 61.10666454 96.51142588 1. ]
[ 75.02474557 46.55401354 1. ]]
Code:
data=np.loadtxt('ex2data1.txt',delimiter=',',dtype=None)
X = data[:, [0,1]]
y = data[:, 2]
pylab.scatter(X,y)
pylab.show()
I'm trying to plot this:

xandycoordinate for that point. Currently you're trying to plot twoxvalues peryvalue, but it doesn't know how to map them. With your current code, the easiest thing would be to duplicate theyvalues for the second row ofxvalues and plot all of them that way.