comp.rf {CompositionalRF} | R Documentation |
Compositional Random Forests.
comp.rf(xnew = x, y, x, type = "alr", ntrees, nfeatures, minleaf)
xnew |
A matrix with the new predictor variables whose compositional response values are to be predicted. |
y |
The response compositional data. Zero values are not allowed. |
x |
A matrix with the predictor variables data. |
type |
If the responses are alreay transformed with the additive log-ratio transformation type 0, otherwise, if they are compositional data, leave it equal to "alr", so that the data will be transformed. |
ntrees |
The number of trees to construct in the random forest. |
nfeatures |
The number of randomly selected predictor variables considered for a split in each regression tree node, which must be less than the number of input precictors. |
minleaf |
Minimum number of observations in the leaf node. If a node has less than or equal to minleaf observations, there will be no splitting in that node and this node will be considered as a leaf node. The number evidently must be less than or equal to the sample size. |
The compositional are first log-transformed using the additive log-ratio transformation and then the multivariate random forest algorithm of Rahman, Otridge and Pal (2017) is applied.
A matrix with the estimated compositional response values.
Michail Tsagris.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
Rahman R., Otridge J. and Pal R. (2017). IntegratedMRF: random forest-based framework for integrating prediction from different data types. Bioinformatics, 33(9): 1407–1410.
Segal M. and Xiao Y. (2011). Multivariate random forests. Wiley Interdisciplinary Reviews: Data mining and Knowledge Discovery, 1(1): 80–87.
y <- as.matrix(iris[, 1:4])
y <- y/ rowSums(y)
x <- matrix( rnorm(150 * 10), ncol = 10 )
mod <- comp.rf(x[1:10, ], y, x, ntrees = 2, nfeatures = 5, minleaf = 10)
mod