Machine-Learning Implementing, training, and testing a simple Perceptron (single-layer neural network)