independent_eval1 {enmpa} | R Documentation |
Evaluate final models using independent data
Description
Final evaluation steps for model predictions using an independent dataset (not used in model calibration).
Usage
independent_eval1(prediction, threshold, test_prediction = NULL,
lon_lat = NULL)
independent_eval01(prediction, observation, lon_lat = NULL)
Arguments
prediction |
(numeric) vector or |
threshold |
(numeric) the lowest predicted probability value for an occurrence point. This value must be defined for presences-only data. Default = NULL. |
test_prediction |
(numeric) vector of predictions for independent data. Default = NULL. |
lon_lat |
matrix or data.frame of coordinates (longitude and latitude,
in that order) of independent data. Points must be located within the valid
area of |
observation |
(numeric) vector of observed (known) values of presence
or absence to test against |
Value
A data.frame or list containing evaluation results.
Examples
# Independent test data based on coordinates (lon/lat WGS 84) from presence
# and absences records
data("test", package = "enmpa")
head(test)
# Loading a model prediction
pred <- terra::rast(system.file("extdata", "proj_out_wmean.tif",
package = "enmpa"))
terra::plot(pred)
# Evaluation using presence-absence data
independent_eval01(prediction = pred, observation = test$Sp,
lon_lat = test[, 2:3])
# Evaluation using presence-only data
test_p_only <- test[test$Sp == 1, ]
th_maxTSS <- 0.1274123 # threshold based on the maxTSS
independent_eval1(prediction = pred, threshold = th_maxTSS,
lon_lat = test_p_only[, 2:3])