File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Filter options
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Original file line number Diff line number Diff line change @@ -56,6 +56,13 @@ Changelog
56
56
grids that have estimators as parameter values.
57
57
:pr: `29179 ` by :user: `Marco Gorelli<MarcoGorelli> `.
58
58
59
+ :mod: `sklearn.tree `
60
+ ...................
61
+
62
+ - |Fix | Fix an issue in :func: `tree.export_graphviz ` and :func: `tree.plot_tree `
63
+ that could potentially result in exception or wrong results on 32bit OSes.
64
+ :pr: `` by :user: `Loïc Estève<lesteve> `.
65
+
59
66
:mod: `sklearn.utils `
60
67
....................
61
68
Original file line number Diff line number Diff line change @@ -259,7 +259,12 @@ def get_fill_color(self, tree, node_id):
259
259
self .colors ["rgb" ] = _color_brew (tree .n_classes [0 ])
260
260
if tree .n_outputs != 1 :
261
261
# Find max and min impurities for multi-output
262
- self .colors ["bounds" ] = (np .min (- tree .impurity ), np .max (- tree .impurity ))
262
+ # The next line uses -max(impurity) instead of min(-impurity)
263
+ # and -min(impurity) instead of max(-impurity) on purpose, in
264
+ # order to avoid what looks like an issue with SIMD on non
265
+ # memory aligned arrays on 32bit OS. For more details see
266
+ # https://github.com/scikit-learn/scikit-learn/issues/27506.
267
+ self .colors ["bounds" ] = (- np .max (tree .impurity ), - np .min (tree .impurity ))
263
268
elif tree .n_classes [0 ] == 1 and len (np .unique (tree .value )) != 1 :
264
269
# Find max and min values in leaf nodes for regression
265
270
self .colors ["bounds" ] = (np .min (tree .value ), np .max (tree .value ))
You can’t perform that action at this time.
0 commit comments