Skip to content

Commit 08b123f

Browse files
authored
DOC fix deprecation warning in plot_separating_hyperplane_unbalanced (scikit-learn#27453)
1 parent a3a1604 commit 08b123f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

examples/svm/plot_separating_hyperplane_unbalanced.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
2626
"""
2727

28+
import matplotlib.lines as mlines
2829
import matplotlib.pyplot as plt
2930

3031
from sklearn import svm
@@ -81,7 +82,10 @@
8182
)
8283

8384
plt.legend(
84-
[disp.surface_.collections[0], wdisp.surface_.collections[0]],
85+
[
86+
mlines.Line2D([], [], color="k", label="non weighted"),
87+
mlines.Line2D([], [], color="r", label="weighted"),
88+
],
8589
["non weighted", "weighted"],
8690
loc="upper right",
8791
)

0 commit comments

Comments
 (0)