@@ -94,7 +94,7 @@ def calculate_kernel(data, k=15, a=10, alpha_decay=True, knn_dist='euclidean',
9494 random_state = random_state )
9595 data = pca .fit_transform (data )
9696 if verbose :
97- print ("PCA complete in {:.2d } seconds" .format (
97+ print ("PCA complete in {:.2f } seconds" .format (
9898 time .time () - start ))
9999 if verbose :
100100 start = time .time ()
@@ -132,7 +132,7 @@ def calculate_kernel(data, k=15, a=10, alpha_decay=True, knn_dist='euclidean',
132132 kernel = knn .kneighbors_graph (data , mode = 'connectivity' )
133133
134134 if verbose :
135- print ("KNN complete in {:.2d } seconds" .format (time .time () - start ))
135+ print ("KNN complete in {:.2f } seconds" .format (time .time () - start ))
136136 kernel = kernel + kernel .T # symmetrization
137137 return kernel
138138
@@ -184,7 +184,7 @@ def calculate_landmark_operator(kernel, n_landmark=2000,
184184 n_components = n_svd ,
185185 random_state = random_state )
186186 if verbose :
187- print ("SVD complete in {:.2d } seconds" .format (time .time () - start ))
187+ print ("SVD complete in {:.2f } seconds" .format (time .time () - start ))
188188 start = time .time ()
189189 print ("Calculating Kmeans..." )
190190 kmeans = MiniBatchKMeans (n_landmark ,
@@ -306,8 +306,8 @@ def calculate_operator(data, k=15, a=10, alpha_decay=True, n_landmark=2000,
306306 kernel , n_landmark = n_landmark ,
307307 random_state = random_state , verbose = verbose )
308308 if verbose :
309- print ("Built graph and diffusion operator in %.2f seconds." %
310- (time .time () - tic ))
309+ print ("Built graph and diffusion operator in "
310+ "{:.2f} seconds." . format (time .time () - tic ))
311311 else :
312312 if verbose :
313313 print ("Using precomputed diffusion operator..." )
@@ -395,8 +395,8 @@ def embed_mds(diff_op, t=30, n_components=2, diff_potential=None,
395395 "'sqrt'. '%s' was passed." % (potential_method ))
396396
397397 if verbose :
398- print ("Calculated diffusion potential in %.2f seconds." %
399- (time .time () - tic ))
398+ print ("Calculated diffusion potential in "
399+ "{:.2f} seconds." . format (time .time () - tic ))
400400 # if diffusion potential is precomputed (i.e. 'mds' or 'mds_dist' has
401401 # changed on PHATE object)
402402 else :
@@ -405,7 +405,7 @@ def embed_mds(diff_op, t=30, n_components=2, diff_potential=None,
405405
406406 tic = time .time ()
407407 if verbose :
408- print ("Embedding data using %s MDS..." % (mds ))
408+ print ("Embedding data using {} MDS..." . format (mds ))
409409 if embedding is None :
410410 embedding = embed_MDS (diff_potential , ndim = n_components , how = mds ,
411411 distance_metric = mds_dist , n_jobs = n_jobs ,
@@ -414,7 +414,7 @@ def embed_mds(diff_op, t=30, n_components=2, diff_potential=None,
414414 # return to ambient space
415415 embedding = landmark_transitions .dot (embedding )
416416 if verbose :
417- print ("Embedded data in % .2f seconds." % (time .time () - tic ))
417+ print ("Embedded data in {: .2f} seconds." . format (time .time () - tic ))
418418 else :
419419 if verbose :
420420 print ("Using precomputed embedding..." )
@@ -747,8 +747,8 @@ def fit_transform(self, X, **kwargs):
747747 self .fit (X )
748748 self .transform (** kwargs )
749749 if self .verbose :
750- print ("Finished PHATE embedding in % .2f seconds.\n " %
751- ( time .time () - start ))
750+ print ("Finished PHATE embedding in {: .2f} seconds.\n " . format (
751+ time .time () - start ))
752752 return self .embedding
753753
754754 def von_neumann_entropy (self , t_max = 100 ):
0 commit comments