mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-03 08:42:39 +02:00
Convert print to function for Python 3 compatibility
This commit is contained in:
parent
4512964f09
commit
4b4e5d4901
5 changed files with 10 additions and 10 deletions
|
|
@ -62,7 +62,7 @@ def plot_latent(model, labels=None, which_indices=None,
|
|||
|
||||
|
||||
if X.shape[0] > 1000:
|
||||
print "Warning: subsampling X, as it has more samples then 1000. X.shape={!s}".format(X.shape)
|
||||
print("Warning: subsampling X, as it has more samples then 1000. X.shape={!s}".format(X.shape))
|
||||
subsample = np.random.choice(X.shape[0], size=1000, replace=False)
|
||||
X = X[subsample]
|
||||
labels = labels[subsample]
|
||||
|
|
@ -187,14 +187,14 @@ def plot_latent(model, labels=None, which_indices=None,
|
|||
fig.tight_layout()
|
||||
fig.canvas.draw()
|
||||
except Exception as e:
|
||||
print "Could not invoke tight layout: {}".format(e)
|
||||
print("Could not invoke tight layout: {}".format(e))
|
||||
pass
|
||||
|
||||
if updates:
|
||||
try:
|
||||
ax.figure.canvas.show()
|
||||
except Exception as e:
|
||||
print "Could not invoke show: {}".format(e)
|
||||
print("Could not invoke show: {}".format(e))
|
||||
raw_input('Enter to continue')
|
||||
view.deactivate()
|
||||
return ax
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ except:
|
|||
|
||||
def plot_optimizer(optimizer):
|
||||
if optimizer.trace == None:
|
||||
print "No trace present so I can't plot it. Please check that the optimizer actually supplies a trace."
|
||||
print("No trace present so I can't plot it. Please check that the optimizer actually supplies a trace.")
|
||||
else:
|
||||
pb.figure()
|
||||
pb.plot(optimizer.trace)
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ def plot_ARD(kernel, fignum=None, ax=None, title='', legend=False, filtering=Non
|
|||
last_bottom = ard_params[i,:]
|
||||
bottom += last_bottom
|
||||
else:
|
||||
print "filtering out {}".format(kernel.parameters[i].name)
|
||||
print("filtering out {}".format(kernel.parameters[i].name))
|
||||
|
||||
ax.set_xlim(-.5, kernel.input_dim - .5)
|
||||
add_bar_labels(fig, ax, [bars[-1]], bottom=bottom-last_bottom)
|
||||
|
|
|
|||
|
|
@ -159,10 +159,10 @@ def new_shape_string(sf,name,regex,field=2,type=None):
|
|||
|
||||
newshp.line(parts=_parts)
|
||||
newshp.records.append(sr.record)
|
||||
print len(sr.record)
|
||||
print(len(sr.record))
|
||||
|
||||
newshp.save(name)
|
||||
print index
|
||||
print(index)
|
||||
|
||||
def apply_bbox(sf,ax):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -225,8 +225,8 @@ class lvm_dimselect(lvm):
|
|||
self.labels = labels
|
||||
lvm.__init__(self,vals,model,data_visualize,latent_axes,sense_axes,latent_index)
|
||||
self.show_sensitivities()
|
||||
print self.latent_values
|
||||
print "use left and right mouse buttons to select dimensions"
|
||||
print(self.latent_values)
|
||||
print("use left and right mouse buttons to select dimensions")
|
||||
|
||||
|
||||
def on_click(self, event):
|
||||
|
|
@ -255,7 +255,7 @@ class lvm_dimselect(lvm):
|
|||
|
||||
|
||||
def on_leave(self,event):
|
||||
print type(self.latent_values)
|
||||
print(type(self.latent_values))
|
||||
latent_values = self.latent_values.copy()
|
||||
y = self.model.predict(latent_values[None,:])[0]
|
||||
self.data_visualize.modify(y)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue