Skip to content

Commit 0729521

Browse files
committed
Fix some more numpy tests
1 parent fe55ee0 commit 0729521

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

machine_learning/scoring_functions.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,10 @@ def rmse(predict, actual):
8484
def rmsle(predict, actual):
8585
"""
8686
Examples(rounded for precision):
87-
>>> actual = [10,10,30];predict = [10,2,30])
88-
>>> float(np.around(rmsle(predict, actual), decimals=2))
87+
>>> float(np.around(rmsle(predict=[10, 2, 30], actual=[10, 10, 30]), decimals=2))
8988
0.75
9089
91-
>>> actual = [1,1,1] ; predict = [1,1,1]
92-
>>> float(rmsle(predict, actual))
90+
>>> float(rmsle(predict=[1, 1, 1], actual=[1, 1, 1]))
9391
0.0
9492
"""
9593
predict = np.array(predict)

other/bankers_algorithm.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,11 @@ def __need_index_manager(self) -> dict[int, list[int]]:
8787
This function builds an index control dictionary to track original ids/indices
8888
of processes when altered during execution of method "main"
8989
Return: {0: [a: int, b: int], 1: [c: int, d: int]}
90-
>>> {key: [int(x) for x in value] in key, value in
91-
... BankersAlgorithm(test_claim_vector, test_allocated_res_table,
92-
... test_maximum_claim_table)._BankersAlgorithm__need_index_manager()
93-
... .items()} # doctest: +NORMALIZE_WHITESPACE
90+
>>> index_control = BankersAlgorithm(
91+
... test_claim_vector, test_allocated_res_table, test_maximum_claim_table
92+
... )._BankersAlgorithm__need_index_manager()
93+
>>> {key: [int(x) for x in value] in key, value
94+
... in index_control.items()} # doctest: +NORMALIZE_WHITESPACE
9495
{0: [1, 2, 0, 3], 1: [0, 1, 3, 1], 2: [1, 1, 0, 2], 3: [1, 3, 2, 0],
9596
4: [2, 0, 0, 3]}
9697
"""

0 commit comments

Comments
 (0)