Is there an algorithm that imputes missing values based on n nearest columns? (KNN hybrid) I have a dataset of 70 columns that have missing values. Each column has a few columns (3-5) that it is significantly more correlated than the others but each column's correlated columns are very different from other columns. I would like to perform a tweaked version of KNN imputation and before I start writing this from scratch, I'd like to know if there's something similar out there, So, I don't go about reinventing the wheel.
On initialization, a correlation matrix is obtained between all the variables. For every missing cell that needs to be imputed, the algorithm retrieves from the correlation matrix the top n highest correlated columns and uses only those N columns to select the k nearest neighbors and use the mean value of those neighbors.
Thanks and apologies if I am not very clear with my question. I'll try to clarify if you have any doubts.
You can extend scikit-learn's sklearn.impute.KNNImputer. The metric parameter can accept the custom function you described.