From defe474d51601da1e56db5884b4c3c663236a990 Mon Sep 17 00:00:00 2001 From: webmasterpro Date: Sat, 9 Dec 2017 11:43:28 -0700 Subject: [PATCH 1/2] updated decision tree with scoring functions --- machine_learning/decision_tree.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/machine_learning/decision_tree.py b/machine_learning/decision_tree.py index 51f600cace41..d4a6e72ad2d9 100644 --- a/machine_learning/decision_tree.py +++ b/machine_learning/decision_tree.py @@ -5,6 +5,7 @@ """ import numpy as np +import scoring_functions as scoring_functions class Decision_Tree: def __init__(self, depth = 5, min_leaf_size = 5): @@ -133,6 +134,9 @@ def main(): print("Test values: " + str(test_cases)) print("Predictions: " + str(predictions)) print("Average error: " + str(avg_error)) + print("Scoring mae: ") + str(scoring_functions.mae(test_cases,predictions)) + print("Scoring rmse: ") + str(scoring_functions.rmse(test_cases,predictions)) + if __name__ == '__main__': From 6057b138d63c0d0fdd9cf32b483b6d3b48246c4d Mon Sep 17 00:00:00 2001 From: webmasterpro Date: Sat, 9 Dec 2017 11:48:09 -0700 Subject: [PATCH 2/2] updated decision tree with scoring functions --- machine_learning/decision_tree.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/machine_learning/decision_tree.py b/machine_learning/decision_tree.py index d4a6e72ad2d9..8617803e88aa 100644 --- a/machine_learning/decision_tree.py +++ b/machine_learning/decision_tree.py @@ -136,6 +136,8 @@ def main(): print("Average error: " + str(avg_error)) print("Scoring mae: ") + str(scoring_functions.mae(test_cases,predictions)) print("Scoring rmse: ") + str(scoring_functions.rmse(test_cases,predictions)) + print("Scoring rmsle: ") + str(scoring_functions.rmsle(test_cases,predictions)) + print("Scoring mbd: ") + str(scoring_functions.mbd(test_cases,predictions))