Made KdTreeNN default for nearest neighbor search
Fixed pca matching error average calculation