Hi, I am trying to print out my confusion matrix after having created my random forest. I have put in this command: fit<-randomForest(MMS_ENABLED_HANDSET~.,data=dat,ntree=500,mtry=14, na.action=na.omit,confusion=TRUE) but I can't get it to give me the confusion matrix, anyone know how this works? Thansk! Ruben [[alternative HTML version deleted]]
Rubin, just type "fit" or print(fit). "confusion = TRUE" will not be recognized by randomForest. If you are not seeing the confusion matrix, MMS_ENABLED_HANDSET is not a factor and, thus, a regression fit is being done, not classification as you apparently desire. On 4/22/07, Ruben Feldman <frubeng@gmail.com> wrote:> > Hi, > > I am trying to print out my confusion matrix after having created my > random > forest. > I have put in this command: > fit<-randomForest(MMS_ENABLED_HANDSET~.,data=dat,ntree=500,mtry=14, > na.action=na.omit,confusion=TRUE) > but I can't get it to give me the confusion matrix, anyone know how this > works? > > Thansk! > > Ruben > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@stat.math.ethz.ch 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. >-- HTH, Jim Porzak San Francisco, CA http://www.linkedin.com/in/jimporzak [[alternative HTML version deleted]]
Hi R-wizards, I ran a random forest on a dataset where the response variable had two possible values. It returned a warning telling me that it did regression and if that was really what I wanted. Does anybody know what is being in terms of the algorithm when it does a regression? (the random forest is used as a regression, how does that work?) Thanks for your time! Ruben [[alternative HTML version deleted]]
Ruben, Maybe your binary response is a numeric vector - try converting it into a factor with two levels. You probably want classification rather than regression (the dependent variable should be numeric and continous)! Arne>-----Original Message----- >From: r-help-bounces at stat.math.ethz.ch >[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Ruben Feldman >Sent: Monday, April 23, 2007 10:28 AM >To: r-help at stat.math.ethz.ch >Subject: [R] Random Forest > >Hi R-wizards, > >I ran a random forest on a dataset where the response variable >had two possible values. It returned a warning telling me that >it did regression and if that was really what I wanted. >Does anybody know what is being in terms of the algorithm when >it does a regression? (the random forest is used as a >regression, how does that work?) > >Thanks for your time! > >Ruben > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at stat.math.ethz.ch 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. >
Hi, Ruben: fit$confusion if you provide your test data, then you can also access the confusion matrix of test data by fit$test$confusion there are details of how to use randomForest by reading: ?randomForest HTH, Weiwei On 4/22/07, Ruben Feldman <frubeng at gmail.com> wrote:> Hi, > > I am trying to print out my confusion matrix after having created my random > forest. > I have put in this command: > fit<-randomForest(MMS_ENABLED_HANDSET~.,data=dat,ntree=500,mtry=14, > na.action=na.omit,confusion=TRUE) > but I can't get it to give me the confusion matrix, anyone know how this > works? > > Thansk! > > Ruben > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch 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. >-- Weiwei Shi, Ph.D Research Scientist GeneGO, Inc. "Did you always know?" "No, I did not. But I believed..." ---Matrix III
Dear all R gurus, I am really sorry if my query embraces anyone. Can anyone give me some introductory papers or suggestions about what Random Forest is? Thanks and regards, ----- Original Message ---- From: Weiwei Shi <helprhelp@gmail.com> To: Ruben Feldman <frubeng@gmail.com> Cc: r-help@stat.math.ethz.ch Sent: Monday, April 23, 2007 8:56:29 PM Subject: Re: [R] Random Forest Hi, Ruben: fit$confusion if you provide your test data, then you can also access the confusion matrix of test data by fit$test$confusion there are details of how to use randomForest by reading: ?randomForest HTH, Weiwei On 4/22/07, Ruben Feldman <frubeng@gmail.com> wrote:> Hi, > > I am trying to print out my confusion matrix after having created my random > forest. > I have put in this command: > fit<-randomForest(MMS_ENABLED_HANDSET~.,data=dat,ntree=500,mtry=14, > na.action=na.omit,confusion=TRUE) > but I can't get it to give me the confusion matrix, anyone know how this > works? > > Thansk! > > Ruben > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@stat.math.ethz.ch 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. >-- Weiwei Shi, Ph.D Research Scientist GeneGO, Inc. "Did you always know?" "No, I did not. But I believed..." ---Matrix III ______________________________________________ R-help@stat.math.ethz.ch 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. [[alternative HTML version deleted]]
Dear all R gurus, I am really sorry if my query embraces anyone. Can anyone give me some introductory papers or suggestions about what Random Forest is? Thanks and regards, ----- Original Message ---- From: Weiwei Shi <helprhelp@gmail.com> To: Ruben Feldman <frubeng@gmail.com> Cc: r-help@stat.math.ethz.ch Sent: Monday, April 23, 2007 8:56:29 PM Subject: Re: [R] Random Forest Hi, Ruben: fit$confusion if you provide your test data, then you can also access the confusion matrix of test data by fit$test$confusion there are details of how to use randomForest by reading: ?randomForest HTH, Weiwei On 4/22/07, Ruben Feldman <frubeng@gmail.com> wrote:> Hi, > > I am trying to print out my confusion matrix after having created my random > forest. > I have put in this command: > fit<-randomForest(MMS_ENABLED_HANDSET~.,data=dat,ntree=500,mtry=14, > na.action=na.omit,confusion=TRUE) > but I can't get it to give me the confusion matrix, anyone know how this > works? > > Thansk! > > Ruben > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@stat.math.ethz.ch 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. >-- Weiwei Shi, Ph.D Research Scientist GeneGO, Inc. "Did you always know?" "No, I did not. But I believed..." ---Matrix III ______________________________________________ R-help@stat.math.ethz.ch 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. [[alternative HTML version deleted]]