# NOT RUN {
# simple example: regression of sinus curve
x <- seq(0,1,by=.01)
y <- sin(x*10)
a <- lapply(1:5, function(i)getSolution(model <- lsSVM(x,y,d=1), 1,1,i))
plot(x,y,type='l',ylim=c(-5,5));
for(i in 1:5) lines(coeff~samples, data=a[[i]],col=i)
# a more typical example
banana <- liquidData('banana-mc')
model <- mcSVM(Y~.,banana$train,d=1)
# task 4 is predicting 2 vs 3, there is only cell 1 here
solution <- getSolution(model,task=4,cell=1,fold=1)
supportvecs <- solution$samples
# we are considering task 4 and hence only show labels 2 and 3:
bananaSub <- banana$train[banana$train$Y %in% c(2,3),]
plot(bananaSub[,-1],col=bananaSub$Y)
points(supportvecs,pch='x',cex=2)
# }
Run the code above in your browser using DataLab