Learn R Programming

hsdar (version 0.5.1)

caret::gafs: Methods for Function gafs

Description

Methods for function gafs in package caret.

Usage

"gafs"(x, y, cutoff = 0.95, returnData = TRUE, ...)
"gafs"(x, y, cutoff = 0.95, returnData = TRUE, ...)
"gafs"(x, y, cutoff = 0.95, returnData = TRUE, ...)
get_gafs(x)

Arguments

x
Object of class Speclib, Nri or Specfeat. For get_gafs, x must be the output of gafs as Speclib or Nri.
y
A numeric or factor vector containing the outcome for each sample. If missing, the response variable set by setResponse is used.
cutoff
The cutoff value of the correlation coefficients between response variables.
returnData
Logical. If TRUE, the updated object of x is returned, otherwise only the result of gafs is returned.
...
Further aruments passed to gafs.

Value

If returnData == TRUE, an object of class Speclib or Nri, otherwise an object of class gafs. Note that if x is an object of class Specfeat, the function returns an object of class Speclib containing the relevant transformed band values.

See Also

gafs

Examples

Run this code
## Not run: 
# data(spectral_data)
# 
# ## Set response variable (Chlorophyll content)
# spectral_data <- setResponse(spectral_data, "chlorophyll")
# 
# ## Set additional predictor variables from the attributes
# spectral_data <- setPredictor(spectral_data, "season")
# 
# ## Feature selection using genetic algorithms
# ## Note that this may take some time!
# gafs_res <- gafs(spectral_data)
# 
# get_gafs(gafs_res)
# ## End(Not run)

Run the code above in your browser using DataLab