Skip to content

Commit da652be

Browse files
0.15.7
tkagg
1 parent 4e983ec commit da652be

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
77

88
[project]
99
name = "spotpython"
10-
version = "0.15.6"
10+
version = "0.15.7"
1111
authors = [
1212
{ name="T. Bartz-Beielstein", email="tbb@bartzundbartz.de" }
1313
]

src/spotpython/plot/validation.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from sklearn.model_selection import cross_val_predict
22
import matplotlib.pyplot as plt
3+
import matplotlib
34
from sklearn.base import BaseEstimator
45
from sklearn.metrics import PredictionErrorDisplay
56
from sklearn.metrics import RocCurveDisplay
@@ -130,6 +131,7 @@ def plot_roc_from_dataframes(
130131
target_column: str = None,
131132
show: bool = True,
132133
title: str = "",
134+
tkagg: bool = False,
133135
) -> None:
134136
"""
135137
Plot ROC curve for a list of dataframes from model evaluations.
@@ -147,6 +149,9 @@ def plot_roc_from_dataframes(
147149
If True, the plot is shown.
148150
title:
149151
Title of the plot.
152+
tkagg:
153+
If True, the TkAgg backend is used.
154+
Default is False.
150155
151156
Returns:
152157
None
@@ -161,6 +166,8 @@ def plot_roc_from_dataframes(
161166
plot_roc_from_dataframes(df_list, model_names=model_names, target_column="y")
162167
163168
"""
169+
if tkagg:
170+
matplotlib.use("TkAgg")
164171
fig, ax = plt.subplots(figsize=(10, 5))
165172
for i, df in enumerate(df_list):
166173
y_test = df[target_column]

0 commit comments

Comments
 (0)