Problem 1: Compare Train vs Test Error for a Simple Model
Easypython
Problem Description
Write a Python program that trains a very shallow Decision Tree (max_depth=1) on a dataset and compares its training error to its test error, to observe signs of high bias.
Input
A dataset split into training and test sets.
Output
Training and test MSE for the shallow model.
Constraints
- The underlying data should have a non-trivial (non-linear) pattern.
Example Input
text(A dataset with a clear non-linear pattern, split into train/test)
Example Output
textTrain MSE: 0.38 Test MSE: 0.41
Concepts Covered
DecisionTreeRegressor, max_depth, mean_squared_error().