sits_pred_sample: Obtain a fraction of the predictors data frame

View source: R/sits_predictors.R

sits_pred_sampleR Documentation

Obtain a fraction of the predictors data frame

Description

Many machine learning algorithms (especially deep learning) use part of the original samples as test data to adjust its hyperparameters and to find an optimal point of convergence using gradient descent. This function extracts a fraction of the predictors to serve as test values for the deep learning algorithm.

Usage

sits_pred_sample(pred, frac)

Arguments

pred

X-Y predictors: a data.frame with one row per sample.

frac

Fraction of the X-Y predictors to be extracted

Value

A data.frame with the chosen fraction of the X-Y predictors.

Note

Please refer to the sits documentation available in <https://e-sensing.github.io/sitsbook/> for detailed examples.

Author(s)

Gilberto Camara, gilberto.camara@inpe.br

Examples

if (sits_run_examples()) {
    pred <- sits_predictors(samples_modis_ndvi)
    pred_frac <- sits_pred_sample(pred, frac = 0.5)
}

e-sensing/sits documentation built on Jan. 28, 2024, 6:05 a.m.