Reputation: 117
I have a data set(train2) with 79 variables(numeric and text combined) and the SalePrice as the last column. I am trying to create a randomForest model, this is what I get as an error:
Forest <- randomForest(SalePrice~., data = train2, na.action = TRUE)
Error in model.frame.default(formula = SalePrice ~ ., data = train2, na.action = TRUE) :
attempt to apply non-function
Do you have any idea how I can solve this error?
Upvotes: 0
Views: 237
Reputation: 64
@joran is correct. I also want to steer you in the direction of exploring these two:
ntree Number of trees to grow. This should not be set to too small a number, to ensure that every input row gets predicted at least a few times.
mtry Number of variables randomly sampled as candidates at each split. Note that the default values are different for classification (sqrt(p) where p is number of variables in x) and regression (p/3)
Upvotes: 1