mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
Improved readability (#1615)
* improved readability * further readability improvements * removed csv file and added f
This commit is contained in:

committed by
Christian Clauss

parent
938dd0bbb5
commit
9eb50cc223
@ -446,7 +446,7 @@ def count_time(func):
|
||||
start_time = time.time()
|
||||
func(*args, **kwargs)
|
||||
end_time = time.time()
|
||||
print("smo algorithm cost {} seconds".format(end_time - start_time))
|
||||
print(f"smo algorithm cost {end_time - start_time} seconds")
|
||||
|
||||
return call_func
|
||||
|
||||
@ -500,11 +500,9 @@ def test_cancel_data():
|
||||
if test_tags[i] == predict[i]:
|
||||
score += 1
|
||||
print(
|
||||
"\r\nall: {}\r\nright: {}\r\nfalse: {}".format(
|
||||
test_num, score, test_num - score
|
||||
)
|
||||
f"\r\nall: {test_num}\r\nright: {score}\r\nfalse: {test_num - score}"
|
||||
)
|
||||
print("Rough Accuracy: {}".format(score / test_tags.shape[0]))
|
||||
print(f"Rough Accuracy: {score / test_tags.shape[0]}")
|
||||
|
||||
|
||||
def test_demonstration():
|
||||
|
Reference in New Issue
Block a user