Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fe55ee0

Browse files
committedSep 30, 2024
Fix some more numpy tests
1 parent b82f1bd commit fe55ee0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
 

‎machine_learning/scoring_functions.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def rmse(predict, actual):
6363
"""
6464
Examples(rounded for precision):
6565
>>> actual = [1,2,3];predict = [1,4,3]
66-
>>> np.around(rmse(predict,actual),decimals = 2)
66+
>>> float(np.around(rmse(predict,actual),decimals = 2))
6767
1.15
6868
6969
>>> actual = [1,1,1];predict = [1,1,1]
@@ -85,11 +85,11 @@ def rmsle(predict, actual):
8585
"""
8686
Examples(rounded for precision):
8787
>>> actual = [10,10,30];predict = [10,2,30])
88-
>>> float(np.around(rmsle(predict,actual),decimals = 2)
88+
>>> float(np.around(rmsle(predict, actual), decimals=2))
8989
0.75
9090
91-
>>> actual = [1,1,1];predict = [1,1,1]
92-
>>> float(rmsle(predict,actual))
91+
>>> actual = [1,1,1] ; predict = [1,1,1]
92+
>>> float(rmsle(predict, actual))
9393
0.0
9494
"""
9595
predict = np.array(predict)
@@ -117,12 +117,12 @@ def mbd(predict, actual):
117117
118118
Here the model overpredicts
119119
>>> actual = [1,2,3];predict = [2,3,4]
120-
>>> np.around(mbd(predict,actual),decimals = 2)
120+
>>> float(np.around(mbd(predict,actual),decimals = 2))
121121
50.0
122122
123123
Here the model underpredicts
124124
>>> actual = [1,2,3];predict = [0,1,1]
125-
>>> np.around(mbd(predict,actual),decimals = 2)
125+
>>> float(np.around(mbd(predict,actual),decimals = 2))
126126
-66.67
127127
"""
128128
predict = np.array(predict)

0 commit comments

Comments
 (0)
Please sign in to comment.