View source: R/SOptim_RasterOutputs.R
predictSegments | R Documentation |
This function uses an input SOptim.Classifier
object to predict class labels for train or all segments in the
input segmented image.
predictSegments(
classifierObj,
calData,
rstSegm,
predictFor = "all",
filename = NULL,
verbose = TRUE,
na.rm = TRUE,
forceWriteByLine = FALSE,
...
)
classifierObj |
An object of class |
calData |
An object of class |
rstSegm |
A string defining the path to the raster with segment IDs, a |
predictFor |
Either option |
filename |
A file name/path used to write the output raster (default: NULL). |
verbose |
Print comments with function progress? (default: TRUE). |
na.rm |
Remove NA's? (default: TRUE). |
forceWriteByLine |
Use memory-safe writing of raster output by line? (default: FALSE).
If |
... |
Additional arguments for |
By default the function uses the classifier ran with the 'full' dataset (i.e., no train/test splits)
for making class label predictions. In case of single-class problems the threshold that maximizes the selected
evaluation metric (check evalMetric
in calibrateClassifier
) is used to dichotomize predictions.
For multi-class problems the output class label is set for the one with highest probability value.
An object of class SpatRaster
containing the predicted class labels for
each image segment. If the file name is defined, the function will write a file containing the output
raster. The output data type is INT4U (see datatype
for more details) which means
negative values for class labels are not valid.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.