GFDRR / CCDR-tools

Geoanalytics for climate and disaster risk screening
https://gfdrr.github.io/CCDR-tools/
12 stars 8 forks source link

(Classification approach) Last class gives always empty exposure #4

Closed matamadio closed 2 years ago

matamadio commented 2 years ago

No matter the number of bins (classes) specified, the last one will always produce zero or null output.

matamadio commented 2 years ago

Actually maybe baby this is not a bad thing, allows to filter out over a threshold. We can make it explicit, i.e. "last class includes value to be ignored".

ConnectedSystems commented 2 years ago

I'm seeing outputs for Class 6 (C6, the last class):

image

Or do you mean something else?

matamadio commented 2 years ago

This happens in the landslide notebook I tried to do, setting a smaller number of classes.

class_edges = OrderedDict({
    f'class_{i}': widgets.BoundedFloatText(
        value=k,
        min=0.0,
        max=10.0,
        step=0.0001,
        description=f'Class {i}:',
        tooltip=f'Minimum value of class {i}. Value must be less than the next entry.',
        disabled=True
    ) for (i,k) in zip(range(1,5), [0.0001, 0.001, 0.01, 0.05])
})

Am I doing it wrong? :( Maybe safer if you stem out the class-only versions, and I will then edit parameters for each hazard:

  1. Classes only, no RP loop - single hazard raster (for landslide and drought)
  2. Classes only, with RP loop - just remove the "impact function" loop and choice (for heat stress and wildfires)
matamadio commented 2 years ago

Here is the bugged landslide notebook.

ConnectedSystems commented 2 years ago

Fixed in commit 957517d451853c8442aedb07fc0d5c10bc1f2abb