I'm confusing myself :-)

randomForest cannot handle character vectors as predictors. (Which is why I,
to my surprise, found out that a categorical variable could not be used in
the function). It can handle categorical variables as predictors IF they are
put in as a factor.

Obviously they handle categorical variables as a response variable.

 I hope I'm not going to add up more mistakes, it's been enough for the
day...
Cheers
Joris

On Thu, May 27, 2010 at 2:08 PM, <steve_fried...@nps.gov> wrote:

> Joris,
>
> I've been following this thread for a few days as I am beginning to use
> randomForest in my work.  I am confused by your last email.
>
> What do you mean that randomForest does not handle categorical variables ?
>
> It can be used in either regression or classification analysis.  Do you
> mean that categorical predictors are not suitable? Certainly they are as
> the response.
> Would you be so kind, and clarify what you were suggesting.
>
> Thanks,
>
> Steve Friedman Ph. D.
> Spatial Statistical Analyst
> Everglades and Dry Tortugas National Park
> 950 N Krome Ave (3rd Floor)
> Homestead, Florida 33034
>
> steve_fried...@nps.gov
> Office (305) 224 - 4282
> Fax     (305) 224 - 4147
>
>
>
>             Joris Meys
>             <jorism...@gmail.
>             com>                                                       To
>             Sent by:                  abanero <gdevi...@xtel.it>
>             r-help-boun...@r-                                          cc
>             project.org               r-help@r-project.org
>                                                                   Subject
>                                       Re: [R] cluster analysis and
>             05/27/2010 07:56          supervised classification: an
>             AM                        alternative to knn1?
>
>
>
>
>
>
>
>
>
>
> Hi Abanero,
>
> first, I have to correct myself. Knn1 is a supervised learning algorithm,
> so
> my comment wasn't completely correct. In any case, if you want to do a
> clustering prior to a supervised classification, the function daisy() can
> handle any kind of variable. The resulting distance matrix can be used with
> a number of different methods.
>
> And you're right, randomForest doesn't handle categorical variables either.
> So I haven't been of great help here...
> Cheers
> Joris
>
> On Thu, May 27, 2010 at 1:25 PM, abanero <gdevi...@xtel.it> wrote:
>
> >
> > Hi,
> >
> > thank you Joris and Ulrich for you answers.
> >
> > Joris Meys wrote:
> >
> > >see the library randomForest for example
> >
> >
> > I'm trying to find some example in randomForest with categorical
> variables
> > but I haven't found anything. Do you know any example with both
> categorical
> > and numerical variables? Anyway I don't have any class labels yet. How
> > could
> > I  find clusters with randomForest?
> >
> >
> > Ulrich wrote:
> >
> > >Probably the simplest way is Affinity Propagation[...] All you need is a
> > way of measuring the similarity of >samples which is straightforward both
> > for numerical and categorical variables.
> >
> > I had a look at the documentation of the package apcluster. That's
> > interesting but do you have any example using it with both categorical
> and
> > numerical variables? I'd like to test it with a large dataset..
> >
> > Thanks a lot!
> > Cheers
> >
> > Giuseppe
> >
> > --
> > View this message in context:
> >
>
> http://r.789695.n4.nabble.com/cluster-analysis-and-supervised-classification-an-alternative-to-knn1-tp2231656p2232950.html
>
> > Sent from the R help mailing list archive at Nabble.com.
> >
> > ______________________________________________
> > R-help@r-project.org mailing list
> > 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.
> >
>
>
>
> --
> Joris Meys
> Statistical Consultant
>
> Ghent University
> Faculty of Bioscience Engineering
> Department of Applied mathematics, biometrics and process control
>
> Coupure Links 653
> B-9000 Gent
>
> tel : +32 9 264 59 87
> joris.m...@ugent.be
> -------------------------------
> Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php
>
>              [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@r-project.org mailing list
> 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.
>
>
>


-- 
Joris Meys
Statistical Consultant

Ghent University
Faculty of Bioscience Engineering
Department of Applied mathematics, biometrics and process control

Coupure Links 653
B-9000 Gent

tel : +32 9 264 59 87
joris.m...@ugent.be
-------------------------------
Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
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.

Reply via email to