def test2(data, labels, test_data): """Batch test of linear perceptron""" p2 = LP() it, err = p2.train_batch(data, labels) print "Iterations:", it print "Error:", err p2.label_test(test_data) return
def test1(data, labels): """Online test of linear perceptron""" p1 = LP() right, wrong, error = p1.train_online(data, labels) print "Right:", right print "Wrong:", wrong print "Error:", error return