Learn R Programming

sits (version 1.5.3)

sits_classify.sits: Classify a set of time series

Description

sits_classify.sits is called when the input is a set of time series. The output is the same set with the additional column predicted.

Usage

# S3 method for sits
sits_classify(
  data,
  ml_model,
  ...,
  filter_fn = NULL,
  impute_fn = impute_linear(),
  multicores = 2L,
  gpu_memory = 4L,
  batch_size = 2L^gpu_memory,
  progress = TRUE
)

Value

Time series with predicted labels for each point (tibble of class "sits").

Arguments

data

Set of time series ("sits tibble")

ml_model

R model trained by sits_train (closure of class "sits_model")

...

Other parameters for specific functions.

filter_fn

Smoothing filter to be applied - optional (closure containing object of class "function").

impute_fn

Imputation function to remove NA.

multicores

Number of cores to be used for classification (integer, min = 1, max = 2048).

gpu_memory

Memory available in GPU in GB (default = 4)

batch_size

Batch size for GPU classification.

progress

Logical: Show progress bar?

Examples

Run this code
if (sits_run_examples()) {
    # Example of classification of a time series
    # Retrieve the samples for Mato Grosso
    # train a random forest model
    rf_model <- sits_train(samples_modis_ndvi, ml_method = sits_rfor)

    # classify the point
    point_ndvi <- sits_select(point_mt_6bands, bands = c("NDVI"))
    point_class <- sits_classify(
        data = point_ndvi, ml_model = rf_model
    )
    plot(point_class)
}

Run the code above in your browser using DataLab