Bug fix to hinge() and check of data added#29
Open
oharar wants to merge 5 commits intomrmaxent:masterfrom
Open
Bug fix to hinge() and check of data added#29oharar wants to merge 5 commits intomrmaxent:masterfrom
oharar wants to merge 5 commits intomrmaxent:masterfrom
Conversation
… and changed documentation to make R CMD check happy.
Author
|
Added option to change weights on absences: these can be a scalar or the same length as p. This means we can use MaxNet on presence/absence data, and also test how close 100 is to infinity (or even use area based weights) |
…cumentation for ... Put .Rhistory in .gitignore
Author
|
Now if any element of the entropy has p=0, so p log p = -Inf, removes that element (=sets to 0) with a warning. Resolves #28 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've made the following changes:
maxnet()sometimes fails with hinge features #26).This code shows the changes:
library(disdat)
library(maxnet)
sp <- "nsw38"
bgEnv <- disBg("NSW")
EnvNames <- names(bgEnv)[!(names(bgEnv)%in%c("siteid", "spid", "x", "y", "occ", "group"))]
Pres <- disPo("NSW")[disPo("NSW")$spid==sp,c("occ", EnvNames)]
dat <- rbind(Pres, bgEnv[,c("occ", EnvNames)])
dat$vegsys <- factor(dat$vegsys)
This now works. Before it was causing a problem in predict.maxnet()
MaxNet.mod <- maxnet(p=dat$occ, data=dat[,EnvNames],
f=maxnet.formula(p=dat$occ, data=dat[,EnvNames],
classes="h"))
dat$One <- rep(1, nrow(dat))
EnvNames1 <- c(EnvNames, "One")
This now gives an informative error
MaxNet.mod <- maxnet(p=dat$occ, data=dat[,EnvNames1],
f=maxnet.formula(p=dat$occ, data=dat[,EnvNames1],
classes="h"))