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

Method test_svm

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

Source from the content-addressed store, hash-verified

888 self.assertTrue(F >= 0.92)
889
890 def test_svm(self):
891 try:
892 from pattern.vector import svm
893 except ImportError, e:
894 print e
895 return
896 # Assert support vector classification.
897 self._test_classifier(vector.SVM, type=vector.SVC, kernel=vector.LINEAR)
898 # Assert the accuracy of the classifier.
899 A, P, R, F = vector.SVM.test(self.model, folds=10, type=vector.SVC, kernel=vector.LINEAR)
900 #print A, P, R, F
901 self.assertTrue(P >= 0.93)
902 self.assertTrue(R >= 0.93)
903 self.assertTrue(F >= 0.93)
904
905 def test_liblinear(self):
906 # If LIBLINEAR can be loaded,

Callers

nothing calls this directly

Calls 2

_test_classifierMethod · 0.95
testMethod · 0.80

Tested by

no test coverage detected