Learn R Programming

sits (version 1.12.0)

sits_train: Train sits classification models

Description

Given a tibble with a set of distance measures, returns trained models. Currenly, sits supports the following models: 'svm' (see sits_svm), 'random forest' (see sits_rfor), 'lda' (see sits_lda), 'qda' (see sits_qda), multinomial logit' (see sits_mlr), 'lasso' (see sits_mlr), 'ridge' (see sits_mlr), and 'deep learning' (see sits_deeplearning). The sits_train function is called inside sits_classify and sits_classify_raster, so the user does not need to explicitly use this function. Please see the above-mention classification functions.

Usage

sits_train(data.tb, ml_method = sits_svm())

Arguments

data.tb

Time series with the training samples.

ml_method

Machine learning method that returns a model for prediction.

Value

A model fitted to input data given by train_method parameter.

Examples

Run this code
# NOT RUN {
# Retrieve the set of samples for the Mato Grosso region (provided by EMBRAPA)
# find a training model based on the distances and default values (SVM model)
samples.tb <- sits_select_bands(samples_mt_9classes, ndvi, evi, nir, mir)
ml_model <- sits_train(samples.tb, sits_rfor())
# get a point and classify the point with the ml_model
point.tb <- sits_select_bands(point_mt_6bands, ndvi, evi, nir, mir)
class.tb <- sits_classify(point_mt_6bands, ml_model)
sits_plot(class.tb)
# }

Run the code above in your browser using DataLab