modelRF: xytb randomForest function

Description Usage Arguments Author(s) See Also Examples

View source: R/xytb-class.R

Description

Build a random forest model on a xytb object, predicting behaviour using only the variables calculated at the time of observation (type 'actual') or using the variable shifted backwards in time (type 'shifted'). Parameters are transfered to the randomForest or the rfcv functions of the randomForest package if needed.

Usage

1
2
3
modelRF(xytb, type = c("actual", "shifted"), nob = "-1", colin = TRUE,
  varkeep = c("v", "dist", "thetarel"), zerovar = TRUE, rfcv = FALSE,
  ntree = 501, importance = TRUE, ...)

Arguments

xytb

an xytb object

type

character -actual or shifted- use actual data or shifted one to build the model

nob

character. Define the unobserved value of the behaviour (and where prediction are done)

colin

boolean - remove colinearity among predictors (see the caret package for more details)

varkeep

character vector - the variables names in this vector are keeped in the model even if colinearity is found (usefull to keep 'classical' parameters and to help interpretation)

zerovar

boolean - remove near zero variance predictor (see the caret package for more details)

rfcv

boolean - run a random forest cross-validation for feature selection procedure for xybt (this call the rfcv fonction for the model). This function shows the cross-validated prediction performance of models with sequentially reduced number of predictors (ranked by variable importance) via a nested cross-validation procedure for a xytb object.

ntree

number of trees in the random Forest (see the randomForest package for more details)

importance

boolean (see the randomForest package for more details)

...

other arguements passed to randonForest or rfcv

Author(s)

Laurent Dubroca and Andr<c3><a9>a Thiebault

See Also

See randomForest and rfcv

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#track_CAGA_005 is dataset
#generate a complete xytb object with derived (over moving windows of 3, 5
#and 9 points, with quantile at 0, 50 and 100%) and shifted information on 10
#and 100 points
xytb<-xytb(track_CAGA_005,"a track",c(3,5,9),c(0,.5,1),c(10,100))
#compute a random forest model to predict behaviour (b, where -1 is
#unobserved behaviour) using the derived
#parameters ("actual")
xytb<-modelRF(xytb,"actual",nob="-1",colin=TRUE,varkeep=c("v","thetarel"),
zerovar=TRUE)
## Not run:  
#cross-validation for the same model (time consuming !)
xytb<-modelRF(xytb,"actual",nob="-1",colin=TRUE,varkeep=c("v","thetarel"),
zerovar=TRUE,rfcv=TRUE)

## End(Not run)

ldbk/m2b documentation built on May 20, 2019, 11:29 p.m.