Problem 1: Train a Basic Decision Tree Classifier
Easypython
Problem Description
Write a Python program that trains a Decision Tree classifier with max_depth=2 on a small dataset, and predicts the class for a new data point.
Input
A small labeled dataset and one new data point.
Output
The predicted class.
Constraints
- At least 6 labeled training examples.
Example Input
textX=[[1,60],[2,65],[8,95],[9,98]], y=[0,0,1,1], new=[[7,90]]
Example Output
textPrediction: [1]
Concepts Covered
DecisionTreeClassifier, .fit(), .predict().