Comments (10)
That's weird...
How did you create the map object? Could you please print it?
from sdmtune.
I'm following the examples in the tutorial, but with my data. Here the commands and objects:
map <- predict(default_model_2014_5, data = subset_pred_2014_5_r, type = "cloglog")
thresholds(default_model_2014_5, type = "cloglog")
plotPA(map, th = 0.20)
default_model_2014_5
Object of class SDMmodelCV
Method: Maxent
Species: LC
Replicates: 4
Presence locations: 25
Absence locations: 10000
Model configurations:
--------------------
fc: lqph
reg: 1
iter: 500
Variables:
---------
Continuous: LC08_2014_2015_cva_angle LC08_2014_2015_cva_change_dist_1 LC08_2014_2015_cva_change_dist_2 LC08_2014_2015_cva_change_dist_3 LC08_2014_2015_cva_change_dist_4 LC08_2014_2015_cva_magnitude LC08_20140719_EVI_5_Contr LC08_20140719_EVI_5_Corr LC08_20140719_EVI_5_Entr LC08_20140719_LSWI2_5_Corr LC08_20140719_LSWI2_5_Entr LC08_20140719_LSWI2_average_5 LC08_20140719_NDBI_5_Contr LC08_20140719_NDBI_5_Corr LC08_20140719_NDBI_5_Entr LC08_20140719_NDBI_sd_5 LC08_20140719_NDWI_XU_sd_5 LC08_20140719_tasscap.1_5 LC08_20140719_tasscap.2_5 LC08_20140719_tasscap.4_5 interspersion_20140719_5 richness_20140719_5
Categorical: LC08_2014_2015_cva_change rf_class_20140719 mode_20140719_5 LC08_2014_2015_cva_change_mode_5
map_2014_5
class : RasterLayer
dimensions : 976, 1252, 1221952 (nrow, ncol, ncell)
resolution : 30, 30 (x, y)
extent : 302040, 339600, 6940230, 6969510 (xmin, xmax, ymin, ymax)
crs : +proj=utm +south +no_defs +zone=21 +a=6378137 +rf=298.257223563 +towgs84=0.000,0.000,0.000 +to_meter=1
source : memory
names : layer
values : 0, 1 (min, max)
If I just follow the example with the vitualsp and worldclim, and ony load SDMtune and raster packages, the plotPA() works. But with my data, it does not. I don't understand.
from sdmtune.
Thanks, are you sure you are using the version 0.2.0?
The predict function for cross validation is not available in this version. If you try to predict
an SWDmodelCV object you should get the following error message:
Error in UseMethod("predict") :
no applicable method for 'predict' applied to an object of class "SDMmodelCV"
Furthermore, the thresholds function can be used only with SDMmodel objects, see documentation.
The predict method for SDMmodelCV is implemented in the development version and will be released soon (thresholds will be available in the following days).
from sdmtune.
Sorry, I didn't say. I'm using the dev version installed with devtools::install_github("ConsBiol-unibern/SDMtune")
because I saw that predict now also works with SDMmodelCV objects.
In any case, I tried the plotPA()
also with a CV model with the data from the example in the tutorials, and it works. It's only with my data that it does not work.
from sdmtune.
plotPA
is a simple function, must be something with your raster.
Could you please try to do
pa <- map >= 0.2
rasterVis::gplot(pa) + ggplot2::geom_tile(ggplot2::aes_(fill = ~value))
and also:
plot(map)
plot(pa)
from sdmtune.
All those commands work with no error :)
from sdmtune.
and this:
rasterVis::gplot(pa) +
ggplot2::geom_tile(ggplot2::aes_(fill = ~value)) +
ggplot2::scale_fill_manual(values = c("#67a9cf", "#ef8a62"),
breaks = c(1, 0),
labels = c("Presence", "Absence"),
name = "")
from sdmtune.
That one gives the error reported originally:
Error: Continuous value supplied to discrete scale
from sdmtune.
It should be fixed now, could you please test it?
Be aware that the function thresholds
is not yet implemented for CV,
it will be available in few days...
from sdmtune.
It should be fixed now, could you please test it?
Yes, it's working now! Thanks much! I close this one as it is fixed.
Be aware that the function
thresholds
is not yet implemented for CV,
it will be available in few days...
+1! Looking forward to it
Thanks again! I like the package a lot!
from sdmtune.
Related Issues (20)
- Thanks for that great tool...
- [BUG] modelReport() using RF method: type of predictors in new data do not match that of the training data. HOT 2
- Response Curve error when creating model report HOT 2
- Error when plotting response for categorical predictors -RF-class [BUG] HOT 2
- Problems running the spatial cross validation examples HOT 5
- [BUG] varSel not working after model train HOT 4
- Disable real-time graph??? HOT 2
- modelReport can't find ROC curve file and fails HOT 7
- How to parse the result from `reduceVar()` to get retained var names? HOT 1
- [Enhancement] Accepting single raster as well HOT 1
- [help wanted] where can set up the bias file of maxent and How to get the model files incliding roc curves, TSS csv tables and responce curves?
- [Bug]:doJK freezes when a continuous variable has many zeros HOT 1
- [Bug]: Please remove dependencies on **rgdal**, **rgeos**, and/or **maptools** HOT 3
- Error in `optimizeModel` when passing a SDMmodelCV object HOT 17
- Differences in variable importance when passing a SDMmodelCV object compared to passing each of the models inside the SDMmodelCV object HOT 5
- [BUG] plotPA not working in version 1.10 HOT 12
- [BUG] cluster error during predict with large raster stack HOT 5
- Error in predict when working with Random Forest and specify a categorial variable as a predictor HOT 5
- modelReport fails if response_curves = TRUE or jk=TRUE HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdmtune.