def test4(data, labels, test_data, sigma): """Batch test of kernel perceptron""" p4 = KP(data, labels) it, err = p4.train_batch(sigma) print "Iterations:", it print "Error:", err p4.label_test(test_data, sigma) return
def test3(data, labels, sigma): """Online test of kernel perceptron""" p3 = KP(data, labels) right, wrong, error = p3.train_online(sigma) print "Right:", right print "Wrong:", wrong print "Error:", error return