I'm still a beginner in machine learning and I wanted to do a simple test today with scikit-learn and I couldn't achieved what I expected. I created a dataset in which one column are natural numbers and the other column is whether the number is even or odd, I mean, only 0 or 1. Then I tried several different algorithms and I couldn't predict correctly the output for numbers different than those in the dataset. My question would be this: which algorithms could be useful for this purpose??? I thought for instance Logistic Regression could do the trick or KNN classifier, I'm starting to learn Machine Learning and felt very disappointed that this simple thing didn't work...
Best regards