Description Usage Arguments Details Value Note Author(s) Examples
uses a forward feature selection (FFS) to select the best predictors for the classification
1  | BestPredFFS(tDat, predCol = "default", classCol = NULL, Cores = 1)
 | 
tDat | 
 data.frame - with values of the predictors (see details)  | 
predCol | 
 numeric - seq of columns with the predictor values. By default uses 1:(length(tDat)-1) for tDat format computed by 'IKARUS::exrct_Traindat'  | 
classCol | 
 character - name of the column containing the class information  | 
Cores | 
 numeric - amount of Cores to exclude from calculation, default = 1  | 
The function is used to select best performing predictor variables for a classification. The
predCol - specific predictors can be selected by setting predCol = x:y
tDat - the use of IKARUS::exrct_Traindat is recommended.
parallel processing - the function uses parallel processing for multicore processors. by default all cores -1 are used.
returns a list of best performing predictors
The function will compute a huge number of models. Depending on the sizes of the training data the process can take long time even with multicore processing.
Andreas Schönberg
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  | # load data
require(caret)
require(CAST)
require(doParallel)
require(raster)
require(IKARUS)
lau_Stk <- raster::stack(system.file("extdata","lau_RGB.grd",package = "IKARUS"))
lau_tP <-rgdal::readOGR(system.file("extdata","lau_TrainPolygon.shp",package = "IKARUS"))
crs(lau_tP) <- crs(lau_Stk)
### extract values using 'IKARUS::exrct_Traindat'
tDat <- exrct_Traindat(lau_tP,lau_Stk,"class")
# FFS with all layers in the RasterStack (this example could take some minutes)
ffs <- BestPredFFS(tDat=tDat,classCol = "class")
# some code to look at the results
ffs$selectedvars # show seleted variables
ffs$perf_all # show performance of all combinations
ffs$finalModel # show confusion matrix
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.