IterateTrainingTesting: Iterate training/testing procedures with a given classifier...

Description Usage Arguments Details Value Author(s)

View source: R/iterate_training_testing.R

Description

for the sake of the accuracy and due to the error rate have we define our own iterative procedure to estimate the misclassification error rate (MER) iteratively with independent selections of testing and training sets (obtained by random subsampling). This enables to obtain a more robust estimate of the error rate (mean or median of the iterations) as well as the disperson (IQR, standard deviation) resulting from sampling fluctuations and from the stochastic elements of some algorithms (e.g. random forests).

Usage

1
2
3
4
5
6
7
IterateTrainingTesting(
  dataset,
  classifier,
  permute = FALSE,
  file.prefix = NULL,
  verbose = 1
)

Arguments

dataset

an object of class DataTableWithTrainTestSets

classifier

one of the supported classifiers: "svm", "knn" or "rf"

permute

should be TRUE if the class labels have been permuted for a negative control

file.prefix

prefix for files. If NULL, will be obtained from the function outputParameters()

verbose=1

level of verbosity

Details

#' @title Iterate training/testing procedures with a given classifier and a given data type for an object belonging to the class DataTableWithClasses #' @author Mustafa AbuElQumsan and Jacques van Helden #' @description for the sake of the accuracy and due to the error rate have #' we define our own iterative procedure to estimate the misclassification error #' rate (MER) iteratively with independent selections of testing and training #' sets (obtained by random subsampling). This enables to obtain a more robust #' estimate of the error rate (mean or median of the iterations) as well as the #' disperson (IQR, standard deviation) resulting from sampling fluctuations and #' from the stochastic elements of some algorithms (e.g. random forests). #' @param dataset an object of class DataTableWithTrainTestSets #' @param classifier one of the supported classifiers: "svm", "knn" or "rf" #' @param permute should be TRUE if the class labels have been permuted for a negative control #' @param file.prefix prefix for files. If NULL, will be obtained from the function outputParameters() #' @param verbose=1 level of verbosity #' @return an object which is Misclassification error rate for the specified number for resampling #'

#'

#' @import foreach #' @import doParallel #' @export #' IterateTrainingTesting <- function(dataset, classifier, permute = FALSE, file.prefix = NULL, verbose = 1) message("\tRunning IterateTrainingTesting() with object of class\t", paste( collapse = ",",class(dataset) ) ) testTable <- UseMethod("IterateTrainingTesting", dataset, classifier, permute, file.prefix, verbose) return(testTable)

#' @title Iterate training/testing procedures with a given classifier and a given data type for an object belonging to the class DataTableWithClasses #' @author Mustafa AbuElQumsan and Jacques van Helden #' @description for the sake of the accuracy and due to the error rate have #' we define our own iterative procedure to estimate the misclassification error #' rate (MER) iteratively with independent selections of testing and training #' sets (obtained by random subsampling). This enables to obtain a more robust #' estimate of the error rate (mean or median of the iterations) as well as the #' disperson (IQR, standard deviation) resulting from sampling fluctuations and #' from the stochastic elements of some algorithms (e.g. random forests). #' @param dataset an object of class DataTableWithTrainTestSets #' @param classifier one of the supported classifiers: "svm", "knn" or "rf" #' @param permute should be TRUE if the class labels have been permuted for a negative control #' @param file.prefix prefix for files. If NULL, will be obtained from the function outputParameters() #' @param verbose=1 level of verbosity #' @return an object which is Misclassification error rate for the specified number for resampling #'

#'

#' #' @export IterateTrainingTesting.DataTableWithClasses <- function(dataset, classifier, permute = FALSE, file.prefix = NULL, verbose = 1) message("\tRunning IterateTrainingTesting() with object of class\t", "DataTableWithClasses") testTable <- NextMethod("IterateTrainingTesting", dataset, classifier, permute, file.prefix, verbose) return(testTable)

#' @title printing report message to inform that the training/testing procedure #' was completed for an object of class DataTableWithTrainTestSets #' @author Mustafa AbuElQumsan and Jacques van Helden #' @description for the sake of the accuracy and due to the error rate have #' we define our own iterative procedure to estimate the misclassification error #' rate (MER) iteratively with independent selections of testing and training #' sets (obtained by random subsampling). This enables to obtain a more robust #' estimate of the error rate (mean or median of the iterations) as well as the #' disperson (IQR, standard deviation) resulting from sampling fluctuations and #' from the stochastic elements of some algorithms (e.g. random forests). #' @param dataset an object of class DataTableWithTrainTestSets #' @param classifier one of the supported classifiers: "svm", "knn" or "rf" #' @param permute should be TRUE if the class labels have been permuted for a negative control #' @param file.prefix prefix for files. If NULL, will be obtained from the function outputParameters() #' @param verbose=1 level of verbosity #' #' @export IterateTrainingTesting.default <- function(dataset, classifier, permute = FALSE, file.prefix = NULL, verbose = 1) message.with.time("\tFinished IterateTrainingTesting() with object of class\t", paste(collapse = ",", class(dataset)), "\n\tclassifier: ", classifier, "\n\tpermute: ", permute, "\n\tfile.prefix: ", file.prefix)

Value

an object which is Misclassification error rate for the specified number for resampling

Author(s)

Mustafa AbuElQumsan and Jacques van Helden


elqumsan/RNAseqMVA documentation built on March 10, 2021, 8:10 a.m.