[R] Nominal variables in SVM?
Bernd Bischl
bernd_bischl at gmx.net
Wed Aug 12 23:09:09 CEST 2009
Noah Silverman wrote:
> That makes sense.
>
> I my data is already nominal, I need to "expand" a single column into
> several binary ones.
>
> Is there an easy function to do this in R, or do I need to create
> something from scratch? (If I have to create my own, any suggestions?)
>
> Thanks!
>
> -N
Hi Noah,
read up on the "contrasts" and the "model.matrix" functions.
Although if you use the kernlab package for SVMs, factors get treated in
this way by default, you just need to use the formula interface.
Bernd
More information about the R-help
mailing list