Skip to content

Commit

Permalink
Calibration plot, Lift Curve, ROC: Remove dependency on colorbrewer
Browse files Browse the repository at this point in the history
  • Loading branch information
janezd committed Dec 30, 2019
1 parent 22b9e27 commit 6bd9abd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
7 changes: 2 additions & 5 deletions Orange/widgets/evaluate/owcalibrationplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from Orange.widgets.evaluate.contexthandlers import \
EvaluationResultsContextHandler
from Orange.widgets.evaluate.utils import results_for_preview
from Orange.widgets.utils import colorpalette, colorbrewer
from Orange.widgets.utils import colorpalette
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.widget import Input, Output, Msg
from Orange.widgets import report
Expand Down Expand Up @@ -254,10 +254,7 @@ def _initialize(self, results):
names = ["#{}".format(i + 1) for i in range(n)]

self.classifier_names = names
scheme = colorbrewer.colorSchemes["qualitative"]["Dark2"]
if n > len(scheme):
scheme = colorpalette.DefaultRGBColors
self.colors = colorpalette.ColorPaletteGenerator(n, scheme)
self.colors = colorpalette.get_default_colors(n)

for i in range(n):
item = self.classifiers_list_box.item(i)
Expand Down
7 changes: 2 additions & 5 deletions Orange/widgets/evaluate/owliftcurve.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from Orange.widgets.evaluate.contexthandlers import \
EvaluationResultsContextHandler
from Orange.widgets.evaluate.utils import check_results_adequacy
from Orange.widgets.utils import colorpalette, colorbrewer
from Orange.widgets.utils import colorpalette
from Orange.widgets.evaluate.owrocanalysis import convex_hull
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.widget import Input
Expand Down Expand Up @@ -162,10 +162,7 @@ def _initialize(self, results):
if names is None:
names = ["#{}".format(i + 1) for i in range(N)]

scheme = colorbrewer.colorSchemes["qualitative"]["Dark2"]
if N > len(scheme):
scheme = colorpalette.DefaultRGBColors
self.colors = colorpalette.ColorPaletteGenerator(N, scheme)
self.colors = colorpalette.get_default_colors(N)

self.classifier_names = names
self.selected_classifiers = list(range(N))
Expand Down
7 changes: 2 additions & 5 deletions Orange/widgets/evaluate/owrocanalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
EvaluationResultsContextHandler
from Orange.widgets.evaluate.utils import \
check_results_adequacy, results_for_preview
from Orange.widgets.utils import colorpalette, colorbrewer
from Orange.widgets.utils import colorpalette
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.widget import Input
from Orange.widgets import report
Expand Down Expand Up @@ -462,10 +462,7 @@ def _initialize(self, results):
names = ["#{}".format(i + 1)
for i in range(len(results.predicted))]

scheme = colorbrewer.colorSchemes["qualitative"]["Dark2"]
if len(names) > len(scheme):
scheme = colorpalette.DefaultRGBColors
self.colors = colorpalette.ColorPaletteGenerator(len(names), scheme)
self.colors = colorpalette.get_default_colors(len(names))

self.classifier_names = names
self.selected_classifiers = list(range(len(names)))
Expand Down

0 comments on commit 6bd9abd

Please sign in to comment.