cvCoRF: n-fold cross-validation of CoRF

View source: R/CoRF.R

cvCoRFR Documentation

n-fold cross-validation of CoRF

Description

Conducts a n-fold cross-validation of a CoRF object to obtain an unbiased estimate of the predictive error. Primarly for when gamma is tuned.

Usage

cvCoRF(CoRFObject, nfold = 10, SeedCVO = 123, GammaSeq = NULL,
  ntree = NULL, SelectForest = TRUE)

Arguments

CoRFObject

A CoRF object.

nfold

The cross-validation fold.

SeedCVO

The seed used to draw the cross-validation folds.

GammaSeq

Set gamma sequence to be used in the cross-validation. By default uses the same sequence as used to fit the CoRF object.

ntree

Set the number of trees used per RF in the cross-validation. By default uses the same number of trees as used to fit the CoRF object.

Value

Returns An object with the result of the cross-validation, containng the following components.

foldid

The cross-validation folds used

OptGammaPerFold

When more than one gamma was used, this returns per fold the gamma with lowest brier/auc.

Predictions

The cross-validated predictions, for the base RF, the CoRF with gamma=1, and optionally the predictions for the CoRF selected by brier or auc.

cvResult

The result of the cross-validation, e.g. cross-validated auc, brier, and accuracy.


DennisBeest/CoRF documentation built on July 27, 2024, 8:32 p.m.