Displaying 1 result from an estimated 1 matches for "genetrain".
Did you mean:
generaion
2007 Aug 08
0
ksvm-kernel
...ting the following sentences
library(kernlab)
# identity kernel
k <- function(x,y) {
n<-length(x)
cont<-0
for(i in 1:n){
if(x[i]==y[i]){
cont<-cont+1
}
}
cont
}
class(k) <- "kernel"
data(promotergene)
ind <- sample(1:dim(promotergene)[1],20)
genetrain <- promotergene[-ind, -1]
genetest <- promotergene[ind,-1 ]
kx <- kernelMatrix(k, as.matrix(genetrain))
y<-as.vector(promotergene[-ind,1 ])
#y<-as.factor(promotergene[-ind,1 ])
y
gene1 <- ksvm(kx, y, type="C-svc")
gene1
genetype <- predict(gene1,genetest)
Error en as...