createDataSplits: Create a data split for classification evaluation

View source: R/SOptim_ClassificationFunctions.R

createDataSplitsR Documentation

Create a data split for classification evaluation

Description

An auxiliary/internal function used to create a data split intended to evaluate classification performance. Used internally in the calibrateClassifier function.

Usage

createDataSplits(y, evalMethod = "10FCV", nRounds = 20, trainPerc = 0.8)

Arguments

y

A vector containing train inputs.

evalMethod

A character string defining the evaluation method. The available methods are "10FCV" (10-fold cross-validation; the default), "5FCV", (5-fold cross-validation), "HOCV" (holdout cross-validation with the training percentage defined by trainPerc and the number of rounds defined in nRounds), and, "OOB" (out-of-bag evaluation; only applicable to random forests algorithm).

nRounds

Number of evaluation rounds. This is only used for HOCV method.

trainPerc

Proportion of data used for training the algorithm (by deafult eaul to 0.8). This is only used for the "HOCV" method.

Details

Uses function createDataPartition from caret package as the 'workhorse' to generate data splits.

Value

A list like object of class 'dataSplit' to be used in calibrateClassifier() function. Each element on the list contains the indices used for training.

Examples

createDataSplits(y=rnorm(100), evalMethod = "10FCV", nRounds = 20, trainPerc = 0.8)


joaofgoncalves/SegOptim documentation built on Feb. 5, 2024, 11:10 p.m.