danlwarren / enmtools Goto Github PK
View Code? Open in Web Editor NEWENMTools R Package
ENMTools R Package
They're in the output under $test.results$obs, but aren't given in the summaries.
Just a thought - if passed an env with more than two layers, can we bash things together so that visualize.enm does a PCA on those layers and plots model predictions in that PC space? It could definitely be quite complicated to do - we're passing in a model that makes predictions onto the raw predictor values as well as some test data that we need to associate with predictor values (although that's already being done). It would be easy to just make the PCA heatmap of model predictions, but getting the background density and points into that same PC space could be quite challenging.
Suggested by Andrey Lissovsky:
Maxent uses parameter of its temp directory (path="") and writes a number of files with identical names there. Maxent will work on parallel cores only if "path" parameter will be unique for each core. Otherwise it will overwrite its own files.
Seems like the reasonable thing to do.
Ecospat tests are currently dying if any occurrence points return NA from the environmental layers. That's due to this line:
sp1.bg.env <- cbind(rep(paste0(species.1$species.name, ".bg"), nrow(species.1$background.points)),
species.1$background.points,
sp1.bg.env[complete.cases(sp1.bg.env),])
And the same for sp2. Basically the "complete.cases" bit is throwing away the NAs, which results in a mismatch of column lengths. Should probably just cbind everything together and then do complete.cases after. Not sure how widespread this issue is, but could be affecting other tests as well.
Eh?
Get some of that spatially structured crossvalidation realness UIH
For some reason the predict function isn't liking these models in environment space. The workaround we've got in place is just to not calculate it if the results look weird, but that's not ideal.
And maybe add some data/predictor bootstrapping options too?
It could be nice to have a single function called "interactive.plots" or something like that that takes models, species, and test results (when appropriate) and calls a dedicated interactive plot function based on that class.
Drop from list and tree
The argument is already there, but the function isn't really set up to handle it. Shouldn't take long.
Though the RandomForest
package is still the most popular by a wide margin, and still works pretty good, it is getting a little long in the tooth. There are several newer packages for random forest that are much faster and more feature rich, including the ranger
package (https://github.com/imbs-hl/ranger). I think it would make sense to implement a new random forest-based model with ranger
(this would help with the phylogenetic eigenvector stuff I want to do too). I'm happy to implement this if you are not against it. I won't replace enmtools.rf
just yet, but rather add an enmtools.rf.ranger
or something like that.
See above
Dear ENMtools users/developers
As a part of my research, I want to calculate “niche overlap” for two species (one carnivore and one herbivore species). I have used MaxEnt to produce ENM for each one in the raw format (MaxEnt 3.4.1). I found that there are some functions in ENMtool which can be used for this purpose, but my problem is that these suitability layers have resulted from different background points (10000 points) and also the number of presence points which are used in MaxEnt is not same for these species. Could you please tell me your point of view in this way?
Best regards
Travis CI is barfing an error based on this bit:
if(normalise) {
getValues(suitability) <- getValues(suitability) / sum(getValues(suitability), na.rm = TRUE)
}
It seems like the issue is that you can't use getValues to assign values to the raster. There's actually a function in ENMTools for this which I think we could use, raster.standardize. You can just do:
if(normalise) {
suitability <- raster.standardize(suitability)
}
I went ahead and did that on the cranify branch, but we'll need to do some checking before merging it in to master.
Dear ENMTools users
I need to use this package to produce habitat suitability layers for some species. I have found the optimum regularization multiplier and also feature type before, but I can't find the relevant arguments for these settings in "enmtools.maxent". also I have the same problem to use predefined background points instead of random points. Any comments to solve the problem is highly appreciated.
Should accept either a set of layers (as currently implemented) or a list of limits.
B1 in env space seems to just be a perfectly smooth increasing function of the number of generations. That's obviously not right at all. Here's B1:
And here's B2, acting as it should:
Notice that there's a large difference in scales there.
I'm playing around with it, but I haven't yet figured out what the issue is.
Also consider doing the CIs like RWTY does.
Currently I've got it set up on the RF branch to just set node labels to NULL within the function. That's not ideal, though; need to chase down what's going on there and fix it.
We need something we can pass enmtools.model objects to to make projections to other times/places. Would be nice to wrap those prediction objects up with some sort of other plots comparing environment spaces, etc.
The issue is with density()
. Any NAs causes it to fail. There is a na.rm
parameter in density()
, so the easiest would be to just add this in. At the moment this causes the entire modeling function to error out, so would be good to fix this, since NAs are not uncommon to get (e.g. if a few points fall off the coast, or in a lake, or something, where the env
raster has no value).
This also made me think it might be worth adding some flags to the parameters of the main modelling function to turn on or off different parts of the function. In other words, I may not need marginal.plots, so I can turn them off to, 1) speed up function, or 2) if marginal.plot (or any other section) is causing an error, I can just turn it off, rather than having to post an issue and getting it fixed before I can proceed with my analysis.
Make map summarizing blob reps
Store maps in rangebreak objects
If the enmtools.species$range
is empty, plot.enmtools.species
does not work, because plotting the presence and background points is done with points()
, which does not work if there is not already a plot on the graphics device (which only happens if the 'range' slot is not missing, currently.
is a funny word in that I can never remember how many Ls go where
Add options to enmtools.ppmlasso
to do more of the advanced features of ppmlasso
, such as point interaction models, which allows occurrence points to 'interact', e.g. attract or repulse each other to deal with clustering or overdispersion of sampling relative to a Poisson model. Also, automatically finding ideal number of background points, etc.
Apparently it's causing some problems when Biomod is loaded.
For models where a specific formula is passed, we need to make sure response.plots is only producing plots with those variables. As it is, it'll make a plot for everything in env, with just a flat line for variables that weren't used in the model.
I really ought to write a function that goes through a .csv file and builds a species object for each unique value in the species column and runs it through check.species. Idea being you'd pass it a file with ten species' occurrences in it, it passes back a list of ten enmtools.species objects with species.name and presence.points fields automatically populated.
It'd be nice for a bunch of purposes, but even more so when people are doing analyses for entire clades.
What do you think about adding this null model for phylogenetic niche divergence?
See: http://onlinelibrary.wiley.com/doi/10.1111/jbi.12910/full
Make sure there's some independence between pseudoreps and also reduce redundant processing time when you've already modeled a particular split.
I should do something about that.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.