While the method of preventing self-neighbors implied by 'ignore_first' will work most of the time, it fails to account for the case when there are two equal feature vectors with different targets (rating being imputed). In this case, the self and the identical neighbor will be the same distance away from self and we might make the self a neighbor rather than the identical neighbor and thus consider contribute a zero rating to the aggregator rather than something useful.
An easy fix is to instead set all the diagonal elements of the distance matrix to infinity.
While the method of preventing self-neighbors implied by 'ignore_first' will work most of the time, it fails to account for the case when there are two equal feature vectors with different targets (rating being imputed). In this case, the self and the identical neighbor will be the same distance away from self and we might make the self a neighbor rather than the identical neighbor and thus consider contribute a zero rating to the aggregator rather than something useful.
An easy fix is to instead set all the diagonal elements of the distance matrix to infinity.