From 6b65c9804a1abadffd4e613dcc4ae8a8186d46b2 Mon Sep 17 00:00:00 2001 From: neilde23 <72068205+neilde23@users.noreply.github.com> Date: Wed, 26 Oct 2022 07:36:10 +0200 Subject: [PATCH] Update DecisionTree.py --- DecisionTree.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DecisionTree.py b/DecisionTree.py index 3ce7c68..13f7640 100644 --- a/DecisionTree.py +++ b/DecisionTree.py @@ -48,7 +48,7 @@ def __init__( # Getting the GINI impurity based on the Y distribution self.gini_impurity = self.get_GINI() - # Sorting the counts and saving the final prediction of the node + # Sorting the counts and saving the final prediction counts_sorted = list(sorted(self.counts.items(), key=lambda item: item[1])) # Getting the last item @@ -312,4 +312,4 @@ def predict_obs(self, values: dict) -> int: # Predicting Xsubset = X.copy() Xsubset['yhat'] = root.predict(Xsubset) - print(Xsubset) \ No newline at end of file + print(Xsubset)