- img
SpatRaster. Typically remote sensing imagery, which is to be classified.
- trainData
sf or sp spatial vector data containing the training locations (POINTs,or POLYGONs).
- valData
Ssf or sp spatial vector data containing the validation locations (POINTs,or POLYGONs) (optional).
- responseCol
Character or integer giving the column in trainData, which contains the response variable. Can be omitted, when trainData has only one column.
- nSamples
Integer. Number of samples per land cover class. If NULL all pixels covered by training polygons are used (memory intensive!). Ignored if trainData consists of POINTs.
- nSamplesV
Integer. Number of validation samples per land cover class. If NULL all pixels covered by validation polygons are used (memory intensive!). Ignored if valData consists of POINTs.
- polygonBasedCV
Logical. If TRUE model tuning during cross-validation is conducted on a per-polygon basis. Use this to deal with overfitting issues. Does not affect training data supplied as SpatialPointsDataFrames.
- trainPartition
Numeric. Partition (polygon based) of trainData that goes into the training data set between zero and one. Ignored if valData is provided.
- model
Character. Which model to use. See train for options. Defaults to randomForest ('rf'). In addition to the standard caret models, a maximum likelihood classification is available via model = 'mlc'.
- tuneLength
Integer. Number of levels for each tuning parameter (see train for details).
- kfold
Integer. Number of cross-validation resamples during model tuning.
- sampling
Character. Describes the type of additional sampling that is conducted after resampling (usually to resolve class imbalances), from caret. Currently supported are up, down, smote, and rose. Note, that smote requires the packages themis and rose the package ROSE. Latter is noly for binary classification problems.
- minDist
Numeric. Minumum distance between training and validation data,
e.g. minDist=1 clips validation polygons to ensure a minimal distance of one pixel (pixel size according to img) to the next training polygon.
Requires all data to carry valid projection information.
- mode
Character. Model type: 'regression' or 'classification'.
- predict
Logical. Produce a map (TRUE, default) or only fit and validate the model (FALSE).
- predType
Character. Type of the final output raster. Either "raw" for class predictions or "prob" for class probabilities. Class probabilities are not available for all classification models (predict.train).
- filename
Path to output file (optional). If NULL, standard raster handling will apply, i.e. storage either in memory or in the raster temp directory.
- verbose
Logical. prints progress and statistics during execution
- overwrite
logical. Overwrite spatial prediction raster if it already exists.
- ...
further arguments to be passed to train