knnRSquared Issues
Opened this issue · 1 comments
Hi, nice blog post but how you interpret the differences in Rsquare between R and Python?
I looked at how you defined the knnRSquared function and found some issues (however should not be the cause of concern in this case).
First, inside an R function you should not use a global variable, in your case test.Y is not an argument nor defined inside the function. It should be y. Second, the optional argument yhat=knn$pred has a default value that assume that an object called knn exists and has a pred elements. But this may not be the case in general.
Luca - Will look into it. It is possible that some of the environmental variables came into the function as the function was made as an afterthought. I will check and correct it. Thanks!
Regards
Ganesh