Skip to content

Commit b736bbf

Browse files
v0.0.11
1 parent 978091d commit b736bbf

2 files changed

Lines changed: 13 additions & 10 deletions

File tree

src/spotPython/build/kriging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def fit(self, nat_X, nat_y):
333333
self.nat_to_cod_init()
334334
if self.n_theta > self.k:
335335
self.n_theta = self.k
336-
logger.warning("Warning: More theta values than dimensions. `n_theta` set to `k`.")
336+
logger.warning("More theta values than dimensions. `n_theta` set to `k`.")
337337
self.theta = zeros(self.n_theta)
338338
# TODO: Currently not used:
339339
self.x0_theta = ones((self.n_theta,)) * self.n / (100 * self.k)

src/spotPython/spot/spot.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def run(self):
321321
# Condition: select only X= that have min distance
322322
# to existing solutions
323323
X0, X0_ind = selectNew(A=X0, X=self.X, tolerance=self.tolerance_x)
324-
logger.debug("XO values are new: %s", X0_ind)
324+
logger.debug("XO values are new: %s %s", X0_ind, X0)
325325
# 1. There are X0 that fullfil the condition.
326326
# Note: The number of new X0 can be smaller than self.n_points!
327327
if X0.shape[0] > 0:
@@ -605,12 +605,15 @@ def plot_contour(self, i=0, j=1, min_z=None, max_z=None, show=True):
605605
pylab.show()
606606

607607
def print_importance(self):
608-
theta = np.power(10, self.surrogate.theta)
609-
print("Importance relative to the most important parameter:")
610-
imp = 100 * theta / np.max(theta)
611-
if self.var_name is None:
612-
for i in range(len(imp)):
613-
print("x", i, ": ", imp[i])
608+
if self.surrogate.n_theta > 1:
609+
theta = np.power(10, self.surrogate.theta)
610+
print("Importance relative to the most important parameter:")
611+
imp = 100 * theta / np.max(theta)
612+
if self.var_name is None:
613+
for i in range(len(imp)):
614+
print("x", i, ": ", imp[i])
615+
else:
616+
for i in range(len(imp)):
617+
print(self.var_name[i] + ": ", imp[i])
614618
else:
615-
for i in range(len(imp)):
616-
print(self.var_name[i] + ": ", imp[i])
619+
print("Importantance requires more than one theta values (n_theta>1).")

0 commit comments

Comments
 (0)