Learn R Programming

sits (version 1.12.0)

sits_svm: Train a sits classification model using a support vector machine

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 SVM algorithm is used for multiclass-classification. For this purpose, it uses the "one-against-one" approach, in which k(k-1)/2 binary classifiers are trained; the appropriate class is found by a voting scheme. This function is a front-end to the "svm" method in the "e1071" package. Please refer to the documentation in that package for more details.

Usage

sits_svm(data.tb = NULL, formula = sits_formula_logref(),
  scale = FALSE, cachesize = 1000, kernel = "radial", degree = 3,
  coef0 = 0, cost = 10, tolerance = 0.001, epsilon = 0.1,
  cross = 0, ...)

Arguments

data.tb

Time series with the training samples.

formula

Symbolic description of the model to be fit. Package sits offers a set of such formulas (default: sits_svm).

scale

Logical vector indicating the variables to be scaled.

cachesize

Cache memory in MB (default = 1000).

kernel

Kernel used in training and predicting. Available options are "linear", "polynomial", "radial", "sigmoid" (default: "radial").

degree

Exponential of polynomial type kernel (default: 3).

coef0

Parameter needed for kernels of type polynomial and sigmoid (default: 0).

cost

Cost of constraints violation.

tolerance

Tolerance of termination criterion (default: 0.001).

epsilon

Epsilon in the insensitive-loss function (default: 0.1).

cross

Number of cross validation folds applied on the training data to assess the quality of the model.

...

Other parameters to be passed to e1071::svm function.

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 SVM model
svm_model <- sits_train(samples_mt_ndvi, sits_svm())
# get a point
data(point_ndvi)
# classify the point
class.tb <- sits_classify (point_ndvi, svm_model)
# plot the classification
sits_plot(class.tb)
# }

Run the code above in your browser using DataLab