# Buggy code
def backmap_value(self, value, mapped_probs, n_values, backmappers):
    if backmappers is None:
        return value

    if value.ndim == 2:  # For multitarget, recursive call by columns
        new_value = np.zeros(value.shape)
        for i, n_value, backmapper in zip(itertools.count(), n_values, backmappers):
            new_value[:, i] = self.backmap_value(
                value[:, i], mapped_probs[:, i, :], [n_value], [backmapper]
            )
        return new_value

    backmapper = backmappers[0]
    if backmapper is None:
        return value

    value = backmapper(value)
    nans = np.isnan(value)
    if not np.any(nans):
        return value
    if mapped_probs is not None:
        value[nans] = np.argmax(mapped_probs[nans], axis=1)
    else:
        value[nans] = np.RandomState(0).choice(
            backmapper(np.arange(0, n_values[0] - 1))(
                np.sum(nans),
            )
        )
    return value


# Traceback (ValueError)
Traceback (most recent call last):
File "/Users/ajda/orange/orange-canvas-core/orangecanvas/scheme/signalmanager.py", line 718, in __process_next
self.process_queued()
File "/Users/ajda/orange/orange-canvas-core/orangecanvas/scheme/signalmanager.py", line 476, in process_queued
self.process_node(node_update_front[0])
File "/Users/ajda/orange/orange-canvas-core/orangecanvas/scheme/signalmanager.py", line 523, in process_node
self.send_to_node(node, signals_in)
File "/Users/ajda/orange/orange-widget-base/orangewidget/workflow/widgetsscheme.py", line 775, in send_to_node
self.process_signals_for_widget(node, widget, signals)
File "/Users/ajda/orange/orange-widget-base/orangewidget/workflow/widgetsscheme.py", line 816, in process_signals_for_widget
widget.handleNewSignals()
File "/Users/ajda/orange/orange3/Orange/widgets/evaluate/owpredictions.py", line 216, in handleNewSignals
self._call_predictors()
File "/Users/ajda/orange/orange3/Orange/widgets/evaluate/owpredictions.py", line 268, in _call_predictors
pred = predictor.backmap_value(pred, prob, n_values, backmappers)
File "/Users/ajda/orange/orange3/Orange/base.py", line 265, in backmap_value
value[nans] = np.argmax(mapped_probs[nans], axis=1)
File "/Users/ajda/miniconda3/envs/o3/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 1103, in argmax
return _wrapfunc(a, 'argmax', axis=axis, out=out)
File "/Users/ajda/miniconda3/envs/o3/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 56, in _wrapfunc
return getattr(obj, method)(*args, **kwds)
ValueError: attempt to get argmax of an empty sequence

# Fixed code
def backmap_value(self, value, mapped_probs, n_values, backmappers):
    if backmappers is None:
        return value

    if value.ndim == 2:  # For multitarget, recursive call by columns
        new_value = np.zeros(value.shape)
        for i, n_value, backmapper in zip(itertools.count(), n_values, backmappers):
            new_value[:, i] = self.backmap_value(
                value[:, i], mapped_probs[:, i, :], [n_value], [backmapper]
            )
        return new_value

    backmapper = backmappers[0]
    if backmapper is None:
        return value

    value = backmapper(value)
    nans = np.isnan(value)
    if not np.any(nans) or n_values[0] < 2:
        return value
    if mapped_probs is not None:
        value[nans] = np.argmax(mapped_probs[nans], axis=1)
    else:
        value[nans] = np.random.RandomState(0).choice(
            backmapper(np.arange(0, n_values[0] - 1)), (np.sum(nans),)
        )
    return value