Hi all, I'm trying to plot an svm model and I'm the following error:> plot(model, data= dados[,-1], formula=formula(dados[,2]~dados[,3]),svSymbol = 1, dataSymbol = 2, symbolPalette = rainbow(4),color.palette = terrain.colors)Error in terms.default(x) : no terms component Anyone knows how to solve this??? Best regards, Pedro Marques
> I'm trying to plot an svm model and I'm the following error: > > > plot(model, data= dados[,-1], formula=formula(dados[,2]~dados[, > 3]),svSymbol = 1, dataSymbol = 2, symbolPalette = rainbow(4),color. > palette = terrain.colors) > Error in terms.default(x) : no terms component > > Anyone knows how to solve this???Asking the same question over and over again doesn't make it easier for us to help you. Also, it is good form to point out which package you are using (I presume this is svm in package e1071). Please can you provide a reproducible example? (We don't have access to the dados data.) In the meantime, try typing traceback() after you get the error to see where the problem is. Or, even better, install the debug package and step through your code using mtrace. Regards, Richie. Mathematical Sciences Unit HSL ------------------------------------------------------------------------ ATTENTION: This message contains privileged and confidential inform...{{dropped:20}}
Pedros: if you have more than two explanatory variables, the plot.svm() function plots a slice out of the input space, i.e., you have to specify the two variables that are plot on the x and y axis. The example on the help page tells you how: plot(model, data= dados[,-1], formula=dados[,2]~dados[,3]) should work, choosing all other coordinates except the 2nd and 3rd to be 0 (default). Best David ------------------ > I'm trying to plot an svm model and I'm the following error: > > >> > > plot(model, data= dados[,-1], formula=formula(dados[,2]~dados[, > > 3]),svSymbol = 1, dataSymbol = 2, symbolPalette = rainbow(4),color. > > palette = terrain.colors) > > Error in terms.default(x) : no terms component > > > > Anyone knows how to solve this???
> Thank you so much for replying and sorry for asking so many times.. > My data is just like the example in plot.svm (package e1071) of Iris > data of library MASS, difference is I have 7 classes 13 variables > and 30000 observations.. I've tried the codes as in that example but > still I got this error..> > > plot(model, data= dados[,-1], formula=formula(dados[,2]~dados[, > > 3]),svSymbol = 1, dataSymbol = 2, symbolPalette = rainbow(4),color. > > palette = terrain.colors)Having had another look at this. you problem is with the formula component. You don't need to use the formula function, just specify something like formula=dados[,2]~dados[,3] Regards, Richie. Mathematical Sciences Unit HSL ------------------------------------------------------------------------ ATTENTION: This message contains privileged and confidential inform...{{dropped:20}}