Comments (1)
Hi
Thank you so much for reporting it. Now fit_max, tune_max, and esm_max functions can fit maxent model with presences and background points. However, if you intend to compare maxent with other algorithms (e.g., RF, SVM, GAM), I strongly recommend fitting maxent with presences-pseudo-absences (or presences-absences) and background points. If those three data types are used in fit_max, tune_max, and esm_max, models will be fitted with presences and background points and validated with presence and pseudo-absences (or absences). See in the new package documentation about these fitting options.
Here is an example of how to fit maxent with only with presences and background points
Cheers
require(flexsdm)
require(dplyr)
data("abies")
data("backg")
abies # environmental conditions of presence-absence data
backg # environmental conditions of background points
# Using k-fold partition method
# Remember that the partition method, number of folds or replications must
# be the same for presence-absence and background points datasets
abies <- abies %>% dplyr::filter(pr_ab==1) %>% dplyr::slice_sample(prop = 0.5)
abies2 <- part_random(
data = abies,
pr_ab = "pr_ab",
method = c(method = "kfold", folds = 3)
)
abies2
backg <- backg %>% dplyr::slice_sample(prop = 0.5)
set.seed(1)
backg <- dplyr::sample_n(backg, size = 2000, replace = FALSE)
backg2 <- part_random(
data = backg,
pr_ab = "pr_ab",
method = c(method = "kfold", folds = 3)
)
backg
gridtest <-
expand.grid(
regmult = seq(0.1, 3, 0.5),
classes = c("l", "lq", "lqh")
)
max_t1 <- tune_max(
data = abies2,
response = "pr_ab",
predictors = c("aet", "pH", "awc", "depth"),
predictors_f = c("landform"),
partition = ".part",
background = backg2,
grid = gridtest,
thr = "max_sens_spec",
metric = "TSS",
clamp = TRUE,
pred_type = "cloglog",
n_cores = 6 # activate six cores for speed up this process
)
max_t1
plot(max_t1$model, type="cloglog")
from flexsdm.
Related Issues (20)
- Package download problem HOT 1
- esm_raf not present? HOT 5
- Memory overflow HOT 3
- rlayer argument in sample_background() function
- how to create multi band raster HOT 2
- Predicting PCA HOT 1
- Partial dependence plots for ensemble models HOT 1
- Subscript out of bounds HOT 1
- Evaluation over training dataset (explanatory power)
- occfilt_geo() only works with "x" and "y" columns HOT 1
- rev_jack breaks when v has more than one element
- response curves HOT 1
- correct_colinvar() for pearson method do not return 3 objects, only 2 objects HOT 1
- Allow extra_eval to calculate extrapolation for multiple environments
- Out of memory when using sdm_predict HOT 2
- Survey data bias grid example? HOT 1
- Can´t fit random effects with fit_gam? HOT 1
- bootstrap method using part_random requires presence-absence column to be named "pr_ab"
- part_sblock is using `&&` operators with vectors that have length bigger than 1 and is causing an error
- variable importance HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flexsdm.