Add initial code for KNN using MEM coeff.