[BioC] enquiry about errorest with model-knn

Holger Schwender holger.schw at gmx.de
Fri Jan 7 18:50:03 CET 2005


Hi Xin,

first of all you must replace knn by ipredknn. Then you have to write your
own predict function (see the help of errorest in the ipred package).

Something like 

> mypredict.knn <- function(object, newdata)
 +     predict(object, newdata = newdata,type="class")

should work. Then your knn analysis can be done by

> errorest(Species ~ ., data = iris, model = ipredknn, estimator = "cv",  
+ predict=mypredict.knn)

By the way, this is actually a question for the R help and not for the BioC
help.

Best,
Holger

> 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
> 

-- 
+++ Sparen Sie mit GMX DSL +++ http://www.gmx.net/de/go/dsl
AKTION für Wechsler: DSL-Tarife ab 3,99 EUR/Monat + Startguthaben



More information about the Bioconductor mailing list