Skip to content

Commit

Permalink
make prints python3 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathf committed Aug 9, 2016
1 parent f4c375d commit 13fc577
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions skbayes/linear_models/precision_inversion_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,22 @@ def inversion_checker(X,alpha,beta):
beta = 1000
print('\n Example 1: beta = {0} \n'.format(beta))
S,v1, v2 = inversion_checker(X, alpha, beta)
print "Previous inversion method \n"
print("Previous inversion method \n")
print (v1)
print '\n Current inversion method \n'
print("\n Current inversion method \n")
print (v2)

# large beta case
beta = 1e+16
print('\n Example 2: beta = {0} \n'.format(beta))
S,v1, v2 = inversion_checker(X, alpha, beta)
print "Previous inversion method \n"
print("Previous inversion method \n")
print (v1)
print '\n Current inversion method \n'
print("\n Current inversion method \n")
print (v2)


X = np.random.random([5,5]) + 0.00000001*np.eye(5)
#print np.linalg.inv(X)
#print pinvh(X)


2 changes: 1 addition & 1 deletion skbayes/linear_models/variational_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def fit(self,X,y):
# --------- Convergence Check ---------

if self.verbose is True:
print "Iteration {0} is completed".format(i)
print("Iteration {0} is completed".format(i))

# check convergence
converged = self._check_convergence(Mw,Mw_old)
Expand Down
4 changes: 2 additions & 2 deletions skbayes/rvm_ard_models/vrvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ def fit(self,X,y):

# print progress report if required
if self.verbose is True:
print "Iteration {0} is completed, lower bound equals {1}".format(i,self.lower_bound[-1])
print("Iteration {0} is completed, lower bound equals {1}".format(i,self.lower_bound[-1]))

if np.sum( abs(Mw - Mw0) > self.tol) == 0 or i == self.n_iter - 1:
if self.verbose is True:
print "Mean Field Approximation completed"
print("Mean Field Approximation completed")
break
Mw0 = Mw

Expand Down

0 comments on commit 13fc577

Please sign in to comment.