Based on an ABC-RF object this function predicts the best model for new data and evaluate the posterior probability of the MAP.
# S3 method for abcrf
predict(object, obs, training, ntree = 1000,
sampsize = min(1e5, object$model.rf$num.samples ), paral = FALSE,
ncores = if(paral) max(detectCores()-1,1) else 1, paral.predict = FALSE,
ncores.predict = if(paral.predict) max(detectCores()-1,1) else 1, ...)
An object of class abcrfpredict
, which is a list with the
following components:
indices of the selected models for each observed data set,
votes for each observed dataset,
ABC-RF approximations of the posterior probability of the selected model for each observed dataset.
an abcrf
object.
a data frame containing the summary statistics of the observed data sets.
the data frame containing the reference table used to train the abcrf
object.
number of trees to grow in the regression forest, by default 1,000 trees.
size of the sample from the reference table used to grow a tree of the forest, by default the minimum between the number of elements of the reference table and 100,000.
a boolean that indicates if the calculations of the regression random forest (forest that returns the posterior probability of the selected model) should be parallelized.
the number of CPU cores to use for the regression random forest construction. If paral=TRUE, it is used the number of CPU cores minus 1. If ncores is not specified and detectCores
does not detect the number of CPU cores with success then 1 core is used.
a boolean that indicates if random forests predictions should be parallelized.
the number of CPU cores to use for random forest predictions (classification and regression). If paral.predict=TRUE, it is used the number of CPU cores minus 1. If ncores.predict is not specified and detectCores
does not detect the number of CPU cores with success then 1 core is used.
additional arguments to be passed on to ranger
used to construct
the regression random forest that estimates the posterior probability of the selected model.
Pudlo P., Marin J.-M., Estoup A., Cornuet J.-M., Gautier M. and Robert, C. P. (2016) Reliable ABC model choice via random forests Bioinformatics tools:::Rd_expr_doi("10.1093/bioinformatics/btv684")
abcrf
,
plot.abcrf
,
err.abcrf
data(snp)
modindex <- snp$modindex[1:500]
sumsta <- snp$sumsta[1:500,]
data1 <- data.frame(modindex, sumsta)
model.rf <- abcrf(modindex~., data1, ntree=100)
data(snp.obs)
predict(model.rf, snp.obs, data1, ntree=100)
Run the code above in your browser using DataLab