Python implementation of KNN(K nearest neighbors) and rule based learning