From 25946e457080656f2fc23d130e674cccf6a0d0c7 Mon Sep 17 00:00:00 2001 From: Tanuj Dhiman <56601466+tanujdhiman@users.noreply.github.com> Date: Wed, 9 Sep 2020 22:34:46 +0530 Subject: [PATCH] Update scoring_functions.py (#2291) * Update scoring_functions.py We can find accuracy by manually if we are not going to use sklearn library. * Update scoring_functions.py * Update machine_learning/scoring_functions.py Co-authored-by: Christian Clauss --- machine_learning/scoring_functions.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/machine_learning/scoring_functions.py b/machine_learning/scoring_functions.py index a401df139..08b969a95 100755 --- a/machine_learning/scoring_functions.py +++ b/machine_learning/scoring_functions.py @@ -135,3 +135,7 @@ def mbd(predict, actual): score = float(numerator) / denumerator * 100 return score + + +def manual_accuracy(predict, actual): + return np.mean(np.array(actual) == np.array(predict))