# Buggy code
def set_results(self, results):
    """Set the input results."""
    # false positive, pylint: disable=no-member
    prev_sel_learner = self.selected_learner.copy()
    self.clear()
    self.warning()
    self.closeContext()

    data = None
    if results is not None and results.data is not None:
        data = results.data[results.row_indices]

    if data is not None and not data.domain.has_discrete_class:
        self.Error.no_regression()
        data = results = None
    else:
        self.Error.no_regression.clear()

    nan_values = False
    if results is not None:
        assert isinstance(results, Orange.evaluation.Results)
        if np.any(np.isnan(results.actual)) or np.any(np.isnan(results.predicted)):
            # Error out here (could filter them out with a warning
            # instead).
            nan_values = True
            results = data = None

    self.Error.invalid_values(shown=nan_values)

    self.results = results
    self.data = data

    if data is not None:
        class_values = data.domain.class_var.values
    elif results is not None:
        raise NotImplementedError

    if results is None:
        self.report_button.setDisabled(True)
        return

    self.report_button.setDisabled(False)

    nmodels = results.predicted.shape[0]
    self.headers = class_values + [unicodedata.lookup("N-ARY SUMMATION")]

    # NOTE: The 'learner_names' is set in 'Test Learners' widget.
    self.learners = getattr(
        results, "learner_names", [f"Learner #{i + 1}" for i in range(nmodels)]
    )

    self._init_table(len(class_values))
    self.openContext(data.domain.class_var)
    if not prev_sel_learner or prev_sel_learner[0] >= len(self.learners):
        if self.learners:
            self.selected_learner[:] = [0]
    else:
        self.selected_learner[:] = prev_sel_learner
    self._update()
    self._set_selection()
    self.unconditional_commit()


# 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 set_results(self, results):
    """Set the input results."""
    # false positive, pylint: disable=no-member
    prev_sel_learner = self.selected_learner.copy()
    self.clear()
    self.warning()
    self.closeContext()

    data = None
    if results is not None and results.data is not None:
        data = results.data[results.row_indices]

    self.Error.no_regression.clear()
    self.Error.empty_input.clear()
    if data is not None and not data.domain.has_discrete_class:
        self.Error.no_regression()
        data = results = None
    elif results is not None and not results.actual.size:
        self.Error.empty_input()
        data = results = None

    nan_values = False
    if results is not None:
        assert isinstance(results, Orange.evaluation.Results)
        if np.any(np.isnan(results.actual)) or np.any(np.isnan(results.predicted)):
            # Error out here (could filter them out with a warning
            # instead).
            nan_values = True
            results = data = None

    self.Error.invalid_values(shown=nan_values)

    self.results = results
    self.data = data

    if data is not None:
        class_values = data.domain.class_var.values
    elif results is not None:
        raise NotImplementedError

    if results is None:
        self.report_button.setDisabled(True)
        return

    self.report_button.setDisabled(False)

    nmodels = results.predicted.shape[0]
    self.headers = class_values + [unicodedata.lookup("N-ARY SUMMATION")]

    # NOTE: The 'learner_names' is set in 'Test Learners' widget.
    self.learners = getattr(
        results, "learner_names", [f"Learner #{i + 1}" for i in range(nmodels)]
    )

    self._init_table(len(class_values))
    self.openContext(data.domain.class_var)
    if not prev_sel_learner or prev_sel_learner[0] >= len(self.learners):
        if self.learners:
            self.selected_learner[:] = [0]
    else:
        self.selected_learner[:] = prev_sel_learner
    self._update()
    self._set_selection()
    self.unconditional_commit()