#C13585. Iris Classifier Evaluation

    ID: 43139 Type: Default 1000ms 256MiB

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:

  1. The decision tree accuracy rounded to 4 decimals.
  2. The random forest accuracy rounded to 4 decimals.
  3. Three lines for the confusion matrix of the decision tree (each row as space‐separated integers).
  4. Three lines for the confusion matrix of the random forest.
  5. 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. Decision Tree accuracy (rounded to 4 decimal places).
    2. Random Forest accuracy (rounded to 4 decimal places).
    3. 3 lines representing the decision tree’s confusion matrix (each line contains 3 space‐separated integers).
    4. 3 lines representing the random forest’s confusion matrix (each line contains 3 space‐separated integers).
    ## sample
    1.0000
    

    0.9778 16 0 0 0 13 0 0 0 16 16 0 0 0 13 0 0 1 15

    </p>