Skip to content

Commit c7ba86d

Browse files
0.15.10
spot.get_importance returns zeros
1 parent 7aa270f commit c7ba86d

2 files changed

Lines changed: 4 additions & 2 deletions

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

src/spotpython/spot/spot.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2141,7 +2141,7 @@ def get_importance(self) -> list:
21412141
21422142
Returns:
21432143
output (list):
2144-
list of results
2144+
list of results. If the surrogate has more than one theta values, the importance is calculated. Otherwise, a list of zeros is returned.
21452145
21462146
"""
21472147
if self.surrogate.n_theta > 1 and self.var_name is not None:
@@ -2156,6 +2156,8 @@ def get_importance(self) -> list:
21562156
return output
21572157
else:
21582158
print("Importance requires more than one theta values (n_theta>1).")
2159+
# return a list of zeros of length len(all_var_name)
2160+
return [0] * len(self.all_var_name)
21592161

21602162
def print_importance(self, threshold=0.1, print_screen=True) -> list:
21612163
"""Print importance of each variable and return the results as a list.

0 commit comments

Comments
 (0)