Learn R Programming

sits (version 0.13.0)

sits_rfor: Train a SITS classifiction model using random forest algorithm

Description

Use Random Forest algorithm to classify data. This function is a front-end to the "randomForest" package. Please refer to the documentation in that package for more details.

Usage

sits_rfor(data = NULL, num_trees = 2000, nodesize = 1, ...)

Arguments

data

time series with the training samples

num_trees

number of trees to grow. This should not be set to too small a number, to ensure that every input row gets predicted at least a few times (default: 2000).

nodesize

minimum size of terminal nodes (default 1 for classification)

...

other parameters to be passed to `randomForest::randomForest` function

Value

model fitted to input data (to be passed to sits_classify)

Examples

Run this code
# NOT RUN {
# Retrieve the set of samples for the Mato Grosso region
samples_MT_ndvi <- sits_select(samples_modis_4bands, bands = "NDVI")
# Build a random forest model
rfor_model <- sits_train(samples_MT_ndvi, sits_rfor(num_trees = 300))
# get a point with a 16 year time series
point_ndvi <- sits_select(point_mt_6bands, bands = "NDVI")
# classify the point
class.tb <- sits_classify(point_ndvi, rfor_model)

# }

Run the code above in your browser using DataLab