Remove \r from strings (#1622)

* Remove \r from strings

* Satisfy tensorflow with numpy>=1.17.4
This commit is contained in:
Christian Clauss 2019-12-10 15:53:50 +01:00 committed by GitHub
parent 1cbeaa252a
commit b9bff8f3a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -85,7 +85,7 @@ class SmoSVM(object):
i1, i2 = self.choose_alpha.send(state) i1, i2 = self.choose_alpha.send(state)
state = None state = None
except StopIteration: except StopIteration:
print("Optimization done!\r\nEvery sample satisfy the KKT condition!") print("Optimization done!\nEvery sample satisfy the KKT condition!")
break break
# 2: calculate new alpha2 and new alpha1 # 2: calculate new alpha2 and new alpha1
@ -453,7 +453,7 @@ def count_time(func):
@count_time @count_time
def test_cancel_data(): def test_cancel_data():
print("Hello!\r\nStart test svm by smo algorithm!") print("Hello!\nStart test svm by smo algorithm!")
# 0: download dataset and load into pandas' dataframe # 0: download dataset and load into pandas' dataframe
if not os.path.exists(r"cancel_data.csv"): if not os.path.exists(r"cancel_data.csv"):
request = urllib.request.Request( request = urllib.request.Request(
@ -499,13 +499,13 @@ def test_cancel_data():
for i in range(test_tags.shape[0]): for i in range(test_tags.shape[0]):
if test_tags[i] == predict[i]: if test_tags[i] == predict[i]:
score += 1 score += 1
print(f"\r\nall: {test_num}\r\nright: {score}\r\nfalse: {test_num - score}") print(f"\nall: {test_num}\nright: {score}\nfalse: {test_num - score}")
print(f"Rough Accuracy: {score / test_tags.shape[0]}") print(f"Rough Accuracy: {score / test_tags.shape[0]}")
def test_demonstration(): def test_demonstration():
# change stdout # change stdout
print("\r\nStart plot,please wait!!!") print("\nStart plot,please wait!!!")
sys.stdout = open(os.devnull, "w") sys.stdout = open(os.devnull, "w")
ax1 = plt.subplot2grid((2, 2), (0, 0)) ax1 = plt.subplot2grid((2, 2), (0, 0))

View File

@ -4,7 +4,7 @@ fake_useragent
flake8 flake8
matplotlib matplotlib
mypy mypy
numpy numpy>=1.17.4
opencv-python opencv-python
pandas pandas
pillow pillow