每个坐标(x,y)对应一个索引。例如:(0,0)具有索引0 AND(1,0)具有索引1。
X <-c(0,1,1,0,-1,-1,-1,0,1,2,2,2,2,1,0,-1,-2)
Y <- c(0,0,1,1,1,0,-1,-1,-1,-1,0,1,2,2,2,2,2)
Z<- as.factor(0:16)
df <- data.frame(X,Y,Z)
library(e1071)
model <- svm(Z ~ X+Y, xyz, kernel = "radial")
predict(model, xyz[1:4,1:2]) #1.647681 3.859354 5.908940 4.151374
# From the last code, it appears that it does not predict well for its own data
对应于(12,-22)的索引是什么?