Skip to content

Commit 0151585

Browse files
0.13.1
Fixes an error in the plot_important_hyperparameter_contour function, which did not sort the hyperparameters.
1 parent efb8c77 commit 0151585

4 files changed

Lines changed: 127 additions & 77 deletions

File tree

notebooks/00_spotPython_tests.ipynb

Lines changed: 118 additions & 72 deletions
Large diffs are not rendered by default.

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.13.0"
10+
version = "0.13.1"
1111
authors = [
1212
{ name="T. Bartz-Beielstein", email="tbb@bartzundbartz.de" }
1313
]

src/spotPython/spot/spot.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,13 +1691,18 @@ def plot_important_hyperparameter_contour(
16911691
S.plot_important_hyperparameter_contour()
16921692
16931693
"""
1694-
impo = self.print_importance(threshold=threshold, print_screen=True)
1695-
# print(f"impo: {impo}")
1694+
impo_org = self.print_importance(threshold=threshold, print_screen=True)
1695+
print(f"impo: {impo_org}")
1696+
try:
1697+
impo = sorted(impo_org, key=lambda x: x[1], reverse=True)
1698+
except ValueError as e:
1699+
print(f"ValueError: {e}")
1700+
impo = impo_org
16961701
# if there are more than imp_max variables, select only the most important ones:
16971702
if max_imp is not None:
16981703
if len(impo) > max_imp:
16991704
impo = impo[:max_imp]
1700-
# print(f"impo after select: {impo}")
1705+
print(f"impo after select: {impo}")
17011706
var_plots = [i for i, x in enumerate(impo) if x[1] > threshold]
17021707
min_z = min(self.y)
17031708
max_z = max(self.y)

src/spotPython/utils/init.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import datetime
77
from dateutil.tz import tzlocal
88
from torch.utils.tensorboard import SummaryWriter
9-
from math import inf
109

1110

1211
def fun_control_init(

0 commit comments

Comments
 (0)