Finished code to get training and testing data and run the perceptron