Learn R Programming

Cardinal (version 1.4.0)

cvApply-methods: Apply Cross-Validated Analysis to Imaging Datasets

Description

Apply an existing or a user-specified function over imaging datasets.

Usage

"cvApply"(.x, .y, .fun, .fold = sample, ...)

Arguments

.x
An object of class SImageSet.
.y
An appropriate response variable.
.fun
The function to be used for the analyses.
.fold
A variable determining the cross-validation folds. By default, this will set to 'sample' from pixelData(.x), to ensure that whole samples are left out during the cross-validation. This argument is evaluated in pixelData(.x).
...
Additional arguments passed to .fun.

Value

An object of class 'CrossValidated', which is derived from ResultSet.

Details

This method is designed to be used with the provided classification methods, but can also be used with user-provided functions and methods as long as they fulfill certain expectations.

The function or method passed to '.fun' must take at least two arguments: the first argument must be a object derived from SImageSet, and the second argument must be the response variable. The function should return an object of a class derived from ResultSet, which should have a predict method that takes arguments 'newx' and 'newy'.

See Also

PLS, OPLS, spatialShrunkenCentroids