err.regAbcrf: Calculate and plot for different numbers of tree, the...

Description Usage Arguments Value References See Also Examples

View source: R/err.regAbcrf.R

Description

err.regAbcrf returns out-of-bag mean squared errors and plot them.

Usage

1
2
err.regAbcrf(object, training, paral=FALSE, 
ncores= if(paral) max(detectCores()-1,1) else 1, what="mean")

Arguments

object

a regAbcrf object.

training

the data frame containing the reference table used to train the regAbcrf object.

paral

a boolean that indicates if random forests predictions should be parallelized.

ncores

the number of CPU cores to use for the random forest predictions. 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.

what

a string caracter "mean" or "median" indicating if the predictions are computed with mean or median of the response variable.

Value

a matrix with 2 columns: the number of trees and the out-of-bag mean squared errors. NAs might be returned if the number of trees is too low. Errors are computed from 40 trees to the total number.

References

Raynal L., Marin J.-M. Pudlo P., Ribatet M., Robert C. P. and Estoup, A. (2019) ABC random forests for Bayesian parameter inference Bioinformatics https://doi.org/10.1093/bioinformatics/bty867

See Also

regAbcrf, predict.regAbcrf, plot.regAbcrf, densityPlot, covRegAbcrf, ranger

Examples

1
2
3
4
5
6
7
8
9
  data(snp)
  modindex <- snp$modindex
  sumsta <- snp$sumsta[modindex == "3",]
  r <- snp$param$r[modindex == "3"]
  r <- r[1:500]
  sumsta <- sumsta[1:500,]
  data2 <- data.frame(r, sumsta)
  model.rf.r <- regAbcrf(r~., data2, ntree=100)
  err.regAbcrf(model.rf.r, data2)

abcrf documentation built on Nov. 5, 2019, 5:06 p.m.