[R] randomForest - classifier switch

From: Stephen Choularton <mail_at_bymouth.com>
Date: Wed 04 Jan 2006 - 07:22:41 EST


Hi  

I am trying to use randomForest for classification. I am using this code:  

> set.seed(71)
> rf.model <- randomForest(similarity ~ ., data=set1[1:100,],
importance=TRUE, proximity=TRUE)
Warning message:
The response has five or fewer unique values. Are you sure you want to do regression? in: randomForest.default(m, y, ...)
> rf.model
 

Call:
 randomForest(x = similarity ~ ., data = set1[1:100, ], importance =

TRUE,      proximity = TRUE) 
               Type of random forest: regression
                     Number of trees: 500
No. of variables tried at each split: 10  
          Mean of squared residuals: 0.1159130
                    % Var explained: 50.8

>
 

As you can see I get a regression model. How can I make sure I get a classification model?  

Thanks .  

Stephen

-- 



2/01/2006
 

	[[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
Received on Wed Jan 04 07:32:08 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:41:46 EST