This function builds Frechet random Forest introduced by Capitaine et.al, this includes the OOB predictions, OOB errors and variable importance computations.
Frechforest(X, Y, id, time, mtry = ceiling(ncol(X)/3), ntree = 100,
ncores = 1, ERT = FALSE, timeScale = 0.1, imp = TRUE, ...)[matrix]: a data frame or a matrix of trajectories predictors. Each colunm codes for a trajectory predictor.
[vector]: a vector containing the output trajectories (same length as nrow(X)).
[vector (factor)]: identifier, one for each trajectory to attribute each measurement of X and Y to one of the trajectories (same length as Y).
[vector]: time measurements for the observations of both X and Y (same length as Y).
[numeric]: number of variables randomly chosen at each split. Default is ncol(X)/3
[numeric]: number of randomized Frechet trees composing the Frechet random forest. Default is 100.
[numeric]: number of cores used in parallel. Default is 1.
[logical]: if TRUE uses Extremly randomized Frechet trees to build the Frechet forest.
[numeric]: allow to modify the time scale, increasing or decreasing the cost of the horizontal shift. If timeScale is very big, then the Frechet mean tends to the Euclidean distance. If timeScale is very small, then it tends to the Dynamic Time Warping.
[logical]: TRUE to compute the variables importance FALSE otherwise (default imp=TRUE)
: optional parameters to be passed to the low level function.
a Frechet random forest which is a list of the following elements:
rf: a list of the ntree randomized Frechet trees that compose the forest.
mse : a vector containing the OOB prediction error of each randomized Frechet tree composing the forest.
OOB.err: a vector containing the OOB prediction error of each trajectory in the learning sample.
OOB.pred: a list of the OOB prediction of each trajectory in the learning set.
Importance: A vector containing the p variables importance.
rsq: <U+201C>pseudo R-squared<U+201D>: 1 - mse/Var(y).
# NOT RUN {
set.seed(10)
data <- DataGenCurves(50)
FRF <- Frechforest(data$X,data$Y, data$id,data$time, ntree=40,ncores=2, toPlot="none")
# }
Run the code above in your browser using DataLab