crossvalidate: Cross-validate on a matrix of ToF data with labels

Description Usage Arguments Details Value

View source: R/crossvalidate.R

Description

Perform 10-fold cross-validation on a matrix of ToF data. This produces a 'caret::train' object containing lots of relevant information. One can extract predictions made and use these to determine accuracy.

Usage

1
2
crossvalidate(data_matrix, labels, model = "xgbTree", n_folds = 10,
  tune = FALSE, hyperparams = "tof")

Arguments

data_matrix

A matrix of ToF data

labels

A character vector of class labels (shoulkd have 2 unique values)

model

The model to use

n_folds

number of folds in crossvalidation

tune

Whether to tune hyper-parameters (TRUE), or use defaults (FALSE)

hyperparams

One of 'tof' or 'gcims' whether the default hyper- parameters have been picked for tof data or gc-ims data. No effect if tune = TRUE.

Details

The caret::train object also includes a classifier trained on the full dataset. #' This can be used to make further predictions on new data, such as a validation set.

Value

A caret::train object


JimSkinner/toftools documentation built on Oct. 30, 2019, 7:55 p.m.