Skip to content

svm plot question

3 messages · Aimin Yan, David Meyer

#
Aimin:

1) Please do not spam the r-help list---one request per issue (and two
private mails to the code author) really suffice. Not all contributors
to the R-project are on-line 24/24, and have time to provide immediate
answers.

2) The error occurs because plot.svm() currently does not set valid
defaults for categorical dimensions you are conditioning on for your
2D-plot (in your example: 'P' and 'Aa') which certainly is a bug. I will
commit a fix for the next release of e1071. For the time being, you will
have to explicitly specify the levels of 'P' and 'Aa':

plot(m.svm,p5.new,As~Cur, slice = list(P = factor("821p", levels =
levels(P)), Aa = factor("ALA", levels = levels(Aa))))

(Note that the defaults for the "slice" argument are completely
arbitrary anyway).

Thanks for pointing this out,

David
Aimin Yan wrote:

  
    
#
thanks, I did get this plot.
Before I have this problem, I did get a plot by my code.
However after I change a little my code. it doesn't work.
It is pity not saving my original code.

Now the question is the plot I get using your code is different from
what I got before.
Moreover I did remember I use plot(m.svm,p5.new,As~Cur)

Do you know why?

Thanks,

Aimin
At 06:32 AM 12/8/2006, David Meyer wrote:
#
Aimin:

hard to tell. IMO, without specifying defaults, it could only work with
purely numeric data since factors were wrongly processed.

David.
Aimin Yan wrote: