Skip to content

Commit 183b999

Browse files
Fix MSE calculation bug and refactor decision tree logic
1 parent 841e947 commit 183b999

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

machine_learning/decision_tree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def train(self, x, y):
9696
return
9797

9898
best_split = 0
99-
min_error = self.mean_squared_error(x, np.mean(y)) * 2
99+
min_error = self.mean_squared_error(y, np.mean(y)) * 2
100100

101101
"""
102102
loop over all possible splits for the decision tree. find the best split.

0 commit comments

Comments
 (0)