doOptim: Optimise several baseline algorithms on a data set

View source: R/optimisation.R

doOptimR Documentation

Optimise several baseline algorithms on a data set

Description

Tests several baseline algorithms with one predictor for a given data set. The baseline algorithms are represented as a list of baselineAlgTest objects, and the predictor as a predictionTest object.

Usage

doOptim(baselineTests, X, y, predictionTest, postproc = NULL,
        tmpfile = "tmp.baseline", verbose = FALSE, cleanTmp = FALSE)

Arguments

baselineTests

a list of baselineAlgTest objects. The baseline algorithms and parameter values to test

X

A matrix. The spectra to use in the test

y

A vector or matrix. The response(s) to use in the test

predictionTest

A predictionTest object. The predictor and parameter values to use in the test

postproc

A function, used to postprocess the baseline corrected spectra prior to prediction testing. The function should take a matrix of spectra as its only argument, and return a matrix of postprocessed spectra

tmpfile

The basename of the files used to store intermediate calculations for checkpointing. Defaults to "tmp.baseline"

verbose

Logical, specifying whether the test should print out progress information. Default is FALSE

cleanTmp

Logical, specifying whether the intermediate files should be deleted when the optimisation has finished. Default is FALSE

Details

The function loops through the baseline algorithm tests in baselineTests, testing each of them with the given data and prediction test, and collects the results. The results of each baseline algorithm test is saved in a temporary file so that if the optimisation is interrupted, it can be re-run and will use the pre-calculated results. If cleanTmp is TRUE, the temporary files are deleted when the whole optimisation has finished.

Value

A list with components

baselineTests

The baselineTests argument

results

A list with the baselineAlgResult objects for each baseline test

minQualMeas

The minimum quality measure value

baselineAlg.min

The name of the baseline algorithm giving the minimum quality measure value

param.min

A list with the parameter values corresponding to the minimum quality measure value

Author(s)

Bjørn-Helge Mevik and Kristian Hovde Liland

See Also

baselineAlgTest,predictionTest


baseline documentation built on Nov. 18, 2023, 5:14 p.m.