Giter Site home page Giter Site logo

Comments (3)

be-marc avatar be-marc commented on August 15, 2024 1

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.

jpconnel avatar jpconnel commented on August 15, 2024

Thank you! :)

from mlr3spatial.

jpconnel avatar jpconnel commented on August 15, 2024

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)

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.