Knn error message


I’m currently running k parameter tests on L2A resampled to 10m classification and wanting to test 1-16, all other values work however there is an error message with k=…

Has anyone else experienced this?

Many thanks

The number of neighbours must be greater than 1.

The range syntax is as follows.

( = exluding the value
] = including the value
* = max value (depending on the data type)

This should actually be explained in the error message. I’ve created an issue for it.

Thank you so much @marpet! And thank you for clearing the issue.
May I ask why it can’t be run with just a single nearest neighbour?

This needs to be answered by someone else. I don’t know the algorithm.
Mayb @lveci can explain it.

Thanks @marpet :slight_smile: