View source: R/SOptim_GetTrainData.R
getTrainData_ | R Documentation |
An ancillary function used to generate training data for classification. This function is the
workhorse behind getTrainData
.
getTrainData_(
x,
rstSegm,
useThresh = TRUE,
thresh = 0.5,
na.rm = TRUE,
dup.rm = TRUE,
minImgSegm = 30,
ignore = FALSE,
tiles = NULL
)
x |
Input train data used for classification. The input can be a |
rstSegm |
A path or a |
useThresh |
Use threshold to filter training data for multi-class? (default: TRUE; not used for points). |
thresh |
A threshold value defining the minimum proportion of the segment ]0, 1] that
must be covered by a certain class to be considered as a training case. This threshold will
only apply if |
na.rm |
Remove NA's? (default: TRUE). Only used if |
dup.rm |
Remove duplicate values? (default: TRUE; see details). Only used if |
minImgSegm |
Minimum number of image segments/objects necessary to generate train data. |
ignore |
If set to TRUE then train data may contain one single class. This is useful in cases where sample units contain only positive or negative train cases. Also applies if the threshold value is employed. In this case if no positive cases are generated then negatives will be returned (default: FALSE). |
tiles |
An object of class |
A two-column data frame with segment IDs (column "SID") and the corresponding train class (column "train").
Train raster data must contain at least two categories, coded as integers:
- 0 and 1 for "single-class" (with 1's being the class of interest and typically the minority class);
- or 1, 2, ..., n for "multi-class".
Background or null pixels should be coded as NoData.
To produce valid train data, the image segmentation produce must generate more than
minImgSegm
unique segments (or objects).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.