@@ -85,7 +85,7 @@ def fit(self):
85
85
i1 , i2 = self .choose_alpha .send (state )
86
86
state = None
87
87
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!" )
89
89
break
90
90
91
91
# 2: calculate new alpha2 and new alpha1
@@ -453,7 +453,7 @@ def call_func(*args, **kwargs):
453
453
454
454
@count_time
455
455
def test_cancel_data ():
456
- print ("Hello!\r \ n Start test svm by smo algorithm!" )
456
+ print ("Hello!\n Start test svm by smo algorithm!" )
457
457
# 0: download dataset and load into pandas' dataframe
458
458
if not os .path .exists (r"cancel_data.csv" ):
459
459
request = urllib .request .Request (
@@ -499,13 +499,13 @@ def test_cancel_data():
499
499
for i in range (test_tags .shape [0 ]):
500
500
if test_tags [i ] == predict [i ]:
501
501
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 } " )
503
503
print (f"Rough Accuracy: { score / test_tags .shape [0 ]} " )
504
504
505
505
506
506
def test_demonstration ():
507
507
# change stdout
508
- print ("\r \ n Start plot,please wait!!!" )
508
+ print ("\n Start plot,please wait!!!" )
509
509
sys .stdout = open (os .devnull , "w" )
510
510
511
511
ax1 = plt .subplot2grid ((2 , 2 ), (0 , 0 ))
0 commit comments