Giter Club home page Giter Club logo

Comments (6)

simonrolph avatar simonrolph commented on May 29, 2024 1

I've added a gist here:
https://gist.github.com/simonrolph/d38d2d5a56a95782786a04f7178bdb34

I have added a CRS (wgs84) to all the layers now (I think) but I still get the error. However if I use xgboost then it works fine.

from ibis.isdm.

simonrolph avatar simonrolph commented on May 29, 2024 1

Thanks Martin! Yes I think it was my library being out of date because it works fine now. Assertion messages look useful too

from ibis.isdm.

simonrolph avatar simonrolph commented on May 29, 2024

Ok bear with, I also get the error if I add a CRS

> print(mod)
<Biodiversity distribution model>
Background extent: 
     xmin: -1.5, xmax: 53,
     ymin: 0, ymax: 54
   projection: +proj=longlat +datum=WGS84 +no_defs
 --------- 
Biodiversity data:
   Point - Presence only <173 records>
 --------- 
  predictors:     env1, env2, env3 (3 predictors)
  priors:         <Default>
  latent:         None
  log:            <Console>
  engine:         <INLABRU>
> 
> plot(mod$biodiversity)
> 
> 
> fit <- train(mod,
+              runname =  "Test INLA run",
+              verbose = T #
+              )
[Estimation] 2023-08-16 10:04:48 | Collecting input parameters.
[Estimation] 2023-08-16 10:04:50 | Adding engine-specific parameters.
Error in if (sf::st_is_longlat(bdry$crs)) { : 
  missing value where TRUE/FALSE needed

from ibis.isdm.

Martin-Jung avatar Martin-Jung commented on May 29, 2024

Hi, Thanks a lot for reporting!
Happy to update the error message to be more informative, can you paste me the code for the virtualspecies/NLM package so I can recreate the error? (or upload the testing files). Generally the background and the predictors should all be in similar extent and crs, but maybe there is also something that can be improved (e.g. assign the CRS to the background if missing).
M

from ibis.isdm.

simonrolph avatar simonrolph commented on May 29, 2024

So the error is occurring here:

if( sf::st_is_longlat(bdry$crs) ){
I think, maybe it's something to do with an INLA mesh, actually I'm not sure about that...

from ibis.isdm.

Martin-Jung avatar Martin-Jung commented on May 29, 2024

Hi Simon,

Thanks, I tested your gist script and it works without issues for me (my SessionInfo below). So could you please run ibis_dependencies() just to be sure that you use the latest packages (from what I can eyeball hot candidates are also sp and sf which you might need to update).

I have also added a bunch of more user friendly assertion messages that are now being raised with a provided background in distribution(), which should always have a CRS. Also added specific minimum dependencies to the description.

I pushed a new commit to the dev branch adding this (version 0.0.8, 1da5dc7).

Note: Generally the INLA implementation might need some love soon as it is currently still partly based on a mix of sp/sf and some of the code will deprecate soon'ish.

Session info on my test instance

> sessionInfo()
R version 4.2.3 (2023-03-15 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22621)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.utf8  LC_CTYPE=English_United Kingdom.utf8   
[3] LC_MONETARY=English_United Kingdom.utf8 LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.utf8    

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] sf_1.0-14            assertthat_0.2.1     uuid_1.1-0           terra_1.7-39         xgboost_1.7.5.1     
 [6] inlabru_2.8.0        INLA_23.04.24        foreach_1.5.2        Matrix_1.6-0         ibis.iSDM_0.0.8     
[11] tidyr_1.3.0          dplyr_1.1.2          virtualspecies_1.5.1 raster_3.6-23        sp_2.0-0            
[16] NLMR_1.1.1          

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.11        pillar_1.9.0       compiler_4.2.3     iterators_1.0.14   class_7.3-21      
 [6] tools_4.2.3        jsonlite_1.8.7     lifecycle_1.0.3    tibble_3.2.1       lattice_0.20-45   
[11] pkgconfig_2.0.3    rlang_1.1.1        cli_3.6.1          DBI_1.1.3          rstudioapi_0.15.0 
[16] xfun_0.39          proto_1.0.0        e1071_1.7-13       knitr_1.43         generics_0.1.3    
[21] vctrs_0.6.3        classInt_0.4-9     grid_4.2.3         tidyselect_1.2.0   data.table_1.14.8 
[26] glue_1.6.2         R6_2.5.1           fansi_1.0.4        purrr_1.0.1        magrittr_2.0.3    
[31] splines_4.2.3      codetools_0.2-19   units_0.8-3        utf8_1.2.3         KernSmooth_2.23-20
[36] proxy_0.4-27 

from ibis.isdm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.