Methods for Function safs

Share:

Description

Methods for function safs in package caret.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## S4 method for signature 'Speclib'
safs(x, y, cutoff = 0.95, returnData = TRUE, ...)

## S4 method for signature 'Nri'
safs(x, y, cutoff = 0.95, returnData = TRUE, ...)

## S4 method for signature 'Specfeat'
safs(x, y, cutoff = 0.95, returnData = TRUE, ...)

get_safs(x)

Arguments

x

Object of class Speclib, Nri or Specfeat. For get_safs, x must be the output of safs 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 safs is returned.

...

Further aruments passed to safs.

Value

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

Author(s)

Lukas Lehnert

See Also

safs

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## 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")

## Supervised feature selection using simulated annealing
## Note that this may take some time!
safs_res <- safs(spectral_data)

get_safs(safs_res)

plot(get_safs(safs_res))

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.