Displaying 20 results from an estimated 100 matches similar to: "RandomForest tuning the parameters"
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>
2009 Mar 23
0
Scaled MPSE as a test for regressors?
Hi,
This is really more a stats question than a R one, but....
Does anyone have any familiarity with using the mean prediction
squared error scaled by the variance of the response, as a 'scale
free' criterion for evaluating different regression algorithms.
E.g.
Generate X_train, Y_train, X_test, Y_test from true f. X_test/Y_test
are generated without noise, maybe?
Use X_train, Y_train
2017 Jun 11
1
Memory leak in nleqslv()
Hello all,
I am relatively new to R, but enjoying it very much. I am hoping that
someone on this list can help me with an issue I am having.
I am having issues with iterations over nleqslv, in that the solver
does not appear to clean up memory used in previous iterations. I
believe I've isolated the/my issue in a small sample of code:
library(nleqslv)
cons_ext_test <- function(x){
2009 Mar 04
0
Error in -class : invalid argument to unary operator
Hi guys I have been using R for a few months now and have come across an
error that I have been trying to fix for a week or so now.I am trying to
build a classifer that will classify the wine dataset using Naive Bayes.
My code is as follows
library (e1071)
wine<- read.csv("C:\\Rproject\\Wine\\wine.csv")
split<-sample(nrow(wine), floor(nrow(wine) * 0.5))
wine_training <-
2008 Aug 29
1
nls() fails on a simple exponential fit, when lm() gets it right?
Dear R-help,
Here's a simple example of nonlinear curve fitting where nls seems to get
the answer wrong on a very simple exponential fit (my R version 2.7.2).
Look at this code below for a very basic curve fit using nls to fit to (a)
a logarithmic and (b) an exponential curve. I did the fits using
self-start functions and I compared the results with a more simple fit
using a straight lm()
2006 Aug 08
1
Fitting data with optim or nls--different time scales
Hi,
I have a system of ODE's I can solve with lsoda.
Model=function(t,x,parms)
{
#parameter definitions
lambda=parms[1]; beta=parms[2];
d = parms[3]; delta = parms[4];
p=parms[5]; c=parms[6]
xdot[1] = lambda - (d*x[1])- (beta*x[3]*x[1])
xdot[2] = (beta*x[3]*x[1]) - (delta*x[2])
xdot[3] = (p*x[2]) - (c*x[3])
return(list(xdot))
}
I want
2008 Jul 16
1
Problems with snowfall
Guys,
Is anyone using snowfall? It seems that the last version is broken. sfinit
contains test code:
data("config", package = "snowfall")
configM <- as.matrix(t(config))
config <- as.list(configM)
names(config) <- dimnames(configM)[[2]]
.sfOption$SERVER <<- as.character(config[["SERVER"]])
.sfOption$PORT <<-
2011 Dec 07
1
MIXED MODEL WITH REPEATED MEASURES
I am trying to specify a mixed model for my research, but I can't quite get
it to work. I've spent several weeks looking thru various online sources to
no avail. I can't find an example of someone trying to do precisely what I'm
trying to do. I'm hoping some smart member of this mailing list may be able
to help.
First off, full disclosure: (1) I'm an engineer by trade, so
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]]
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
2007 Dec 11
1
postResample R² and lm() R²
Hello,
I'm with a conceptual doubt regarding Rsquared of both lm() and
postResample(library caret).
I've got a multiple regression linear model (lets say mlr) with anR² value
of 67.52%.
Then I use this model pro make predictions with predict() function using the
same data as input , that is, use the generated model to predict the value
associated with data that I used as input.
Next, if
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
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 Nov 29
1
Help with this error "kernlab class probability calculations failed; returning NAs"
I have never been able to get class probabilities to work and I am relatively new to using these tools, and I am looking for some insight as to what may be wrong.
I am using caret with kernlab/ksvm. I will simplify my problem to a basic data set which produces the same problem. I have read the caret vignettes as well as documentation for ?train. I appreciate any direction you can give. I
2013 Jun 25
1
Correct scaling of axis in persp3d plot
Hi,
I want to format my axis in my persp3d plot.
With my data, which I attached I created a persp3d plot with the following code, which I summarized from different code snippets I found:
library(rugarch)library(rgl)library(fGarch)fd <-as.data.frame(modelfit,which ='density')color <-rgb(85,141,85,maxColorValue=255)x <-seq(-0.2,0.2,length=100)y <-c(1:2318)f
2003 May 21
8
system slowdown - vnode related
I woke up to a frozen box this morning - it froze up a few more times
before I got a handle on it.
Basically, the box runs idle but refuses to do disk IO, or does it
-very- slowly.
Top shows processes stuck in 'ffsvget', 'inode', and 'vlruwk' state.
I can get the box responsive again by setting sysctl
kern.maxvnods=100000. It starts up with kern.maxnodes=36079. I
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
2012 Dec 12
1
ggplot - adding regression lines
Hi
I am using ggplot to overlay two regression lines on a scatter plot each
corresponding to a treatment group.
The default plot gives a different slope for each treatment group. However,
in some cases i want the lines to be parallel -ie no significant
interaction.
My code:
ggplot(data=df,X,Y,colour=treatment) + geom_point() +
geom_smooth(method="lm")
I think i use the
2010 Sep 25
2
Uncertainty propagation
I have a small model running under R. This is basically running various
power-law relations on a variable (in this case water level in a river)
changing spatially and through time. I'd like to include some kind of error
propagation to this.
My first intention was to use a kind of monte carlo routine and run the
model many times by changing the power law parameters. These power laws were
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