Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mopaTrain #21

Open
Guankuiliu opened this issue Nov 21, 2024 · 0 comments
Open

mopaTrain #21

Guankuiliu opened this issue Nov 21, 2024 · 0 comments

Comments

@Guankuiliu
Copy link

Guankuiliu commented Nov 21, 2024

Version 1.1.2 cannot even run the example functions inside mopaTrain.

library(mopa)

## Data pre-processing and pseudo-absence data generation
data(Oak_phylo2)
data(biostack)

## Spatial reference
r <- biostack$baseline[[1]]
## Create background grid
bg <- backgroundGrid(r)

## Generate pseudo-absences
RS_random <-pseudoAbsences(xy = Oak_phylo2, background = bg$xy, 
                           exclusion.buffer = 0.083*5, prevalence = -0.5, kmeans = FALSE)
## Model training
fittedRS <- mopaTrain(y = RS_random, x = biostack$baseline, 
                      k = 10, algorithm = "glm", weighting = TRUE)
## Extract fitted models
mods <- extractFromModel(models = fittedRS, value = "model")

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant