Пікірлер
@dominiquemagpatoc8291
@dominiquemagpatoc8291 12 күн бұрын
Good day, i have question about the ensemble prediction, how can I evaluate its performance?
@babaknaimi
@babaknaimi 11 күн бұрын
Hi, you may use the evaluates function, put the outcome of sdmData as the first argument, and the raster generated by ensemble as the second argumen: e <- evaluates(d, ens) e@statistics e@threshold_based
@dominiquemagpatoc8291
@dominiquemagpatoc8291 10 күн бұрын
@@babaknaimi thank you so much, it works
@tadiwanashezhuwawo3901
@tadiwanashezhuwawo3901 Ай бұрын
great video, is it possible to add new method to the package
@IrlanKehutanan
@IrlanKehutanan 3 ай бұрын
Thank you Sir but if I run df <- data.frame(species=df$species,coordinates(d)) make error Error: unable to find an inherited method for function ‘coordinates’ for signature ‘obj = "sdmdata"’.
@alexkiser4017
@alexkiser4017 6 ай бұрын
I'm having issues with spatrasters working in the ensemble function. The example code in the help section also runs into the same error. Any ideas on how to fix this? p2 <- ensemble(m, newdata=preds, filename='ens2.img',setting=list(method='weighted', stat='TSS',opt=2)) Error in .canProcessInMemory(.out[[1]], max(nlyr(.out), nlyr(newdata)) * : no slot of name "cpp" for this object of class "SpatRaster"
@SundayAdebunmiADENIRAN
@SundayAdebunmiADENIRAN 6 ай бұрын
Really love this thank you
@felipeespinoza8647
@felipeespinoza8647 7 ай бұрын
Hi! I'm having a repetitive error related to the 'newdata' part in the prediction. I followed every step in the tutorial, but it gives me: d <- sdmData(species~., spg, predictors = bioc, bg = list(method='gRandom', n=1000)) m <- sdm(species~., data = d, methods = c('brt','maxent','rf'), replication=c('sub','boot'), test.p=30, n=3) p3 <- predict(m, bioc) Error in .local(object, ...) : predict the number of values returned by the predict does not match the number of cells in newdata! I have also transformed the data manually but it doesn't seem to work, I checked the dimensions of the RasterStack and it is the same as the rest of the objects.
@biogeoinformatics
@biogeoinformatics 7 ай бұрын
It was a problem in the predict function that has been fixed in the new version. Install the latest version of the sdm package!
@felipeespinoza8647
@felipeespinoza8647 7 ай бұрын
@@biogeoinformatics Thank you, it solved the problem of the matching number of cells, but now when I run the models (m), Maxent models don't work but the rest of the algorithms work, can you give me an insight on that?
@biogeoinformatics
@biogeoinformatics 7 ай бұрын
@@felipeespinoza8647 Maxent requires rJava in R and Java on your machine (OS). You need to first install JDK on your machine (not within R; on your operating system), then it should work. You may need to restart R. You can download JDK from here: www.oracle.com/java/technologies/downloads/
@felipeespinoza8647
@felipeespinoza8647 7 ай бұрын
I did that already, and it as working, but after installing the latest version I get this error: > m2 <- sdm(species~., data = d, methods = 'maxent', replication='sub', + test.p=30, n=3) > m2 class : sdmModels ======================================================== number of species : 1 number of modelling methods : 1 names of modelling methods : maxent replicate.methods (data partitioning) : subsampling number of replicates (each method) : 3 toral number of replicates per model : 3 (per species) test percentage (in subsampling) : 30 ------------------------------------------ model run success percentage (per species) : ------------------------------------------ method species ---------------------- maxent : 0 % ################################################################### Error in if (wtest == "test.dep") cat("model Mean performance (per species), using test dataset (generated using partitioning): ") else if (wtest == : missing value where TRUE/FALSE needed
@sppervideeos4
@sppervideeos4 10 ай бұрын
By entering the density of occurrence of the species at certain points, I want to predict the density at which they can be seen at other points. Is this possible? Can you suggest any method?
@julkaditapause1774
@julkaditapause1774 10 ай бұрын
Can’t we used the uncropped predictors in prediction?
@julkaditapause1774
@julkaditapause1774 10 ай бұрын
Thank you sir for making this useful video. I face error while trying to (raster)extractspg and bioc together
@Bikgya
@Bikgya 10 ай бұрын
Great!! Video could you please make a video on the Biomod2 package?
@yifenghu3808
@yifenghu3808 11 ай бұрын
Thank you so much for your great video!
@Igy-kn3tx
@Igy-kn3tx Жыл бұрын
Can an r3PG model be included in an sdm model in R?
@yongjingwenyang
@yongjingwenyang Жыл бұрын
Thank you for the great tutorial. Have one question, how to calculate the threshold maximizing the TSS/the maximum training sensitivity plus specificity threshold?
@sanadragab7555
@sanadragab7555 Жыл бұрын
I want sdm code quickly pls
@sciencepakistan4250
@sciencepakistan4250 Жыл бұрын
Kindly add a new video as we have now CMIP 6 data.
@upheaveworker2108
@upheaveworker2108 Жыл бұрын
thanks for Sharing, really appreciate for newbie like me
@qZoneful
@qZoneful Жыл бұрын
Great video!, I have a question, how can i do a fine tuning and parameter selection for models such as glm, gam, rf and maxent?
@inbard8122
@inbard8122 Жыл бұрын
Hi, great video! Question - is there anyway to deal with spatial auto correllation (the presence of systematic spatial variation in a variable) with this package? Thank you
@samitkafle2433
@samitkafle2433 Жыл бұрын
How can we get evaluation for ensemble one TSS and ROC vakue ?
@dakshsingh57
@dakshsingh57 Жыл бұрын
Hi Everyone, did anyone tried running this -- m <- sdm(species~., d, methods=c('Maxent'), replication=c('sub'), test.p=40,n=1, parallelSetting=list(ncore=4,method='parallel')) - I am unable to run maxent as my R crashes when using MAXENT, can anyone suggest me what can we be done ?
@biogeoinformatics
@biogeoinformatics Жыл бұрын
In your code, there is no sense in using parallel as you only have one method and one replication, though I don't think it is the reason for crashing. It could be related to the Java run time, rJava, or even lack of memory. The first step is to see if it works appropriately in a non-parallelised code
@dakshsingh57
@dakshsingh57 Жыл бұрын
@@biogeoinformatics Thank you for your response - I tried the code without parallel and just kept maxent it crashed as well. The R studio crashes without any error message (only when maxent is added in the code) for other methods the code works well. At last I ran the script in R (not studio) the code worked. Surprisingly the same thing is not working in studio. I was able to run the script in R 4.2.2. Thank you for this efficient code !
@nisaayob5857
@nisaayob5857 Жыл бұрын
May someone please help. Does anyone know how to get the rcurve for the ensemble model?
@biogeoinformatics
@biogeoinformatics Жыл бұрын
I will add the possibility in the new version
@eeeLab-kk2il
@eeeLab-kk2il Жыл бұрын
p<-predict(m,biom,filename='pm21W5decPM.grd') Error in m[i] <- .self$whichMethod(m[i]) : replacement has length zero > What can i do sir
@danielhagos235
@danielhagos235 Жыл бұрын
Great tutorial ever
@abkiyodida3551
@abkiyodida3551 Жыл бұрын
Dear Dr. Babak Naimi, Thank you for your very teachable tutorial. please could you get me the scripts you are using on this live tutorial? Thank you.
@MayaRagesh
@MayaRagesh 2 жыл бұрын
SIR i need help. Kindly share your suggestion Iam using R 4.1.3 SDM was running properly but now predict function not working. An error appearing p1 <- predict(m, newdata=biom, filename='prs.img') Error in .updateGDAL(object, v, cell, band, setminmax) : no longer supported Sir what can i do
@babaknaimi
@babaknaimi 2 жыл бұрын
I am updating the package but meanwhile, you may use a raster format with extension of .grd, so use: p1 <- predict(m, newdata=biom, filename='pr.grd')
@ghaznainiqbal
@ghaznainiqbal Жыл бұрын
@@babaknaimi I Tried .grd extension but it shows( Error in o[[id[j]]] : subscript out of bounds). Any Solution :)
@josemiguelvilalopez909
@josemiguelvilalopez909 Жыл бұрын
@@babaknaimi hi! I have the same problem. Is there any update yet, or any planned date? Thank you very much!
@VishalKumar-nn2ch
@VishalKumar-nn2ch 2 жыл бұрын
hello sir, this was very helpful for me. The prolem is I am not getting all the ML methods in getmethodNames() like svm,cart,rf. Please help me to add them into mine.
@babaknaimi
@babaknaimi 2 жыл бұрын
Use installAll() to install all the required packages
@gabrielaspriestersbach6541
@gabrielaspriestersbach6541 2 жыл бұрын
Hello :) I have downloaded occurrence data manually from gbif and stored it in my directory as a .cvs file. I already read the records into r and started cleaning the data. I removed duplicated records and the records without coordinates. Now I wanted to keep only the records that are over the extent of my study area, which is part of south america. Any inputs on how do I do that? Nothing I tryed worked out...
@MayaRagesh
@MayaRagesh 2 жыл бұрын
I am using the {sdm} package to do the species distribution modelling of invasive species. The {vifcor} was done succesfully and the variables(rasters) with high correlation were excluded. I am unable to compile my rasters(bioclim variables, elevation , ndvi) , occurance data into the {sdmData} object. Below is my code and error. d<-sdmData(formula=occurrence~., train=sp, predictors=biom1) Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘sdmData’ for signature ‘"formula", "data.frame", "missing", "RasterStack"’ > sp <- as(sp, 'Spatial') Error in as(sp, "Spatial") : no method or default for coercing “data.frame” to “Spatial” please help me to solve this sir
@babaknaimi
@babaknaimi 2 жыл бұрын
Convert your species data to a SpatialPointsDataFrame
@MayaRagesh
@MayaRagesh 2 жыл бұрын
@@babaknaimi class(sp) [1] "data.frame" Sir can you please tell me the code used for it
@MayaRagesh
@MayaRagesh 2 жыл бұрын
@@babaknaimi I have converted species data to spatial data frame sir > class(spwc) [1] "sf" "data.frame" > spwc Simple feature collection with 32 features and 1 field Geometry type: POINT Dimension: XY Bounding box: xmin: 76.64554 ymin: 10.49855 xmax: 76.74306 ymax: 11.0425 CRS: NA. But even now I am facing issue sir > d <- sdmData(species∼., spwc, predictors=biom) Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘sdmData’ for signature ‘"formula", "sf", "missing", "RasterStack"’
@babaknaimi
@babaknaimi 2 жыл бұрын
You need to convert it to SpatialPointsDataFrame (not sf) coordinates(sp) <- c("X", "Y") Replace X and Y with the names of coordinate columns
@nisaayob5857
@nisaayob5857 2 жыл бұрын
Thank you for this video. May someone kindy assist, i am get this error trying to get slot "presence" from an object of a basic class ("NULL") with no slots in the modelling step
@babaknaimi
@babaknaimi 2 жыл бұрын
My guess is that your input data (generated by sdmData) is presence-only. Put the setting in the bg argument in the sdmData to have background generated
@babaknaimi
@babaknaimi 2 жыл бұрын
@UCqDtax1iPvWGBm-BGvraORA I would check the column names in points (make sure you would have one column contains presences as 1), also check d object to see if the name of species is the same as you used in formula in the sdm function
@nisaayob5857
@nisaayob5857 2 жыл бұрын
@@babaknaimi Thank you so much, it works now. I truly appreciate it, sir.
@yuliialeshchenko6185
@yuliialeshchenko6185 2 жыл бұрын
Hi! Does someone know why I have such an error after trying to use predict function? Error in .updateGDAL(object, v, cell, band, setminmax) : no longer supported
@babaknaimi
@babaknaimi 2 жыл бұрын
It is because of the changes in GDAL library. I am fixing in the new version. Meanwhile, you may use the native raster format in the raster package, a file with extension of .grd
@AbidAli-wr6dz
@AbidAli-wr6dz 2 жыл бұрын
Hi, I have a problem in coding as "sp" is my occurrence, vars are selected bioclimatic variables after the collinearity check. data <- sdmData(species~., train = sp, predictors = vars, + bg = list(n=1000)) ORR data <- sdmData(species~., sp, predictors = vars) In both cases, I'm having the error below. Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘sdmData’ for signature ‘"formula", "data.frame", "missing", "RasterStack"’ any advise are more than welcom! thans
@babaknaimi
@babaknaimi 2 жыл бұрын
Convert sp to a SpatialPointsDataFrame
@AbidAli-wr6dz
@AbidAli-wr6dz 2 жыл бұрын
Thanks, It's work now!
@lwalston4470
@lwalston4470 2 жыл бұрын
Hi Babak - great video! I am struggling to get maxent to work with this sdm package. The maxent model completes training but when I apply predictions, I get the following error message: "Error in .local(object, ...) : Error in prediction....!" Any idea why that error is occurring?
@mayaammathilmanoharan1406
@mayaammathilmanoharan1406 2 жыл бұрын
Hello sir, First of all thank you so much for uploading this tutorial. it was very helpful. Sir i have a doubt sir here we are using CMIP5 DATA instead for uploading CMIP6 future climate data what should we do .
@farisayidakwa7024
@farisayidakwa7024 2 жыл бұрын
How do you incorporate other form of measurements outside presence/absence like abundance or any measurement like species density in this model?. Wondering if its the same or there are major changes to follow?
@Z-Animals
@Z-Animals 2 жыл бұрын
please help me, how can i fix "Error: cannot allocate vector of size 12.0 Gb"
@mayamaya-lr1sy
@mayamaya-lr1sy 2 жыл бұрын
SIR I HAVING THE ISSUE IN THE CROPING STEP spg <- crop(spg, e) where the error appears tobe like this Error in (function(classes, fdef, mtable): unable to find an inherited method for function crop for signature 'NULL' . Sir can you please help me with this
@DhaneeshB
@DhaneeshB 2 жыл бұрын
Error in loadNamespace(x) : there is no package called ‘devtools’ ............ how can I install Babknaimi sdm to my r studio
@abdelmutalabazrag3136
@abdelmutalabazrag3136 2 жыл бұрын
Thanks a lot for this tutorial. It really helped me to publish my first SDM using R, well appreciated. One question: Is there any code that I can use to split the response curve?. For example, instead of having 9 curves in one row, is it possible to have 3 rows (every 3 curves in one row). Thanks a lot.
@inyookim1617
@inyookim1617 2 жыл бұрын
Thanks for the great tutorial. Have one question, how do I evaluate the ensemble model outcome(en)?, AUC, TSS and other stuffs.
@biogeoinformatics
@biogeoinformatics 2 жыл бұрын
You can use the evaluates function, put the sdmdata object as the first argument, and the raster output of ensemble as the second argument
@inyookim1617
@inyookim1617 2 жыл бұрын
@@biogeoinformatics thanks for the reply :) but have another question. I successfully ran the model, now looking through the outcomes and have one question. In the variable importance, is the metric based on the jackknife approach? and if not how are correlation test and auc test done?
@inyookim1617
@inyookim1617 2 жыл бұрын
Thanks for the great tutorial. Have one question, how do I evaluate the ensemble model outcome(en)?, AUC, TSS and other stuffs.
@yerichoberhanu4331
@yerichoberhanu4331 2 жыл бұрын
I am working to model species distribution using R with HP pc, Cori 7, 8th generation, RAM 8GB, processor 1.99 GB , while my PC does not give results. What is the minimum capacity of PC to run SDM?
@zainulabdin4466
@zainulabdin4466 2 жыл бұрын
I got i5 9th gen and it works perfectly fine for me.
@saulopino8152
@saulopino8152 2 жыл бұрын
thank you very much I was very lost in the part of quantifying the importance of bioclimatic variables and your video helped me a lot
@zuleymazarco7315
@zuleymazarco7315 3 жыл бұрын
Anyone else having trouble using predict function for maxent algorithm?
@ghaznainiqbal
@ghaznainiqbal Жыл бұрын
Me . Did you find any solution to that?
@shanshanchen1045
@shanshanchen1045 3 жыл бұрын
thank you for sharing this video, I wonder whether raster::getData()function downloading the present data?
@emmadeeks3104
@emmadeeks3104 3 жыл бұрын
brilliant tutorial! Apologies if I missed this, but do where can I find the code used in this tutorial? Thanks so much
@zainulabdin4466
@zainulabdin4466 2 жыл бұрын
I practiced the code so I have it in .R file. Let me know if you need it.
@julkaditapause1774
@julkaditapause1774 10 ай бұрын
@@zainulabdin4466bro i need it. It will be very helpful if you are able to provide me the code
@najlascheidegger5101
@najlascheidegger5101 3 жыл бұрын
Hi! thank you so much for the great video!^^ Is that possible to create a background points radius (buffer) around the presence data?
@joseportillo217
@joseportillo217 3 жыл бұрын
And the Maxent? How we can implement Maxent in sdm package?
@yadavghimirey
@yadavghimirey 3 жыл бұрын
thank you very much for this.. a little confusion with the gui(m) code though.. Which package needs to be installed for this code to work? I got lost at that point..
@yadavghimirey
@yadavghimirey 3 жыл бұрын
Actually I got the code to run but it keeps running for eternity and I have to abort r in order to stop it.. so there's a little problem.. not sure what makes it behave this way..
@biogeoinformatics
@biogeoinformatics 3 жыл бұрын
You can simply run installAll() which installs all required packages including those required by gui (gui requires shiny).
@wyclifeoluoch9376
@wyclifeoluoch9376 3 жыл бұрын
@@yadavghimirey I also think you are returning to console before closing the open shiny gui. You need to close the shiny gui first then come back to R console to continue with other codes.
@yadavghimirey
@yadavghimirey 3 жыл бұрын
@@biogeoinformatics Thank you very much
@yadavghimirey
@yadavghimirey 3 жыл бұрын
@@wyclifeoluoch9376 Thx! :)
@franciscoborges1590
@franciscoborges1590 3 жыл бұрын
Hello! I've been trying to figure out if you can plot the randomly generated background pseudo-absences from the sdmData object, but have yet to find or figure it out. Can someone help me, if it is indeed possible? Would be cool to see how the function is generating the new data. Thanks in advance.
@wyclifeoluoch9376
@wyclifeoluoch9376 3 жыл бұрын
Once you have the output of sdmData object, say d, you can convert it to data.frame object, extract species and coordinates columns, and filter where species == 0. df <- as.data.frame(d) df_spec_coord <- data.frame(species = df$species, coordinates(d)) df_pseudo_absences <- df_spec_coord %>% dplyr::filter(species == 0) plot(coords.x1 ~ coords.x2, data = df_pseudo_absences) Then you'll have the coordinates of generated pseudo_absences which you can put to plotting function of your choice.
@hyacinthewouyou9305
@hyacinthewouyou9305 3 жыл бұрын
Thanks for sharing. Wonderful