The issue is that kknn::predict.train.kknn() only respects some of the parameters originally passed to train.kknn(), but not all. scale, na.action, ykernel and contrasts aren't passed along to kknn() inside kknn::predict.train.kknn().
A fix would involve parsing the $call entry of the train.kknn-object more carefully.
predict.train.kknn() does not respect all parameters passed to train.kknn(). An example is
scale
.For example, predicting with
scale = FALSE
andscale = TRUE
withtrain.kknn()
give the same results:But
kknn()
correctly shows a slight difference:The issue is that
kknn::predict.train.kknn()
only respects some of the parameters originally passed totrain.kknn()
, but not all.scale
,na.action
,ykernel
andcontrasts
aren't passed along tokknn()
insidekknn::predict.train.kknn()
.A fix would involve parsing the
$call
entry of thetrain.kknn
-object more carefully.See also this SO question.