Exercises / ml
k-NN majority vote
vote(labels) returns 1 if 1 appears more often than 0, else 0. Print vote of [0,1,1] and [0,0,1].
Live Pythonpython
Output
Run to execute this in your browser. Nothing is sent to a server.
Exercises / ml
vote(labels) returns 1 if 1 appears more often than 0, else 0. Print vote of [0,1,1] and [0,0,1].
Run to execute this in your browser. Nothing is sent to a server.