File tree 1 file changed +17
-2
lines changed
1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 1
- import numpy
1
+ import numpy as np
2
2
3
3
""" Here I implemented the scoring functions.
4
4
MAE, MSE, RMSE, RMSLE are included.
@@ -41,7 +41,7 @@ def rmse(predict, actual):
41
41
actual = np .array (actual )
42
42
43
43
difference = predict - actual
44
- square_diff = np .square (dfference )
44
+ square_diff = np .square (difference )
45
45
mean_square_diff = square_diff .mean ()
46
46
score = np .sqrt (mean_square_diff )
47
47
return score
@@ -61,3 +61,18 @@ def rmsle(predict, actual):
61
61
score = np .sqrt (mean_square_diff )
62
62
63
63
return score
64
+
65
+ #Mean Bias Deviation
66
+ def mbd (predict , actual ):
67
+ predict = np .array (predict )
68
+ actual = np .array (actual )
69
+
70
+ difference = predict - actual
71
+ numerator = np .sum (difference ) / len (predict )
72
+ denumerator = np .sum (actual ) / len (predict )
73
+ print str (numerator )
74
+ print str (denumerator )
75
+
76
+ score = float (numerator ) / denumerator * 100
77
+
78
+ return score
You can’t perform that action at this time.
0 commit comments