PoisotLab / SimpleSDMLayers.jl

Simple layers for species distribution modeling and bioclimatic data
https://docs.ecojulia.org/SimpleSDMLayers.jl/stable/
MIT License
19 stars 2 forks source link

sdm example --- mv logistic regression #64

Closed gottacatchenall closed 3 years ago

codecov-io commented 3 years ago

Codecov Report

Merging #64 (546e425) into master (d714156) will decrease coverage by 0.60%. The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #64      +/-   ##
==========================================
- Coverage   85.30%   84.69%   -0.61%     
==========================================
  Files          22       22              
  Lines         483      490       +7     
==========================================
+ Hits          412      415       +3     
- Misses         71       75       +4     
Flag Coverage Δ
unittests 84.69% <50.00%> (-0.61%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/lib/overloads.jl 90.62% <42.85%> (-3.76%) :arrow_down:
src/recipes/recipes.jl 93.10% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d714156...546e425. Read the comment docs.

tpoisot commented 3 years ago

Here's my unsollicited review:

I love the example, I'll have more feedback when the issues raised in #59 are solved (later tonight)

gottacatchenall commented 3 years ago

sounds good, i'll make those changes and hopefully add some more text explaining whats happening tonight/tomorrow

tpoisot commented 3 years ago

It would be cool to use the same occurrences across all examples, I think - I'm changing #61 to use the data from https://jcoliver.github.io/learn-r/011-species-distribution-models.html -- there's not too many points, and the spatial scale is relatively small

tpoisot commented 3 years ago

I'm just going to make this catch up with master

tpoisot commented 3 years ago

I'm also going to do a bunch of edits to make sure it follows the conventions of the package and other example

tpoisot commented 3 years ago

Here's an output -- will push my code soon

mvlogit

I am sub-sampling a little bit because running the chains takes a little time, and the github actions VMs are not going to like that.

tpoisot commented 3 years ago

And with this last commit, the example should run -- I'll let you add some text, etc. I might add another example using Flux where we sample the negatives within a radius around observations, that might be fun to write.

tpoisot commented 3 years ago

Hmmmm.... we might have to scale this example down to get it to run in a reasonable amount of time. I'll think about something suitable.

gottacatchenall commented 3 years ago

the saguaro data covers a much smaller spatial extent which could speed things up, and currently i'm using MvNormal and fitting all layers of worldclim (basically trying to overfit), which i think would be faster with fewer variables and a Normal for each

tpoisot commented 3 years ago

What about the Corsican nuthatch? It's very limited in space (to Corsica), do we have enough observations on GBIF?

gottacatchenall commented 3 years ago

Corsican nuthatch runs pretty fast even with all predictors. Added some text, might add more later

tpoisot commented 3 years ago

So this apparently times out. Is the example so large?

tpoisot commented 3 years ago

One thing I had to do for the Mangal documentation was to have Weave documents, which we can run in parallel, for the most intensive tasks.

gottacatchenall commented 3 years ago

Weaving might be necessary as any other examples are likely to be more complex and slower, I can implement the changes from above and try that later

tpoisot commented 3 years ago

or.... we can make a repo for vignettes? Let's take a few days to think about it.

tpoisot commented 3 years ago

Alternatively, what do you think about getting some examples from Berteaux's book? They mostly use bioclim 1 and 12, and we can still do some work with two predictors for now.

gottacatchenall commented 3 years ago

that works, also Fletcher&Fortin 2019 have a lot of examples and data sets with implementations in R, wouldn't be hard to port them