Replies: 2 comments 1 reply
-
If your response variable is binary, why are you creating a regression task?
It depends a bit on what you want to achieve. Applying a simple train/test split is just a toy example here, I don't recommend to use it for real applications. You might rather want to use cross-validation to estimate model performance (if that's your goal). I might be wrong but I think your problem is not really a "spatial" one or one related to {mlr3spatial} but a general "how handle NA in your dataset" question. {mlr3spatial} just helps transforming your raster dataset into a mlr3 Does that help? |
Beta Was this translation helpful? Give feedback.
-
Hi Patrick thanks for you replay. The problem arise also if I will do a classification or a regression. Such raster become my response variable defined as "task"
The only difference is that I need to extract excluding the NA and get the 0 or 1 IDs. This is what is blocking me, and this will be the typical example of doing supervised regression or classification in spatial domain. The rest is clear and NA will not be present in the underline predictors (band2, band3, band4, band5, band6). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
Thanks for developing the mlr3spatial.
I have one question.
I'm trying to apply a supervised regression following the example at
https://mlr3spatial.mlr-org.com/articles/mlr3spatial.html
In my case the response variable is a presence-absence (0/1) raster file with many NA values.
task = as_task_regr(backend, target = "presence-absence")
I want to use the presence-absence to do a supervised regression, therefore I can note use the
row_ids = sample(1:task$nrow, 500)
Rather I need to extract the row_ids where
presence-absence != NA
in order to fill the
learner$train(task, row_ids = row_ids)
I have tried to search for an example of how to return the
row_ids within a raster condition but I could not find one.
Can anyone help me?
Would be nice to have also this supervised example in the https://mlr3spatial.mlr-org.com/articles/mlr3spatial.html help page.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions