Displaying 20 results from an estimated 4000 matches similar to: "How do I make R randomForest model size smaller?"
2023 May 09
1
RandomForest tuning the parameters
Hi Sacha,
On second thought, perhaps this is more the direction that you want ...
X2 = cbind(X_train,y_train)
colnames(X2)[3] = "y"
regr2<-randomForest(y~x1+x2, data=X2,maxnodes=10, ntree=10)
regr
regr2
#Make prediction
predictions= predict(regr, X_test)
predictions2= predict(regr2, X_test)
HTH,
Eric
On Tue, May 9, 2023 at 6:40?AM Eric Berger <ericjberger at gmail.com>
2010 Jan 15
1
randomForest maxnodes
Has anyone sucessfully used the maxnodes feature in randomForest? I tried
setting it, but when it is non-NULL I always get back a forest in which all
trees have size 1. I am using a continuous response (regression). Any help
would be appreciated.
Thanks.
	[[alternative HTML version deleted]]
2010 Dec 11
1
randomForest: help with combine() function
I've built two RF objects (RF1 and RF2) and have tried to combine
them, but I get the following error:
Error in rf$votes + ifelse(is.na(rflist[[i]]$votes), 0, rflist[[i]]$votes) :
  non-conformable arrays
In addition: Warning message:
In rf$oob.times + rflist[[i]]$oob.times :
  longer object length is not a multiple of shorter object length
Both RF models use the same variables, although
2010 May 25
1
Need Help! Poor performance about randomForest for large data
Hi, dears,
I am processing some data with 60 columns, and 286,730 rows.
Most columns are numerical value, and some columns are categorical value.
It turns out that: when ntree sets to the default value (500), it says "can
not allocate a vector of 1.1 GB size"; And when I set ntree to be a very
small number like 10, it will run for hours.
I use the (x,y) rather than the (formula,data).
2023 May 08
1
RandomForest tuning the parameters
Dear R-experts,
Here below a toy example with some error messages, especially at the end of the code (Tuning the parameters). Your help to correct my R code would be highly appreciated.
#######################################
#libraries
library(lattice)
library(ggplot2)
library(caret)
library(randomForest)
??
#Data
2013 Mar 24
1
Random Forest, Giving More Importance to Some Data
Dear All,
I am using randomForest to predict the final selling price of some items.
As it often happens, I have a lot of (noisy) historical data, but the  
question is not so much about data cleaning.
The dataset for which I need to carry out some predictions are fairly  
recent sales or even some sales that will took place in the near future.
As a consequence, historical data should be somehow
2012 May 05
1
No Data in randomForest predict
I would like to ask a general question about the randomForest predict
function and how it handles No Data values.  I understand that you can omit
No Data values while developing the randomForest object, but how does it
handle No Data in the prediction phase?  I would like the output to be NA
if any (not just all) of the input data have an NA value. It is not clear
to me if this is the default or
2010 May 05
1
What is the default nPerm for regression in randomForest?
Could not find it in ?randomForest.
Thank you for your help!
-- 
Dimitri Liakhovitski
Ninah.com
Dimitri.Liakhovitski at ninah.com
2005 Mar 23
4
sampling from a mixture distribution
Dear R users,
I would like to sample from a mixture distribution p1*f(x1)+p2*f(x2). I 
usually sample variates from both distributions and weight them with their 
respective probabilities, but someone told me that was wrong. What is the 
correct way?
Vumani
2011 Dec 15
2
Random Forest Reading N/A's, I don't see them
After checking the original data in Excel for blanks and running Summary(cm3)
to identify any null values in my data, I'm unable to identify an instances.
Yet when I attempted to use the data in Random Forest, I get the following
error. Is there something that Random Forest is reading as null which is not
actually null? Is there a better way to check for this?
> library(randomForest)
>
2018 Mar 29
2
Pasar argunmentos string a una formula
Buenas
Tengo en un string guardado lo siguiente:
> parametros
[1] "ntree=10"  "ntree=30"  "ntree=50"  "ntree=100" "ntree=200"
Con un bucle for quiero ir metiendolo en el modelo, pero no se muy bien como hacerlo, ya que con deparse no me funciona, con get tampoco (obvio, no es un objeto), y no se muy bien como hacerlo de manera dinamica
2013 Feb 13
2
CARET: Any way to access other tuning parameters?
The documentation for caret::train shows a list of parameters that one can
 tune for each method classification/regression method. For example, for
the method randomForest one can tune mtry in the call to train. But the
 function call to train random forests in the original package has many
other parameters, e.g. sampsize, maxnodes, etc.
Is there **any** way to access these parameters using train
2011 Mar 07
2
use "caret" to rank predictors by random forest model
Hi,
I'm using package "caret" to rank predictors using random forest model and draw predictors importance plot. I used below commands:
rf.fit<-randomForest(x,y,ntree=500,importance=TRUE) 
## "x" is matrix whose columns are predictors, "y" is a binary resonse vector
## Then I got the ranked predictors by ranking
2018 Jan 22
2
Random Forests
Muchas gracias Carlos, como siempre.
Es raro que se me pasase. En su momento miré todos los argumentos del  
RF, como hago siempre, pero ese lo había olvidado. La verdad es que  
funcionaba estupendamente, pero me parecía extraño. Aunque dado que  
los RF no sobreajustan, no hay problema con que sus árboles sean todo  
lo grandes que quieras. Lo he testado con una base de datos externa y  
explica
2018 Jan 20
2
Random Forests
Si, Carlos. Yo hago lo mismo, pero esos mismos numeritos salen enormes.
> treesize(RFfit)
   [1] 4304 4302 4311 4319 4343 4298 4298 4311 4349 4327 4331 4317  
4294 4321 4283 4362
   [17] 4300 4330 4266 4331 4308 4352 4294 4315 4372 4349 4331 4347  
4329 4348 4298 4335
   [33] 4346 4396 4345 4313 4293 4276 4353 4272 4304 4325 4317 4336  
4308 4351 4374 4324
   [49] 4386 4359 4311 4346 4300
2005 Oct 11
1
a problem in random forest
Hi, there:
I spent some time on this but I think I really cannot figure it out, maybe I
missed something here:
my data looks like this:
> dim(trn3)
[1] 7361 209
> dim(val3)
[1] 7427 209
> mg.rf2<-randomForest(x=trn3[,1:208], y=trn3[,209], data=trn3, xtest=val3[,
1:208], ytest=val3[,209], importance=T)
my test data has 7427 observations but after prediction,
> dim(mg.rf2$votes)
2008 Mar 09
1
sampsize in Random Forests
Hi all,
I have a dataset where each point is assigned to a class A, B, C, or
D. Each point is also assigned to a study site. Each study site is
coded with a number ranging between 1-100. This information is stored
in the vector studySites.
I want to run randomForests using stratified sampling, so I chose the option
strata = factor(studySites)
But I am not sure how to control the number of
2018 May 31
2
predicciones sobre el OOB de randomForest
Gracias Carlos. No uso caret, pero lo miraré.
Quoting Carlos Ortega <cof en qualityexcellence.es>:
> Hola,
>
> Creo que si utilizas "caret" y en la función "trainControl()" defines "oob"
> como criterio de randomización, puedes luego recuperar del objeto del
> modelo, las predicciones individuales...
>
> Saludos,
> Carlos Ortega
>
2008 Jun 15
1
randomForest, 'No forest component...' error while calling Predict()
Dear R-users,
While making a prediction using the randomForest function (package
randomForest) I'm getting the following error message: 
"Error in predict.randomForest(model, newdata = CV) :  No forest component
in the object"
Here's my complete code. For reproducing this task, please find my 2 data
sets attached ( http://www.nabble.com/file/p17855119/data.rar data.rar ).
2013 Feb 03
3
RandomForest, Party and Memory Management
Dear All,
For a data mining project, I am relying heavily on the RandomForest and  
Party packages.
Due to the large size of the data set, I have often memory problems (in  
particular with the Party package; RandomForest seems to use less memory).  
I really have two questions at this point
1) Please see how I am using the Party and RandomForest packages. Any  
comment is welcome and useful.