caret_rfe: Methods for Function 'rfe'

caret::rfeR Documentation

Methods for Function rfe

Description

Methods for function rfe in package caret. Please refer to help pages in the caret-package for further information.

Usage

## S4 method for signature 'Speclib'
rfe(x, y, cutoff = 0.95, returnData = TRUE, na.rm = FALSE, ...)

## S4 method for signature 'Nri'
rfe(x, y, cutoff = 0.95, returnData = TRUE, na.rm = FALSE, ...)

## S4 method for signature 'Specfeat'
rfe(x, y, cutoff = 0.95, returnData = TRUE, na.rm = FALSE, ...)

get_rfe(x)

Arguments

x

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

na.rm

Logical. If TRUE, all variables are excluded which contain at least one non-finite value.

...

Further aruments passed to rfe.

Value

If returnData == TRUE, an object of class Speclib or Nri, otherwise an object of class rfe. 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

rfe

Examples

## Not run: 
data(spectral_data)

## Set response variable (Chlorophyll content)
spectral_data <- setResponse(spectral_data, "chlorophyll")

## Set additional predictor variables from the SI
spectral_data <- setPredictor(spectral_data, "season")

## Recursive feature selection
## Note that this may take some time!
rfe_res <- rfe(spectral_data)

get_rfe(rfe_res)

plot(get_rfe(rfe_res))

## End(Not run)

hsdar documentation built on March 18, 2022, 6:35 p.m.