You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @mikemahoney218 -- I am trying to incorporate waywiser for examples in a paper about spatial patterns comparison. The ww_multi_scale() function works fine for continuous rasters (however, it gives some CRSs warnings), but errors for categorical ones. Is this expected?
library(terra)
library(waywiser)
library(landscapemetrics)
cell_sizes= seq(10, 100, 10) *1000l1= rast(landscape)
l2=l1clc_multi_scale= ww_multi_scale(truth=l1, estimate=l2,
metrics=list(yardstick::precision),
cellsize=cell_sizes)
#> Error in `metric_set()`:#> ! Failed to compute `<clss_mtr>()`.#> Caused by error:#> ! Must select at least one item.clc_multi_scale#> Error in eval(expr, envir, enclos): object 'clc_multi_scale' not found
The text was updated successfully, but these errors were encountered:
I'm digging into this now, and am going to write notes here as I go. It seems like for some reason we're not passing estimate to the yardstick functions correctly in this case:
on a second look, while I can't confirm that's not a problem, I think the bigger issue is that these columns aren't factors when working with classification metrics: tidymodels/yardstick#504
Thanks for the report! I think this is mostly fixed in #61. The only other change necessary (and you can see this in the tests added in #61) is that those cellsizes wind up creating a grid with a single cell that includes the entire raster; as precision() requires factors have more than one level, this winds up erroring. Using a smaller grid will work once #61 is merged though.
Hi @mikemahoney218 -- I am trying to incorporate waywiser for examples in a paper about spatial patterns comparison. The
ww_multi_scale()
function works fine for continuous rasters (however, it gives some CRSs warnings), but errors for categorical ones. Is this expected?The text was updated successfully, but these errors were encountered: