Completed perceptron and kmeans.