def test_perceptron_generated_data(self): train_dataset = generate_classified_points(classes=[True, False], n=20) perceptron = Perceptron(function=lambda x: x >= 0) perceptron.train(train_dataset) perceptron.plot(train_dataset) print train_dataset raw_input('Enter to continue')
def test_perceptron_generated_data_min_weights(self): train_dataset = generate_classified_points(classes=[True, False], n=20, distance=50) perceptron = Perceptron(function=lambda x: x >= 0) perceptron.train(train_dataset) perceptron.plot(train_dataset) perceptron.count_errors(train_dataset) raw_input('Enter to continue')