Merge branch 'master' into modernize-python2-code

This commit is contained in:
cclauss
2017-12-13 16:32:28 +01:00
committed by GitHub
18 changed files with 1053 additions and 173 deletions

15
machine_learning/scoring_functions.py Normal file → Executable file
View File

@ -61,3 +61,18 @@ def rmsle(predict, actual):
score = np.sqrt(mean_square_diff)
return score
#Mean Bias Deviation
def mbd(predict, actual):
predict = np.array(predict)
actual = np.array(actual)
difference = predict - actual
numerator = np.sum(difference) / len(predict)
denumerator = np.sum(actual) / len(predict)
print str(numerator)
print str(denumerator)
score = float(numerator) / denumerator * 100
return score