title: How to calculate the accuracy score from out of sample data?
body: <p>for example -</p>
  
  <pre><code>X = iris.data
  y = iris.target
  
  from sklearn.nighbors import KNeighborsClassifier
  
  knn = KNeighborsClassifier()
  
  knn.fit(X,y)
  
  pred = knn.predict([3,5,4,2])
  
  print(pred)
  </code></pre>
  
  <p>output: [2] ... here 2 represents a class value
  How can I calculate the accuracy of this prediction?</p>