chance_level_kw
in RocCurveDisplay
raises an error when using valid matplotlib args
#30015
Labels
chance_level_kw
in RocCurveDisplay
raises an error when using valid matplotlib args
#30015
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
When passing additional keyword arguments to the random classifier's line via the
chance_level_kw
argument, some arguments raise an error even though they are validmatplotlib.pyplot.plot()
arguments. The error occurs with thec
andls
arguments.The reason is that in
scikit-learn/sklearn/metrics/_plot/roc_curve.py
, the following code exists:Matplotlib raises an error when both
color
andc
, orlinestyle
andls
are specified (this happens with other arguments too, but these are not relevant here since scikit-learn does not set values for them).This behavior may also occur with other future classes, especially
CapCurveDisplay
(in development #28972).A quick fix might look like this:
Steps/Code to Reproduce
Expected Results
Actual Results
TypeError: Got both 'linestyle' and 'ls', which are aliases of one another
Versions
The text was updated successfully, but these errors were encountered: