get_accuracy: get_accuracy

View source: R/get_accuracy.R

get_accuracyR Documentation

get_accuracy

Description

This is a function to get the predictions for a specific output simulated by SCOPE and calculate the accuracy.

Usage

get_accuracy(
  obs_vec,
  predictions,
  metric_function,
  Filter = FALSE,
  timestamp,
  month_start = 1,
  month_end = 12,
  period = c("day", "dawn_dusk", "night"),
  nu_interations,
  interations = 101,
  dryhours_vec,
  dry_hours = 0,
  neg_vec,
  neg_null = 0,
  pred_neg = 0,
  neg_values = NA,
  lat = 52.46,
  lon = 13.32
)

Arguments

obs_vec

for get_accuracy a vector of observed values in the same timestamp as the predictions.

predictions

the name of the file result of the get_predictions function.

metric_function

for get_accuracy is possible to select the metric,

Value

The result is a table with the accuracy metrics for all simulation starting with that name.

Examples

Examples of uses of the get_predictions function
###############
library(tidyverse)

possible metrics: yardstick::rmse for Root mean squared error,
                  yardstick::mae for Mean absolute error,
                  yardstick::msd for Mean signed deviation,
                  yardstick::ccc for Concordance correlation coefficient,
                  yardstick::mase for Mean absolute scaled error - order by time
                  yardstick::rsq for R squared - correlation
                  yardstick::rsq_trad for R squared - traditional
                  yardstick::rpiq for Ratio of performance to inter-quartile
                  yardstick::rpd for Ratio of performance to deviation
                  yardstick::iic for Index of ideality of correlation
                  yardstick::mpe for Mean percentage error
                  yardstick::mape for Mean absolute percent error
                  yardstick::smape for Symmetric mean absolute percentage error

Get model accuracy for ET corrected
Predictions_metrics_1169 <- get_accuracy(obs_vec = EC_ROTH$ET_clean0,
                                         predictions = Predictions_pixel_1169,
                                         metric_function = yardstick::metric_set(yardstick::rsq,
                                                                                 yardstick::rmse,
                                                                                 yardstick::mae))
Predictions_metrics_1169

AlbyDR/rSCOPE documentation built on Dec. 19, 2024, 7:29 p.m.