Decision Tree for Regression

Tree Models & Ensembles DS practice problem on Onlearn.

Difficulty: medium.

Topics: Understanding Decision Tree Regression via Recursive Partitioning, Sum of Squared Errors (SSE), Mean Squared Error (MSE) Reduction, Gini Impurity vs Variance, Recursive Depth-First Search, Leaf Node Mean Prediction, Supervised Learning, Statistical Modeling, Computational Complexity, Data Structures, Optimization Theory, Recursive Partitioning, Regression Metrics, Overfitting and Regularization, Feature Selection, Tree Traversal Algorithms.

Implement a Decision Tree Regressor from scratch using Python. Your implementation should include a Node class to represent the tree structure, a method to determine the best split based on Variance Reduction (minimizing MSE), and a predict method to traverse the tree for new input data.