[Biomod-commits] myBiomodModelEval in biomod2
Anne Blach Overgaard
overgaardanne at gmail.com
Mon Jan 7 11:23:42 CET 2013
Dear Damien/list
I have just recently started using biomod2 (newest version with R2.15.2)
instead of BIOMOD and I am still getting used to the new code. I have run
into an issue I hope you can assist me with.
Running biomod2 using the script below runs smoothly and I get no error
messages. However, when I try to assess the evaluation of the different
models I get the R output pasted below with NA's for all dimensions.
With a data split of 80 surely some evaluation should be done or have I
made a mistake in my script somewhere that I cannot seem to spot?
Thanks,
Anne
PS I have the same issue whether I use the dataframe data as here or a
rasterstack
--------------------R input---------------------------------------
#Load required data
Data <- read.table("BIOMOD_envSP_full_data.txt", h=T, sep="\t")
#Read species data file
Sp.data <- Data[, c(2:3, 34)]
### Fill 'NAs'
Sp.data[Sp.data==0] <- NA
#read environmental data
Env <- Data[, 4:33]
#Load the library
library(biomod2)
### definition of data
myResp <- (Sp.data["B_aeth"])
# get NAs id
na.id <- which(is.na(Sp.data))
myRespCoord = Sp.data[-na.id, c('X', 'Y')] ## coordinates of the
presence-only data
myRespName = "B_aeth"
#Format data to biomod2
myBiomodData <- BIOMOD_FormatingData(resp.var = myResp, expl.var = Env,
resp.xy = myRespCoord, resp.name = myRespName, PA.nb.rep = 1,
PA.nb.absences = 10000, PA.strategy = 'random')
#Check input data
myBiomodData
#View the input data
plot(myBiomodData)
### Options definition
myBiomodOption <- BIOMOD_ModelingOptions(MAXENT = list(path_to_maxent.jar =
"C:\\Maxent\\", maximumiterations = 500), GBM = list(n.trees = 3000,
cv.folds = 5))
### Modelling
myBiomodModelOut <- BIOMOD_Modeling(myBiomodData, models =
c('MAXENT','GBM'), models.options = myBiomodOption, NbRunEval=1,
DataSplit=80, Yweights=NULL, VarImport=0, models.eval.meth =
c('TSS','ROC'), SaveObj = TRUE, rescal.all.models = TRUE)
#model evaluation
myBiomodModelEval <- getModelsEvaluations(myBiomodModelOut)
dimnames(myBiomodModelEval)
myBiomodModelEval
------------------R output------------------
> myBiomodModelEval
, , MAXENT, RUN1, PA1
Testing.data Cutoff Sensitivity Specificity
TSS NA NA NA NA
ROC NA NA NA NA
, , GBM, RUN1, PA1
Testing.data Cutoff Sensitivity Specificity
TSS NA NA NA NA
ROC NA NA NA NA
, , MAXENT, Full, PA1
Testing.data Cutoff Sensitivity Specificity
TSS NA NA NA NA
ROC NA NA NA NA
, , GBM, Full, PA1
Testing.data Cutoff Sensitivity Specificity
TSS NA NA NA NA
ROC NA NA NA NA
More information about the Biomod-commits
mailing list