MCPcopy Index your code
hub / github.com/clips/pattern / test_knn

Method test_knn

test/test_vector.py:880–888  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

878 self.assertTrue(F >= 0.89)
879
880 def test_knn(self):
881 # Assert nearest-neighbor classification.
882 self._test_classifier(vector.KNN, k=10, distance=vector.COSINE)
883 # Assert the accuracy of the classifier.
884 A, P, R, F = vector.KNN.test(self.model, folds=10, k=2, distance=vector.COSINE)
885 #print A, P, R, F
886 self.assertTrue(P >= 0.92)
887 self.assertTrue(R >= 0.92)
888 self.assertTrue(F >= 0.92)
889
890 def test_svm(self):
891 try:

Callers

nothing calls this directly

Calls 2

_test_classifierMethod · 0.95
testMethod · 0.80

Tested by

no test coverage detected