Open oliviafraserusda opened 2 years ago
Do you have a more specific example of what that looks like? I have not had success with modifying this example.
How do I add spatial blocking to the landmap::train.spLearner function for classification since blocking is not an argument available? Do I use "id" or blocking? id = as.factor(rmPF$gid)?
X <- eberg_grid[c("PRMGEO6","DEMSRT6","TWISRT6","TIRAST6")] if(!exists("mF")){ mF <- train.spLearner(eberg["TAXGRSC"], covariates=X, parallel=FALSE, blocking = as.factor(rmPF$gid)) }
Yes, example is at: https://opengeohub.github.io/spatial-prediction-eml/spatial-interpolation-using-ensemble-ml.html#spatial-prediction-of-soil-types-factor-variable It works the same way - you just have to prepare the spatial grid for spatial blocking or use the landmap::train.spLearner function.
Originally posted by @thengl in https://github.com/OpenGeoHub/spatial-sampling-ml/issues/1#issuecomment-1023144843
How do I add spatial block IDs (blocking = as.factor(rmPF$gid))) to the train.spLearner function for classification (tsk <- mlr::makeClassifTask)?