Comments (3)
You can try the prob
branch.
remotes::install_github("mlr-org/mlr3spatial@prob")
This works. Only binary tasks.
library(mlr3spatial)
library(sf)
library(terra)
leipzig = read_sf(system.file("extdata", "leipzig_points.gpkg", package = "mlr3spatial"), stringsAsFactors = TRUE)
# probability for forest
leipzig$forest = as.factor(ifelse(leipzig$land_cover == "forest", 1, 0))
leipzig$land_cover = NULL
task = as_task_classif_st(leipzig, target = "forest", positive = "1")
task
leipzig_raster = rast(system.file("extdata", "leipzig_raster.tif", package = "mlr3spatial"))
learner = lrn("classif.rpart", predict_type = "prob")
learner$train(task)
land_cover = predict_spatial(leipzig_raster, learner, predict_type = "prob")
plot(land_cover, type = "continuous")
from mlr3spatial.
Thank you! :)
from mlr3spatial.
Hello! Just wanted to let you know the prob
branch was not working for me, I believe because my area of interest was masked (my masked area of interest produced correct results on the main branch for response
).
I believe this is because the predictions lengths for response
and prob
are of different lengths (response prediction data includes NA's, while prob
does not). I modified the existing main branch for prob
plotting in a forked repository by replacing non-na values in the response
prediction with results from the prob
prediction. However, I'm sure there is a better solution out there
from mlr3spatial.
Related Issues (20)
- `as_xx_backend()` converters need information about response variable from existing backend HOT 1
- DataBackendRaster: Extraction many non-continuous cell values is very slow HOT 13
- Change request because of changed behavior of `terra::sources` HOT 2
- Error by DataBackendRaster with SpatRaster (terra package) HOT 3
- Stars object from tutorial - No method or default for coercing "RasterBrick" to "SpatRaster" HOT 2
- Add CRAN badge (nt)
- CRS info is not stored in `DataBackendRaster`
- Update logger hierarchy HOT 4
- {progressr} support?
- `predict_spatial()`: Create unsupervised task internally? HOT 6
- setCats is deprecated HOT 2
- cleanup on `.onUnload` HOT 1
- Please remove dependencies on **rgdal**, **rgeos**, and/or **maptools** HOT 1
- Release mlr3spatial 0.4.0
- tera interface HOT 1
- Release mlr3spatial 0.4.1
- Release mlr3spatial 0.5.0
- predict_spatial not accept SpatRaster stacs
- predict_spatial results in an error when the predictor raster stack has layers with similar names
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 mlr3spatial.