Use a KNN-regression algorithm in R -
i working on using k nearest neighbours variable identified(test) determining value of same variable of individual value non-identified(test). 2 possible approaches can done then: first(easy one), calculate mean value of variable of k individuals; second(best one), calculate weighted distance value according proximity of individuals.
my first approach has been using knn.index function in fnn package identifying nearest neighbours, , using indexes, values in dataset mean. working slow, dataset quite big. there algorithm implemented calculation faster, , possible add weights according distance?
after week of trying solve problem, found function in r solving question, might others have strugled same issue.
the function named kknn, , in package kknn. lets knn regression, weigthing points distance.
Comments
Post a Comment