Package: metrica 2.1.0

metrica: Prediction Performance Metrics

A compilation of more than 80 functions designed to quantitatively and visually evaluate prediction performance of regression (continuous variables) and classification (categorical variables) of point-forecast models (e.g. APSIM, DSSAT, DNDC, supervised Machine Learning). For regression, it includes functions to generate plots (scatter, tiles, density, & Bland-Altman plot), and to estimate error metrics (e.g. MBE, MAE, RMSE), error decomposition (e.g. lack of accuracy-precision), model efficiency (e.g. NSE, E1, KGE), indices of agreement (e.g. d, RAC), goodness of fit (e.g. r, R2), adjusted correlation coefficients (e.g. CCC, dcorr), symmetric regression coefficients (intercept, slope), and mean absolute scaled error (MASE) for time series predictions. For classification (binomial and multinomial), it offers functions to generate and plot confusion matrices, and to estimate performance metrics such as accuracy, precision, recall, specificity, F-score, Cohen's Kappa, G-mean, and many more. For more details visit the vignettes <https://adriancorrendo.github.io/metrica/>.

Authors:Adrian A. Correndo [aut, cre, cph], Luiz H. Moro Rosso [aut], Rai Schwalbert [aut], Carlos Hernandez [aut], Leonardo M. Bastos [aut], Luciana Nieto [aut], Dean Holzworth [aut], Ignacio A. Ciampitti [aut]

metrica_2.1.0.tar.gz
metrica_2.1.0.zip(r-4.5)metrica_2.1.0.zip(r-4.4)metrica_2.1.0.zip(r-4.3)
metrica_2.1.0.tgz(r-4.4-any)metrica_2.1.0.tgz(r-4.3-any)
metrica_2.1.0.tar.gz(r-4.5-noble)metrica_2.1.0.tar.gz(r-4.4-noble)
metrica_2.1.0.tgz(r-4.4-emscripten)metrica_2.1.0.tgz(r-4.3-emscripten)
metrica.pdf |metrica.html
metrica/json (API)
NEWS

# Install 'metrica' in R:
install.packages('metrica', repos = c('https://adriancorrendo.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/adriancorrendo/metrica/issues

Datasets:

On CRAN:

8.19 score 74 stars 52 scripts 398 downloads 95 exports 58 dependencies

Last updated 4 months agofrom:f01f1cf588. Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKOct 28 2024
R-4.5-winOKOct 28 2024
R-4.5-linuxOKOct 28 2024
R-4.4-winOKOct 28 2024
R-4.4-macOKOct 28 2024
R-4.3-winOKOct 28 2024
R-4.3-macOKOct 28 2024

Exports:ACaccuracyagfAUC_rocB0_smaB1_smabalaccbland_altman_plotbmiCCCconfusion_matrixcsidd1d1rdcorrdeltapdensity_plotdorE1Erelerror_rateFDRfmiFNRFORFPRfscoregmeanhitrateimport_apsim_dbimport_apsim_outiqRMSEjaccardindexjindexKGEkhatlambdaLCSMAEMAPEMASEMBEmccmetrics_summaryMICmkMLAMLPMSEnegLrnpvNSEp4PABPBEphi_coefPLAPLPposLrPPBppvprecisionprevalpreval_trR2RACRAErecallRMAERMLARMLPRMSERRMSERSERSRRSSSBscatter_plotSDSDselectivitysensitivitySMAPEspecificitytiles_plotTNRTPRTSSUbUcUeuSDvar_uXa

Dependencies:bitbit64blobbootcachemclicolorspacecpp11DBIdplyrenergyfansifarverfastmapgenericsggplot2ggppgluegridExtragslgtableisobandlabelinglatticelifecyclelubridatemagrittrMASSMatrixmemoisemgcvminervamunsellnlmepillarpkgconfigplogrpolynompurrrR6RColorBrewerRcppRcppArmadillorlangRSQLitescalesstringistringrtibbletidyrtidyselecttimechangeutf8vctrsviridisLitewithrxtszoo

Importing APSIM Classic and NewGeneration files

Rendered fromapsim_open.Rmdusingknitr::rmarkdownon Oct 28 2024.

Last update: 2024-03-24
Started: 2022-07-03

Cheatsheet

Rendered fromCheatsheet.Rmdusingknitr::rmarkdownon Oct 28 2024.

Last update: 2024-06-30
Started: 2023-03-13

Classification case: Assessing the performance of remote sensing models

Rendered fromclassification_case.Rmdusingknitr::rmarkdownon Oct 28 2024.

Last update: 2024-03-24
Started: 2022-06-22

Classification performance metrics and indices

Rendered fromavailable_metrics_classification.Rmdusingknitr::rmarkdownon Oct 28 2024.

Last update: 2024-06-30
Started: 2022-07-03

JOSS publication

Rendered fromJOSS_publication.Rmdusingknitr::rmarkdownon Oct 28 2024.

Last update: 2024-03-24
Started: 2023-03-13

Regression case: Assessing model agreement in wheat grain nitrogen content prediction

Rendered fromregression_case.Rmdusingknitr::rmarkdownon Oct 28 2024.

Last update: 2024-06-30
Started: 2022-06-22

Regression performance metrics and indices

Rendered fromavailable_metrics_regression.Rmdusingknitr::rmarkdownon Oct 28 2024.

Last update: 2024-03-24
Started: 2022-07-03

Shinyapp

Rendered fromShinyapp.Rmdusingknitr::rmarkdownon Oct 28 2024.

Last update: 2024-03-24
Started: 2023-03-13

Readme and manuals

Help Manual

Help pageTopics
Ji and Gallo's Agreement Coefficient (AC)AC
Accuracyaccuracy
Adjusted F-scoreagf
Area Under the ROC CurveAUC_roc
Intercept of standardized major axis regression (SMA).B0_sma
Slope of standardized major axis regression (SMA).B1_sma
Balanced Accuracybalacc
Barley grain numberbarley
Bland-Altman plotbland_altman_plot
Bookmaker Informednessbmi jindex
Concordance correlation coefficient (CCC)CCC
Chickpea dry masschickpea
Confusion Matrixconfusion_matrix
Critical Success Index | Jaccard's Indexcsi jaccardindex
Willmott's Index of Agreement (d)d
Modified Index of Agreement (d1).d1
Refined Index of Agreement (d1).d1r
Distance Correlationdcorr
deltaP or Markednessdeltap mk
Density plot of predicted and observed valuesdensity_plot
Absolute Model Efficiency (E1)E1
Relative Model Efficiency (Erel)Erel
Error rateerror_rate
Fowlkes-Mallows Indexfmi
F-scorefscore
Geometric Meangmean
Import SQLite databases generated by APSIM NextGenimport_apsim_db
import_apsim_outimport_apsim_out
Inter-Quartile Root Mean Squared ErroriqRMSE
Kling-Gupta Model Efficiency (KGE).KGE
K-hat (Cohen's Kappa Coefficient)khat
Duveiller's Agreement Coefficientlambda
Binary Land Cover Dataland_cover
Lack of Correlation (LCS)LCS
Likelihood Ratios (Classification)dor likelihood_ratios negLr posLr
Mean Absolute Error (MAE)MAE
Multi Class Phenologymaize_phenology
Mean Absolute Percentage Error (MAPE)MAPE
Mean Absolute Scaled Error (MASE)MASE
Mean Bias Error (MBE)MBE
Matthews Correlation Coefficient | Phi Coefficientmcc phi_coef
Prediction Performance Summarymetrics_summary
Maximal Information CoefficientMIC
Mean Lack of Accuracy (MLA)MLA
Mean Lack of Precision (MLP)MLP
Mean Squared Error (MSE)MSE
Negative Predictive ValueFOR npv
Nash-Sutcliffe Model Efficiency (NSE)NSE
P4-metricp4
Percentage Additive Bias (PAB)PAB
Percentage Bias Error (PBE).PBE
Percentage Lack of Accuracy (PLA)PLA
Percentage Lack of Precision (PLP)PLP
Percentage Proportional Bias (PPB)PPB
Precision | Positive Predictive ValueFDR ppv precision
Prevalencepreval prevalence preval_t
Sample Correlation Coefficient (r)r
Coefficient of determination (R2).R2
Robinson's Agreement Coefficient (RAC).RAC
Relative Absolute Error (RAE)RAE
Recall | Sensitivity | True Positive Rate | Hit rateFNR hitrate recall sensitivity TPR
Relative Mean Absolute Error (RMAE)RMAE
Root Mean Lack of Accuracy (RMLA)RMLA
Root Mean Lack of Precision (RMLP)RMLP
Root Mean Squared Error (RMSE)RMSE
Relative Root Mean Squared Error (RMSE)RRMSE
Relative Squared Error (RSE)RSE
Root Mean Standard Deviation Ratio (RSR)RSR
Residual Sum of Squares (RSS)RSS
Squared bias (SB)SB
Scatter plot of predicted and observed valuesscatter_plot
Squared difference between standard deviations (SDSD)SDSD
Symmetric Mean Absolute Percentage Error (SMAPE).SMAPE
Sorghum grain numbersorghum
Specificity | Selectivity | True Negative RateFPR selectivity specificity TNR
Tiles plot of predicted and observed valuestiles_plot
Total Sum of Squares (TSS)TSS
Mean Bias Error Proportion (Ub)Ub
Lack of Consistency (Uc)Uc
Lack of Consistency (Ue)Ue
Uncorrected Standard DeviationuSD
Uncorrected Variance (var_u)var_u
Wheat grain nitrogenwheat
Accuracy Component (Xa) of CCCXa