[BioC] enquiry about errorest with model-knn

Liaw, Andy andy_liaw at merck.com
Fri Jan 7 18:50:18 CET 2005


The function knn() has no formula interface nor a predict() function (for
good reasons), which errorest() requires, as said in the `Details' section
of ?errorest:

Any model can be specified as long as it is a function with arguments
model(formula, data, subset, na.action, ...). If a method
predict.model(object, newdata, ...) is available, predict does not need to
be specified. However, predict has to return predicted values in the same
order and of the same length corresponding to the response. See the examples
below. 

Andy

> From: Liu, Xin
> 
> Dear all,
> 
> Can somebody give me a clue why I always get the following error?
> 
> errorest(Species ~ ., data = iris, model = knn, estimator = "cv")$err
> 
> Error in model(formula, data = folddata, ...) : 
>         unused argument(s) (data ...)
> 
> Xin LIU
> 
> This e-mail is from ArraDx Ltd
> 
> The e-mail and any files transmitted with it are 
> confidentia...{{dropped}}
> 
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> 
>



More information about the Bioconductor mailing list