From 04d05f447f14ec69b534b6117caaa9c1b4ce2f98 Mon Sep 17 00:00:00 2001 From: janezd Date: Mon, 24 Jun 2019 21:50:58 +0200 Subject: [PATCH] Calibration plot: Minor fixes --- Orange/widgets/evaluate/owcalibrationplot.py | 9 ++++++--- Orange/widgets/evaluate/tests/test_owcalibrationplot.py | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Orange/widgets/evaluate/owcalibrationplot.py b/Orange/widgets/evaluate/owcalibrationplot.py index 637db82aa9b..55b1f57c2a9 100644 --- a/Orange/widgets/evaluate/owcalibrationplot.py +++ b/Orange/widgets/evaluate/owcalibrationplot.py @@ -400,6 +400,9 @@ def threshold_change(self): self._update_info() def _update_info(self): + def elided(s): + return s[:17] + "..." if len(s) > 20 else s + text = f""" @@ -416,7 +419,7 @@ def _update_info(self): for name, (probs, curves) in self.scores: ind = min(np.searchsorted(probs, self.threshold), len(probs) - 1) - text += f"" + text += f"" text += "".join(f'' for curve in curves) text += "" @@ -436,8 +439,8 @@ def apply(self): (len(results.folds) > 1, "each training data sample produces a different model"), (results.models is None, - "test results do not contain stored models - try testing on" - "separate data or on training data"), + "test results do not contain stored models - try testing " + "on separate data or on training data"), (len(self.selected_classifiers) != 1, "select a single model - the widget can output only one"), (self.score != 0 and len(results.domain.class_var.values) != 2, diff --git a/Orange/widgets/evaluate/tests/test_owcalibrationplot.py b/Orange/widgets/evaluate/tests/test_owcalibrationplot.py index 2d28c050fa2..e4f18231686 100644 --- a/Orange/widgets/evaluate/tests/test_owcalibrationplot.py +++ b/Orange/widgets/evaluate/tests/test_owcalibrationplot.py @@ -391,7 +391,7 @@ def test_apply_no_output(self, *_): multiple_folds: "each training data sample produces a different model", no_models: - "test results do not contain stored models - try testing on" + "test results do not contain stored models - try testing on " "separate data or on training data", multiple_selected: "select a single model - the widget can output only one",
Threshold: p=
{name}:
{elided(name)}:/{curve[ind]:.3f}