R: Cross-validate temporal patterns

sits_kfold_validate {sits} | R Documentation

## Cross-validate temporal patterns

### Description

Splits the set of time series into training and validation and perform k-fold cross-validation. Cross-validation is a technique for assessing how the results of a statistical analysis will generalize to an independent data set. It is mainly used in settings where the goal is prediction, and one wants to estimate how accurately a predictive model will perform. One round of cross-validation involves partitioning a sample of data into complementary subsets, performing the analysis on one subset (called the training set), and validating the analysis on the other subset (called the validation set or testing set).

The k-fold cross validation method involves splitting the dataset into k-subsets. For each subset is held out while the model is trained on all other subsets. This process is completed until accuracy is determine for each instance in the dataset, and an overall accuracy estimate is provided.

This function returns the confusion matrix, and Kappa values.

### Usage

    sits_kfold_validate(
      data,
      folds = 5,
      ml_method = sits_rfor(),
      multicores = 2,
      progress = FALSE
    )

### Arguments

`data` | A sits tibble.
`folds` | Number of partitions to create.
`ml_method` | Machine learning method.
`multicores` | Number of cores for processing.
`progress` | A logical value indicating if a progress bar should be shown

### Value

A tibble containing pairs of reference and predicted values.

### Author(s)

Rolf Simoes, rolf.simoes@inpe.br

Gilberto Camara, gilberto.camara@inpe.br

### Examples

    # read a set of samples
    data(cerrado_2classes)
    # two fold validation with random forest
    acc <- sits_kfold_validate(cerrado_2classes,
        folds = 2,
        ml_method = sits_rfor(num_trees = 300)
    )

[Package sits version 0.14.0 Index]