KNN classifier

Hello to everyone,

I have an issue with the KNN classifier. When I apply this classifier over a larger area, I only get 3 classes as a result (including ‘no data’ with a value of -1) instead of 12 classes. It works correctly over a smaller area (10km x 10km) and with 5 satellite images, then it takes around 22 minutes and yields normal results. But when it operates over a large area (110km x 110km) and with 5 satellite images, it takes around 27 hours and produces poor results.

Just to add, the same parameters were used during both classification: channels, training polygons, number of training samples, and number of neighbours.

Thank you in advance for your assistance.

KNN is very computationally expensive with large number of pixels and input features:

…you can try reducing the number of input images from 5 to 2 or 3 by running PCA.