Split the Iris data with test_size=.3, random_state=7, stratify=y. Use depths 1,3,None.
Procedure
Train three DecisionTreeClassifier models on the same data split.
Record Train Accuracy, Test Accuracy, and the number of Leaves, and read the decision path for one Test sample.
Results to retain
A table of 3 depth conditions and an explanation of one sample's decision path.
Items to record and points to check
max_depth
Leaf count
Train Accuracy
Test Accuracy
Points to check
Did you avoid repeatedly tuning depth on the Test data?
2. Comparison with Random Forest
Starting conditions
Compare with RandomForest using n_estimators=50, max_depth=3 on the same split.
Procedure
Use the same train/test split as before and train RandomForestClassifier(n_estimators=50,max_depth=3,random_state=7).
Record the train and test accuracy of the depth-3 Decision Tree and Random Forest from the previous activity in the same table.
Provide one shared Test sample to both models and record its true label and each prediction. Explain the difference between a single Tree's result and combining results from multiple Trees.
Results to retain
A Tree–Forest comparison table using the same split and predictions for shared Test samples.
Items to record and points to check
Model and settings
Train Accuracy
Test Accuracy
Selected test index, ground truth, and prediction
Points to check
Did you compare both models using the same train/test data?
3. Checking Other Inputs
Starting conditions
Split once more using split seed=11 and check whether the model ranking holds.
Procedure
Keep test_size=.3 and stratify=y unchanged, and change only the split's random_state to 11.
Retrain the depth-3 Tree and the Forest with 50 Trees from the previous activity on the new Train set. Keep the other model settings unchanged.
Tabulate split seed, model name, Train Accuracy, and Test Accuracy. Explain whether the ordering of Test Accuracy remains the same for seeds 7 and 11.
Results to retain
A table of split seeds and accuracy by model, and changes in the comparison results.
Items to record and points to check
Split Seed
Model
Train·Test Accuracy
Comparison results for the two models
Points to check
Did you change only the data split Seed while keeping the model settings unchanged?