[R] Unusual behavior in e1071?

Uwe Ligges ligges at statistik.tu-dortmund.de
Tue May 2 17:33:56 CEST 2017


Look more carefully at y. If this is a factor, please note what is the 
first (reference) level and what the second. This determines the rule, 
not the value of the first observation.

Best,
Uwe Ligges

On 02.05.2017 07:25, Daniel Jeske wrote:
> Hello -
>
> I have noticed that when I run svm() the order of my data matters.  If the
> first case in the data frame has y=+1 I get the expected decision rule that
> says to classify as +1 if f(x)>0.  However, if the first case in the data
> frame has y=-1 then apparently the decision rule being used says to
> classify as +1 if f(x)<0, and in this case all the coefficients are
> negative of their values compared to the first case.  So the two
> classification rules are equivalent, but is a user really supposed to know
> the difference?  It is likely they would assume the decision rule is always
> to classify as +1 if f(x)>0.  Does anyone think the behavior I have noticed
> is as intended, or is otherwise benign?
>
> Thank you,
> Daniel Jeske
> Professor
> Department of Statistics
> University of California - Riverside
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list