There seems to be a bug with the way the parallel computation feature is implemented. The quantregForest object that is returned after training has only ntree/nthreads trees in it. Here is the code to reproduce:
library(quantregForest)
data(airquality)
set.seed(1)
## remove observations with mising values
airquality <- airquality[ !apply(is.na(airquality), 1,any), ]
## number of remining samples
n <- nrow(airquality)
## divide into training and test data
indextrain <- sample(1:n,round(0.6*n),replace=FALSE)
Xtrain <- airquality[ indextrain,2:6]
Xtest <- airquality[-indextrain,2:6]
Ytrain <- airquality[ indextrain,1]
Ytest <- airquality[-indextrain,1]
################################################
## compute Quantile Regression Forests ##
################################################
qrf <- quantregForest(x=Xtrain, y=Ytrain, nthreads=4, ntree=20)
qrf$ntree
There seems to be a bug with the way the parallel computation feature is implemented. The
quantregForest
object that is returned after training has only ntree/nthreads trees in it. Here is the code to reproduce: