What does a leaf size of 1 in K-neighbors regression mean?

I am doing hyperparameter tuning + cross validation and I'm constantly getting that the optimal size of the leaf should be 1. Should I worry? Is this a sign of overfitting?

Topic k-nn hyperparameter-tuning cross-validation scikit-learn

Category Data Science


leaf_size should have zero effect on the performance of the model. Its effect is on construction of the lookup object, which affects training and prediction time, but not the results.

The best parameters are probably just breaking ties by value of this parameter, so the smallest is chosen. You can inspect the GridSearchCV attribute cv_results_ to be sure. It should also contain training and prediction times, which might inform what value you ultimately want to select.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.