#C13585. Iris Classifier Evaluation
Iris Classifier Evaluation
Iris Classifier Evaluation
You are given the Iris dataset and your task is to implement two classifiers:
- A Decision Tree Classifier
- A Random Forest Classifier
Using scikit-learn
, you will split the data into training and testing sets with a fixed random state. Train the classifiers then compute the accuracy and confusion matrix for both models. The decision tree should produce an accuracy \(a_{DT}\) and the random forest \(a_{RF}\) accuracy such that \(a_{DT} > 0.9\) and \(a_{RF} > 0.9\).
After evaluation, output 8 lines to stdout in the following order:
- The decision tree accuracy rounded to 4 decimals.
- The random forest accuracy rounded to 4 decimals.
- Three lines for the confusion matrix of the decision tree (each row as space‐separated integers).
- Three lines for the confusion matrix of the random forest.
- Decision Tree accuracy (rounded to 4 decimal places).
- Random Forest accuracy (rounded to 4 decimal places).
- 3 lines representing the decision tree’s confusion matrix (each line contains 3 space‐separated integers).
- 3 lines representing the random forest’s confusion matrix (each line contains 3 space‐separated integers).
Note: Any formulas must be displayed in LaTeX format (e.g. \(\cdot\)).
inputFormat
No input from STDIN is required.
outputFormat
The program should print exactly 8 lines to STDOUT:
1.0000
0.9778
16 0 0
0 13 0
0 0 16
16 0 0
0 13 0
0 1 15
</p>