Dear list member,

I am running a maxent model in dismo package and I got AUC = 1, but I am 
not sure if this is right.  Is there a way to find out if my evaluation 
is correct?
Here is my code:

# fit model
me <- maxent(predictores, dendro)

# plot showing importance of each variable
plot(me)

# predict to entire dataset
r <- predict(me, predictores, progress='text')
# r <- predict(me, predictors, progress='text', args=c("outputformat=raw"))

plot(r)
points(dendro)


# The below is equivalent (except that we use
# k-fold partitioning of the data for testing purposes

# extract values
pv <- data.frame(xyValues(predictores, dendro))
fp <- kfold(pv, k=5)
pvtrain <- pv[fp != 1, ]
pvtest <- pv[fp == 1, ]
head(pvtest)

# background data
bg <- randomPoints(predictores, 210)
av <- data.frame(xyValues(predictores, bg))
fb <- kfold(av, k=5)
avtrain <- av[fb != 1, ]
avtest <- av[fb == 1, ]

# combine train presence and background data
train <- rbind(pvtrain, avtrain)
# vector indicating presence or absence
p <- c(rep(1, nrow(pvtrain)), rep(0, nrow(avtrain)))

# fit maxent model
me2 <- maxent(x=train, p=p)

# predict to testing points
testp <- predict(me, pvtest)
head(testp)
testa <- predict(me, avtest)

#evaluate
e = evaluate(p=testp, a=testa)
e
plot(e, 'ROC')

RESULTADOS:
 > e
class            : ModelEvaluation
n presences      : 14
n absences       : 42
AUC              : 1
cor              : 0.9428767
TPR+TNR threshold: 0.04


Thank you very much in advance.
Best,

Manuel


-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.ac.cr
mspinol...@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río 
<https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to