modelRF {m2b} | R Documentation |
xytb randomForest function
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
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 |
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éa Thiebault
See Also
See randomForest and rfcv
Examples
#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)