Learn R Programming

sits (version 1.1.0)

sits_formula_logref: Define a loglinear formula for classification models

Description

A function to be used as a symbolic description of some fitting models such as svm and random forest. This function tells the models to do a log transformation of the inputs. The `predictors_index` parameter informs the positions of `tb` fields corresponding to formula independent variables. If no value is given, the default is NULL, a value indicating that all fields will be used as predictors.

Usage

sits_formula_logref(predictors_index = -2:0)

Value

A function that computes a valid formula using a log function.

Arguments

predictors_index

Index of the valid columns to compose formula (default: -2:0).

Author

Alexandre Ywata de Carvalho, alexandre.ywata@ipea.gov.br

Rolf Simoes, rolf.simoes@inpe.br

Examples

Run this code
if (sits_run_examples()) {
    # Example of training a model for time series classification
    # Retrieve the samples for Mato Grosso
    # train an SVM model
    ml_model <- sits_train(samples_modis_4bands,
        ml_method = sits_svm(formula = sits_formula_logref()))
    # select the bands to classify the point
    sample_bands <- sits_bands(samples_modis_4bands)
    point_4bands <- sits_select(point_mt_6bands, bands = sample_bands)
    # classify the point
    point_class <- sits_classify(point_4bands, ml_model)
    plot(point_class)
}

Run the code above in your browser using DataLab