Answer the question
In order to leave comments, you need to log in
How to check if there is a vector in a matrix in R?
I play with Fisher's irises in R, I wrote a kNN classifier for one point and now I decided to write a cycle that would classify each point on the graph, I used this construction
xl <- iris[, 3:5]
for (i in seq(0.8,7.5,by=0.1)){
for (j in seq(-1,3.5,by=0.1)){
z <- c(i, j)
class <- kNN(xl, z, k=6)
points(z[1], z[2], pch = 21, bg = "white", col=colors[class], asp = 1)
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question