SCM

Forum: help

Monitor Forum | Start New Thread Start New Thread
RE: biomod2 using a Random Forest regression based approach [ Reply ]
By: Maya Guéguen on 2023-11-14 09:14
[forum:49807]
Hello Gabio, Jinyu,

biomod2 has changed and improved a lot lately.
New documentation website with examples is available here : https://biomodhub.github.io/biomod2/index.html
Issues are now managed directly onto the github page : https://github.com/biomodhub/biomod2/issues
Feel free to post if you have any questions / problems, or to use it to look for similar problems.

Maya

RE: biomod2 using a Random Forest regression based approach [ Reply ]
By: Jinyu Li on 2023-08-21 00:57
[forum:49804]
Hi, Fábio,

We have encountered the same error when we tried to run the biomod2 using the Random Forest algorithm and the regression-based option activated instead of the classification approach. Should we change other parameters using the BIOMOD_ModelingOptions? How do you settled the problem?

Bests,

Jinyu

biomod2 using a Random Forest regression based approach [ Reply ]
By: Fábio Matos on 2021-01-26 16:44
[forum:48853]
Hi,

I tried to run the biomod2 using the Random Forest algorithm and the regression-based option activated instead of the classification approach (the default option in the package) to compare results between the two methods. However, the following error came out:

Error in predict.randomForest(get_formal_model(object), as.data.frame(newdata[not_na_rows, :
'prob' or 'vote' not meaningful for regression

Please find a reproducible example below. What am I doing wrong? Should I change other parameters using the BIOMOD_ModelingOptions?

Thank you in advance!

Best,
Fábio

###########

library(biomod2)


# species occurrences
DataSpecies <- read.csv(system.file("external/species/mammals_table.csv",
package="biomod2"), row.names = 1)
head(DataSpecies)

# the name of studied species
myRespName <- 'GuloGulo'

# the presence/absences data for our species
myResp <- as.numeric(DataSpecies[,myRespName])

# the XY coordinates of species data
myRespXY <- DataSpecies[,c("X_WGS84","Y_WGS84")]


# Environmental variables extracted from BIOCLIM (bio_3, bio_4, bio_7, bio_11 & bio_12)
myExpl = raster::stack( system.file( "external/bioclim/current/bio3.grd",
package="biomod2"),
system.file( "external/bioclim/current/bio4.grd",
package="biomod2"),
system.file( "external/bioclim/current/bio7.grd",
package="biomod2"),
system.file( "external/bioclim/current/bio11.grd",
package="biomod2"),
system.file( "external/bioclim/current/bio12.grd",
package="biomod2"))
# 1. Formatting Data
myBiomodData <- BIOMOD_FormatingData(resp.var = myResp,
expl.var = myExpl,
resp.xy = myRespXY,
resp.name = myRespName)

# 2. Defining Models Options using default options.
myBiomodOption <- BIOMOD_ModelingOptions()
myBiomodOption@RF$do.classif <- F


# 3. Doing Modelisation

myBiomodModelOut <- BIOMOD_Modeling( myBiomodData,
models = c('RF'),
models.options = myBiomodOption,
NbRunEval=1,
DataSplit=70,
models.eval.meth = c('TSS'),
do.full.models = FALSE)

Thanks to:
Vienna University of Economics and Business Powered By FusionForge