Learn R Programming

sits (version 0.10.0)

sits_classify.sits: Classify a set of time series using machine learning models

Description

This function classifies a set of time series, given a set of training samples, an inference model, and an interval. To perform the classification, users should provide a set of labelled samples. Each samples should be associated to one spatial location (latitude/longitude), one time interval and a label.

The model should be precomputed by the user. This model should be passed to the function using the parameter "ml_model".

Usage

# S3 method for sits
sits_classify(data, ml_model, ..., filter = NULL, multicores = 2)

Arguments

data

Tibble with time series metadata and data.

ml_model

Pre-built machine learning model (see sits_train).

...

Other parameters to be passed to specific functions

filter

Smoothing filter to be applied (if desired).

multicores

Number of cores to be used for classification.

Value

A tibble with the predicted labels for each input segment.

Examples

Run this code
# NOT RUN {
# Retrieve the samples for Mato Grosso
# select band "NDVI"
samples_ndvi <- sits_select(samples_mt_4bands, bands = "NDVI")

# select a random forest model
rfor_model <- sits_train(samples_ndvi,
    ml_method = sits_rfor(num_trees = 300)
)

# classify the point
point_class <- sits_classify(point_ndvi, rfor_model)
# }

Run the code above in your browser using DataLab