@@ -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