Perceptron logic gates

hi i’m struggle with this next step in the project my code is
data= [[0,0],[0,1], [1,0], [1,1]]

labels= [0 , 0 , 0 , 1]

plt.scatter=([point[0]for point in data],
[point[1]for point in data], c=labels)

plt.show()

classifier=perceptron(max_iter=40)
classifier.fit=(data,labels)
print(classifer.score(data,labels))
plt.show

the error shows File “script.py”, line 12
[point[1]for point in data], c=labels)
^
SyntaxError: invalid syntax

Hi,
plt.scatter is a function. You don’t want the = between it and ([point…
It looks like you made a similar error further down

classifier.fit(data, labels)

Hope that helps.

I can’t believe I didn’t see that I was looking for so long thanks so much for you help man.

1 Like