Description Usage Arguments Details Value Author(s) See Also Examples
Find the threshold maximising either Kappa or True Skill Statistic
1 | KappaRepet(Obs, Fit, TSS = FALSE)
|
Obs |
vector of observed data, coded in 0 (absent) and 1 (present) |
Fit |
vector of predicted data from distribution models, usually ranging from 0 to 1 |
TSS |
logical. Should TSS be calculated instead of Kappa? |
Build a mis-classification matrix for incremental thresholds, estimate the Kappa or TSS and find the threshold that maximise on the statistics.
A vector with Kappa or TSS, the selected threshold (CutOff), the true positive (TP), the sensitivity (se) that is the percentage of true positive, the true negative (TN) and the specificity (sp) that is the percentage of true false positive.
Wilfried Thuiller, Bruno Lafourcade
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ## Not run:
data(Sp.Env)
data(CoorXY)
#This command is necessary for the run of BIOMOD as a new dataframe is produced for the Models function
Initial.State(Response=Sp.Env$Sp281, Explanatory=Sp.Env[,4:10], sp.name='Sp281',
IndependentResponse=NULL, IndependentExplanatory=NULL)
#Here are done a lone full run. This will hence take several minutes.
Models(RF=TRUE, SRE=TRUE, GLM = FALSE, TypeGLM = "quad", Test = "AIC", CTA = FALSE, CV.tree = 50, ANN = FALSE, CV.ann = 2,
NbRunEval = 1, DataSplit = 100, Roc=TRUE, Optimized.Threshold.Roc=TRUE, Kappa=TRUE, TSS=TRUE, VarImport=5,
NbRepPA=0, strategy="circles", coor=CoorXY, distance=2, nb.absences=1000)
#Load the predictions
load("pred/Pred_Sp281")
## TSS estimation
MyTSS <- KappaRepet(Sp.Env$Sp281, Pred_Sp281[,"RF",1,1], TSS = TRUE)
MyTSS
ls()
# TSS estimated inside the Models function
Evaluation.results.TSS
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.