Displaying 20 results from an estimated 10000 matches similar to: "Dump decision trees of randomForest object"
2008 Oct 08
0
[randomForest]: display decision trees
Hi,
I'm using the package randomForest to generate a classifier for the exemplary
iris data set:
data(iris)
iris.rf<-randomForest(Species~.,iris)
Is it possible to print all decision trees in the generated forest?
If so, can the trees be also written to disk?
What I actually need is to translate the decision trees in a random forest
into equivalent C++ if-then-else constructs to
2007 Apr 29
1
randomForest gives different results for formula call v. x, y methods. Why?
Just out of curiosity, I took the default "iris" example in the RF
helpfile...
but seeing the admonition against using the formula interface for large data
sets, I wanted to play around a bit to see how the various options affected
the output. Found something interesting I couldn't find documentation for...
Just like the example...
> set.seed(12) # to be sure I have
2005 Sep 08
2
Re-evaluating the tree in the random forest
Dear mailinglist members,
I was wondering if there was a way to re-evaluate the
instances of a tree (in the forest) again after I have
manually changed a splitpoint (or split variable) of a
decision node. Here's an illustration:
library("randomForest")
forest.rf <- randomForest(formula = Species ~ ., data
= iris, do.trace = TRUE, ntree = 3, mtry = 2,
norm.votes = FALSE)
# I am
2010 May 17
1
Help with RandomForest
I'm working with the randomForest package and have successfully build a
model. I'd like to go one step further however, and use the output from
the model to construct a map using the output. My input data are spatial,
and I have an independent set of rasterize maps for each of the predictor
variables, to map the classification solution.
Using the getTree function:
>
2008 Jun 17
1
Decision Trees RWeka
Hello,
I have a question concerning decision
trees coming from RWeka :
library(RWeka)
m =J48(Species~.,data=iris)
How could such a decision tree be transferred
into a matrix, pretty much in the same fashion,
as it is done by getTree() in library(ofw)
library(ofw)
data(srbct)
attach(srbct)
##ofwCART
learn.cart.keep <- ofw(srbct,
2008 Jul 20
1
confusion matrix in randomForest
I have a question on the output generated by randomForest in classification
mode, specifically, the confusion matrix. The confusion matrix lists the
various classes and how the forest classified each one, plus the
classification error. Are these numbers essentially averages over all the
trees in the forest? If so, is there a way I can get the standard deviation
values out of the randomForest,
2005 Aug 26
2
problem with certain data sets when using randomForest
Hi,
Since I've had no replies on my previous post about my
problem I am posting it again in the hope someone
notice it. The problem is that the randomForest
function doesn't take datasets which has instances
only containing a subset of all the classes. So the
dataset with instances that either belong to class "a"
or "b" from the levels "a", "b" and
2010 Apr 25
1
randomForest predictions with new data
Hi
I am new to R, randomForest and I have read about how to use it in your old
mails. I have also run the predictions examples from CRAN. But I still don't
understand how to use it right.
The thing that I don't understand is how to run the result from the
randomForest on one line (post) with newdata to get a good guess. What I
mean is if I put in a new observation of iris how do I
2013 Oct 15
1
randomForest: Numeric deviation between 32/64 Windows builds
Dear R Developers
I'm using the great randomForest package (4.6-7) for many projects and recently stumbled upon a problem when I wrote unit tests for one of my projects:
On Windows, there are small numeric deviations when using the 32- / 64-bit version of R, which doesn't seem to be a problem on Linux or Mac.
R64 on Windows produces the same results as R64/R32 on Linux or Mac:
>
2005 Oct 27
1
Repost: Examples of "classwt", "strata", and "sampsize" i n randomForest?
"classwt" in the current version of the randomForest package doesn't work
too well. (It's what was in version 3.x of the original Fortran code by
Breiman and Cutler, not the one in the new Fortran code.) I'd advise
against using it.
"sampsize" and "strata" can be use in conjunction. If "strata" is not
specified, the class labels will be used.
2005 Jan 06
1
different result from the same errorest() in library( ipred)
Dear all,
Does anybody can explain this: different results got when all the same parameters are used in the errorest() in library ipred, as the following?
errorest(Species ~ ., data=iris, model=randomForest, estimator = "cv", est.para=control.errorest(k=3), mtry=2)$err
[1] 0.03333333
> errorest(Species ~ ., data=iris, model=randomForest, estimator = "cv",
2011 Sep 14
1
substitute games with randomForest::partialPlot
I'm having trouble calling randomForest::partialPlot programmatically.
It tries to use name of the (R) variable as the data column name.
Example:
library(randomForest)
iris.rf <- randomForest(Species ~ ., data=iris, importance=TRUE, proximity=TRUE)
partialPlot(iris.rf, iris, Sepal.Width) # works
partialPlot(iris.rf, iris, "Sepal.Width") # works
(function(var.name)
2010 May 04
1
randomforests - how to classify
Hi,
I'm experimenting with random forests and want to perform a binary
classification task.
I've tried some of the sample codes in the help files and things run, but I
get a message to the effect 'you don't have very many unique values in the
target - are you sure you want to do regression?' (sorry, don't know exact
message but r is busy now so can't check).
In
2004 Dec 10
1
predict.randomForest
I have a data.frame with a series of variables tagged to a binary
response ('present'/'absent'). I am trying to use randomForest to
predict present/absent in a second dataset. After a lot a fiddling
(using two data frames, making sure data types are the same, lots of
testing with data that works such as data(iris)) I've settled on
combining all my data into one data.frame
2018 Jan 07
4
partialPlot en un Randomforest
Muchas gracias Carlos; ¡tu siempre al pié del cañón! (lo puse el día
de reyes a la 1.20h y me contestas a las 2.45h)
Una cosa más: si el eje y es la probabilidad ¿por qué va de 0 a 10? En
un RF para clasificación me da valores parecidos a los de tu ejemplo,
y en otro para regresión, valores de y entre 45 y 55.
Para regresión, el último parámetro no puede ser una categoría, como
2007 Apr 24
1
NA and NaN randomForest
Dear R-help,
This is about randomForest's handling of NA and NaNs in test set data.
Currently, if the test set data contains an NA or NaN then
predict.randomForest will skip that row in the output.
I would like to change that behavior to outputting an NA.
Can this be done with flags to randomForest?
If not can some sort of wrapper be built to put the NAs back in?
thanks,
Clayton
2002 Apr 05
1
randomForest() segfaults under Solaris(SPARC) 2.7
Invocation of randomForest() using the iris example in the help
file crashes R with a segmentation fault. This happens on
all of our ultraSPARC machines running Solaris 2.7.
We're using R-1.4.1, compiled using Sun cc and f77 and
the flags:
CC=cc
CFLAGS="-xO5 -xlibmil -dalign"
FC=f77
FFLAGS="-xO5 -xlibmil -dalign"
"make check" runs withour errors, and R has been
2009 Feb 26
1
Random Forest confusion matrix
Dear R users,
I have a question on the confusion matrix generated by function randomForest.
I used the entire data
set to generate the forest, for example:
> print(iris.rf)
Call:
randomForest(formula = Species ~ ., data = iris, importance = TRUE,
keep.forest = TRUE)
confusion
setosa versicolor virginica class.error
setosa 50 0 0 0.00
2012 Dec 03
1
How do I make R randomForest model size smaller?
I've been training randomForest models on 7 million rows of data (41
features). Here's an example call:
myModel <- randomForest(RESPONSE~., data=mydata, ntree=50, maxnodes=30)
I thought surely with only 50 trees and 30 terminal nodes that the memory
footprint of "myModel" would be small. But it's 65 megs in a dump file. The
object seems to be holding all sorts of
2010 Sep 22
2
randomForest - partialPlot - Reg
Dear R Group
I had an observation that in some cases, when I use the randomForest model
to create partialPlot in R using the package "randomForest"
the y-axis displays values that are more than -1!
It is a classification problem that i was trying to address.
Any insights as to how the y axis can display value more than -1 for some
variables?
Am i missing something!
Thanks
Regards