title: how to measure the accuracy of knn classifier in python
body: <p>I have used knn to classify my dataset. But I do not know how to measure the accuracy of the trained classifier. Does scikit have any inbuilt function to check accuracy of knn classifier?</p>
  
  <pre><code>from sklearn.neighbors import KNeighborsClassifier
  knn = KNeighborsClassifier()
  knn.fit(training, train_label)    
  predicted = knn.predict(testing)
  </code></pre>
  
  <p>Appreciate all the help. Thanks</p>