ffs4rainfall: Performs forward feature selection

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Performs forward feature selection

Usage

1
2
3
ffs4rainfall(predictors, response, sampsize = 1, threshold = 0.06,
  out = "Rain", tuneGrid = list(.size = 2:5, .decay = c(0.05, 0.07)),
  method = "nnet", seed = 20)

Arguments

predictors

Either a data.frame with each column is one predictor and each row represents one pixel. Or (if only one scene is used for training) a RasterStack with one Raster is one Predictor Variable.

response

A vector of either Rainfall area or rainfall rates for the corresponding pixels in predictors. If only one scene is used for model training, "response" may also be a RasterLayer of the response variable.

threshold

if response is Rainfall rate: pixels larger than the threshold are used for rainfall rate training

out

Either Rain or RInfo indicating weather rainfall rates or rainfall areas should be used.

tuneGrid

list of tuning parameters to be supplied to model training. See https://topepo.github.io/caret/modelList.html for tuning values

method

ML algorithm to be applied. default is nnet

seed

Any integer number. Used to produce reproducable results

sampsize.

Number of data points used for training

Details

Predictors are centered and scaled according to mean and sd values. If the day of the year is used as predictor, this variable is scaled considering max=365 and min=1

Value

A train object

Author(s)

Hanna Meyer

References

ffe Function in the Rsenal package

See Also

ffe

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# stack the msg scenes:
msg_example <-getChannels(inpath=system.file("extdata/msg",package="Rainfall"))

# raster the sunzenith 
sunzenith<-getSunzenith(inpath=system.file("extdata/msg",package="Rainfall"))

#get Date
date <- getDate(inpath=system.file("extdata/msg",package="Rainfall"))

#calculate variables (takes some time...)
pred <- calculatePredictors(msg_example,
sunzenith=sunzenith,
spectral=c("VIS0.6","NIR1.6","T0.6_1.6"),
texture=expand.grid(c("NIR1.6","T6.2_10.8"),
c("variance", "contrast"),c(3,5,9)),
filterstat=expand.grid(c("NIR1.6","T6.2_10.8"),
c("sd","min"),c(3,5,9)),
 further=NULL,
 date=date)
 
response <- raster(system.file("extdata/radar",
"201007121650_radolan_SGrid.rst",package="Rainfall"))

#Train small ffs model with 0.1% of the pixels (takes around 1 minute...)
ffsModel <- ffs4rainfall(predictors=pred,
response,
out="Rain",
sampsize=0.01)

environmentalinformatics-marburg/Rainfall documentation built on May 16, 2019, 7:49 a.m.