Now supporting several different distance-weighting schemes (gaussian, lasso, theshold)