Skip to content

Remove \r from strings #1622

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions machine_learning/sequential_minimum_optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def fit(self):
i1, i2 = self.choose_alpha.send(state)
state = None
except StopIteration:
print("Optimization done!\r\nEvery sample satisfy the KKT condition!")
print("Optimization done!\nEvery sample satisfy the KKT condition!")
break

# 2: calculate new alpha2 and new alpha1
Expand Down Expand Up @@ -453,7 +453,7 @@ def call_func(*args, **kwargs):

@count_time
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
if not os.path.exists(r"cancel_data.csv"):
request = urllib.request.Request(
Expand Down Expand Up @@ -499,13 +499,13 @@ def test_cancel_data():
for i in range(test_tags.shape[0]):
if test_tags[i] == predict[i]:
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]}")


def test_demonstration():
# change stdout
print("\r\nStart plot,please wait!!!")
print("\nStart plot,please wait!!!")
sys.stdout = open(os.devnull, "w")

ax1 = plt.subplot2grid((2, 2), (0, 0))
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ fake_useragent
flake8
matplotlib
mypy
numpy
numpy>=1.17.4
opencv-python
pandas
pillow
Expand Down