Error rate of this classifier: 0.1
The best k is when k=8, I found the accuracy became 1.00.
In the part of cross validation, I used the package from sklearn.model_selection and I import cross_val_score.
I create those 3 models by using sklearn with the default parameters.
The accuracy of the KNN is 0.98692810457516345
The accuracy of the SVM is 0.97344771241830064
The accuracy of the Logic Regression is 0.98039215686274517
In the second part, I try the logistic Regression and the svm. For thosse three models, I use the cross-valid in sklearn. Compare those three models, I found that the KNN is the best model. Because in this case, the iris in the space is not complexe. So when I run the KNN, it use the distance and it could eaily find k nearest neighbors, and it could find the correct label. For the logistic regression, I choose the multi_class, because in this case, we have 3 different labels. But I still don't know why KNN is the best model, and SVM doesn't work very well in this case.
There is a graph about comparing those 3 models in the notebook file.