Learn R Programming

sits (version 1.12.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 distance metrics between patterns and observations, obtained by a distance function in sits (see sits_distances). 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.tb = NULL, formula = sits_formula_logref(), ...)

Arguments

data.tb

Time series with the training samples.

formula

A symbolic description of the model to be fit. Package sits offers a set of such formulas (default: sits_formula_logref).

...

Other parameters to be passed to MASS::lda function.

Value

A model function to be passed in sits_predict.

Examples

Run this code
# NOT RUN {
# Retrieve the set of samples for the Mato Grosso region (provided by EMBRAPA)
data(samples_mt_ndvi)
# Build an LDA model
lda_model <- sits_train(samples_mt_ndvi, sits_lda())
# get a point with a 16 year time series
data(point_ndvi)
# classify the point
class.tb <- sits_classify (point_ndvi, lda_model)
# plot the classification
sits_plot(class.tb)
# }

Run the code above in your browser using DataLab