@@ -85,7 +85,7 @@ def fit(self):
8585 i1 , i2 = self .choose_alpha .send (state )
8686 state = None
8787 except StopIteration :
88- print ("Optimization done!\r \ n Every sample satisfy the KKT condition!" )
88+ print ("Optimization done!\n Every sample satisfy the KKT condition!" )
8989 break
9090
9191 # 2: calculate new alpha2 and new alpha1
@@ -453,7 +453,7 @@ def call_func(*args, **kwargs):
453453
454454@count_time
455455def test_cancel_data ():
456- print ("Hello!\r \ n Start test svm by smo algorithm!" )
456+ print ("Hello!\n Start test svm by smo algorithm!" )
457457 # 0: download dataset and load into pandas' dataframe
458458 if not os .path .exists (r"cancel_data.csv" ):
459459 request = urllib .request .Request (
@@ -499,13 +499,13 @@ def test_cancel_data():
499499 for i in range (test_tags .shape [0 ]):
500500 if test_tags [i ] == predict [i ]:
501501 score += 1
502- print (f"\r \ n all: { test_num } \r \ n right: { score } \r \n false: { test_num - score } " )
502+ print (f"\n all: { test_num } \n right: { score } \n false: { test_num - score } " )
503503 print (f"Rough Accuracy: { score / test_tags .shape [0 ]} " )
504504
505505
506506def test_demonstration ():
507507 # change stdout
508- print ("\r \ n Start plot,please wait!!!" )
508+ print ("\n Start plot,please wait!!!" )
509509 sys .stdout = open (os .devnull , "w" )
510510
511511 ax1 = plt .subplot2grid ((2 , 2 ), (0 , 0 ))
0 commit comments