[R] "ipredknn" - How may I find values?

Grzes gregorio99 at gmail.com
Tue Oct 27 11:02:28 CET 2009


Hi everybody!

I want to find a closer neighbourins observation. This is my code:
##########################
library(klaR)
library(ipred)
library(mlbench)
data(PimaIndiansDiabetes2)
dane=na.omit(PimaIndiansDiabetes2)[,c(2,5,9)]
dane[,2]=log(dane[,2])
dane[,1:2]=scale(dane[,1:2])
zbior.uczacy=sample(1:nrow(dane),nrow(dane)/2,F)

klasyfikatorKNN=ipredknn(diabetes~glucose+insulin,data=dane,subset=zbior.uczacy,k=3)

oceny=predict(klasyfikatorKNN,dane[-zbior.uczacy,],"class")
 
#data frames with my result from klasyfikatorKNN
df=data.frame(glucose=c(klasyfikatorKNN$learn$X[,1]),insulin=klasyfikatorKNN$learn$X[,2],diabetes=c(klasyfikatorKNN$learn$y))
#And picture
drawparti(as.factor(df$diabetes), df$glucose, df$insulin, method = "sknn",
prec = 100, xlab = NULL, ylab = NULL) 

########################## 
My question is:  How or where may I find correct or wrong values which were
drawn (found,classification) in this picture? It means I'm looking for  x, y
values.


-- 
View this message in context: http://www.nabble.com/%22ipredknn%22---How-may-I-find-values--tp26074994p26074994.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list