[R] The formula interface of SVM

Steve Lianoglou mailinglist.honeypot at gmail.com
Mon Jul 12 05:26:19 CEST 2010


Hi,

On Sun, Jul 11, 2010 at 7:11 PM, Amy Hessen <amy_4_5_84 at hotmail.com> wrote:
>
> Hi
> Could you please explain the line that I got from the documentation of R? does it mean that there is a difference between using  and not using the formula interface with SVM ?:
> If the predictor variables include factors, the formula interface must be used to get a correct model matrix.

It might have something to do with the fact that one would "expand"
factors into a set of dummy variables (that can take either a 1, or 0
value) in order to encode all of the levels of the factors into
different variables.

You could do this yourself without using the formula, but you would
then have to manually expand (column wise) your data to encode the
vars yourself where as the formula interface does this for you?

(I don't know that for sure, I'm just guessing from that sentence you
mention -- look at the source code of the function in order verify
this for yourself)

Here's a ref:

http://dss.princeton.edu/online_help/analysis/dummy_variables.htm

You can google about using nominal/categorical variables to learn more.

-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact



More information about the R-help mailing list