Skip to content
Snippets Groups Projects
Commit 3e6397d0 authored by v.gramlich1's avatar v.gramlich1
Browse files

Fixed an error in postprocessing_plotting.py

parent 3dd15c90
No related branches found
No related tags found
1 merge request!302Draft: Resolve "Class-based Oversampling technique"
Pipeline #77422 passed
...@@ -165,10 +165,10 @@ class PlotContingency(AbstractPlotClass): ...@@ -165,10 +165,10 @@ class PlotContingency(AbstractPlotClass):
for threshold in range(self._min_threshold, self._max_threshold): for threshold in range(self._min_threshold, self._max_threshold):
for pred in predictions: for pred in predictions:
ta, fa, fb, tb = self._single_contingency(obs, pred, threshold) ta, fa, fb, tb = self._single_contingency(obs, pred, threshold)
contingency_array.loc[dict(thresholds=threshold, contingency_cell="ta", type=pred.type.values)] = ta + 1 contingency_array.loc[dict(thresholds=threshold, contingency_cell="ta", type=pred.type.values)] = contingency_array.loc[dict(thresholds=threshold, contingency_cell="ta", type=pred.type.values)] + ta
contingency_array.loc[dict(thresholds=threshold, contingency_cell="fa", type=pred.type.values)] = fa + 1 contingency_array.loc[dict(thresholds=threshold, contingency_cell="fa", type=pred.type.values)] = contingency_array.loc[dict(thresholds=threshold, contingency_cell="fa", type=pred.type.values)] + fa
contingency_array.loc[dict(thresholds=threshold, contingency_cell="fb", type=pred.type.values)] = fb + 1 contingency_array.loc[dict(thresholds=threshold, contingency_cell="fb", type=pred.type.values)] = contingency_array.loc[dict(thresholds=threshold, contingency_cell="fb", type=pred.type.values)] + fb
contingency_array.loc[dict(thresholds=threshold, contingency_cell="tb", type=pred.type.values)] = tb + 1 contingency_array.loc[dict(thresholds=threshold, contingency_cell="tb", type=pred.type.values)] = contingency_array.loc[dict(thresholds=threshold, contingency_cell="tb", type=pred.type.values)] + tb
return contingency_array return contingency_array
def _single_contingency(self, obs, pred, threshold): def _single_contingency(self, obs, pred, threshold):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment