Learn R Programming

sits (version 0.13.0)

sits_lda: Train a sits classification model using linear discriminant analysis

Description

This function receives a tibble with a set of attributes X for each observation Y. These attributes are the values of the time series for each band. The method performs a linear discriminant analysis (lda) to obtain a predictive model. This function is a front-end to the "lda" method in the "MASS" package. Please refer to the documentation in that package for more details.

Usage

sits_lda(data = NULL, formula = sits_formula_logref(), ...)

Arguments

data

Time series with the training samples.

formula

A symbolic description of the model to be fit. (default: sits_formula_logref).

...

Other parameters to be passed to MASS::lda 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 Mato Grosso region (provided by EMBRAPA)
samples_2bands <- sits_select(samples_modis_4bands, bands = c("NDVI", "EVI"))

# Build a machine learning model
ml_model <- sits_train(samples_2bands, sits_lda())

# get a point and classify the point with the ml_model
point.tb <- sits_select(point_mt_6bands, bands = c("NDVI", "EVI"))
class.tb <- sits_classify(point.tb, ml_model)
plot(class.tb, bands = c("NDVI", "EVI"))
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab