I'm using pythons sklenar KNeighborsRegressors and getting an error about missing data ("Input contains NaN, infinity or a value too large for dtype"). In the case of my dataset, missing data actually means something very significant, so I can't replace the nans by forward-filling or using the mean or anything like that. So I have to keep the blank data somehow. Is there any way to make sklearn's K neighbors allow that blank data?
Obviously, it's not clear what being "near" nan means, but I'd like to define that as infinite distance, so that values only match that neighbor if they are also nan. Is there any way to make sklearn do that? I thought about maybe replacing the nans with some gigantic value (like 9999999999999999999999) that's so far away from every value that it looks infinite, but maybe there's a better way?