MCPcopy Index your code
hub / github.com/rushter/MLAlgorithms / test_svm_classification

Function test_svm_classification

mla/tests/test_classification_accuracy.py:57–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55
56
57def test_svm_classification():
58 y_signed_train = (y_train * 2) - 1
59 y_signed_test = (y_test * 2) - 1
60
61 for kernel in [RBF(gamma=0.05), Linear()]:
62 model = SVM(max_iter=500, kernel=kernel)
63 model.fit(X_train, y_signed_train)
64 predictions = model.predict(X_test)
65 assert accuracy(y_signed_test, predictions) >= 0.8
66
67
68def test_mlp():

Callers

nothing calls this directly

Calls 6

fitMethod · 0.95
RBFClass · 0.90
LinearClass · 0.90
SVMClass · 0.90
accuracyFunction · 0.90
predictMethod · 0.45

Tested by

no test coverage detected