View source: R/AgroSoil_generic_functions.R
LLTO_cv | R Documentation |
Assess model performance (R2, RMSE, ME) via a Leave Location Time Out Cross validation algorithm (LLTO-CV).
LLTO_cv( log_ = FALSE, targ_var, reg_mat_, pnts_cv, idcol, nfold, fmula, kan, month.lst_, pred.year_, method = "ranger" )
log_ |
TRUE/FALSE. Whether to noramalise observed and predicted soil moisture measurements during RMSE estimation. |
targ_var |
Predicted target variable |
reg_mat_ |
Regression matrix for cross validation |
pnts_cv |
Object of class SpatialPoints dataframe |
idcol |
Column name / Station ID of in situ measurement |
nfold |
Numeric. Number of cross validation folds |
fmula |
Regression formula |
kan |
Character. Single month of the targetted soil moisture prediction year. Values are abbreviated month name. E.g. "Jan", "Mar", "Oct". |
month.lst_ |
Vector or a list. All months of the targetted soil moisture prediction year. |
pred.year_ |
Numeric. Single soil moisture prediction year |
method |
Algorithm for LLTO. Default value is "ranger". Other option is "ensemble" for coupling Random forest (ranger) and Gradient boost (Xgboost) algorithms. |
A list with CV resutls (Observed, predicted and performance metrics)
library(raster) library(caret) library(ranger) library(DescTools) out <- LLTO_cv(log_, targ_var, reg_mat_, pnts_cv, idcol, nfold, fmula, kan, month.lst_, pred.year_, method)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.