Dor-sketch / DecisionTreeAI

An innovative Python implementation of decision trees for machine learning, showcasing algorithmic learning from scratch with practical examples and a focus on AI principles.

Home Page:https://pages.cs.wisc.edu/~dyer/cs540/hw-toc.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🌳 Learning Decision Trees 🌳

This project showcases a Python solution for Assignment 3 of the CS 540 Introduction to Artificial Intelligence course at the University of Wisconsin-Madison, adapted from a CS 20551 Introduction to AI course at the Open University of Israel (2024a) as mmn (Matalat Manche) 18. Originally based on Java code from the assignment, this reimplementation in Python achieved a perfect score! 🎯

Decision Tree



πŸ“– Overview

The implementation of the decision tree is a testament to the robustness and versatility of Python, transitioning from Java while aiming to maintain the original code structure and interface integrity.

πŸ›  Technical Details

Formulas.py

This module contains the formulas for the entropy and information gain calculations, providing a clear and concise representation of the underlying mathematics. The transition from Java to Python was seamless, with the code's readability and maintainability significantly improved.

Important formulas includes:

  • Entropy: $H(S) = -\sum_{i=1}^{c} p_i \log_2 p_i$ where $p_i$ is the probability of class $i$ in the set $S$. Thus, given binary classification, $H(S) = -p \log_2 p - (1-p) \log_2 (1-p)$ where $p$ is the probability of the positive class. The last formula is also written as $B(S)$ in some literature (e.g. the book "Artificial Intelligence: A Modern Approach" by Stuart Russell and Peter Norvig).

  • Remainder: $Remainder(S, A) = \sum_{v \in Values(A)} \frac{|S_v|}{|S|} H(S_v)$ where $S_v$ is the subset of $S$ for which attribute $A$ has value $v$.

  • Information Gain: $IG(S, A) = H(S) - Remainder(S, A)$ gives the information gain of attribute $A$ on set $S$.

my_DecisionTreeImpl.py

At the core, this module encapsulates the essence of decision tree learning, adhering closely to the algorithms outlined in academic literature, with a sprinkle of personal insights for optimization. πŸ€– The transition from Java's rigid type system to Python's dynamic nature posed challenges but ultimately led to a more flexible and readable codebase.

my_HW3.py

This script is the conductor of the symphony, ensuring each part of the decision tree's implementation plays together harmoniously. Through meticulous refactoring, the script now boasts enhanced clarity and structure, guiding the user through the process seamlessly.

my_Instance.py

A crucial component, this class ensures individual instances are managed efficiently, adopting a strategy that aligns with the data's inherent structure while providing easy access and manipulation capabilities.

my_DecisionTree.py & my_DataSet.py

These modules lay the groundwork for the decision tree's operation, translating complex Java logic into Pythonic elegance. The journey from static typing to dynamic required both creativity and precision, ensuring the algorithm's integrity remains intact.


πŸš€ How to Run

Execute your decision tree adventure with the following command, substituting <F> with your desired mode of operation:

python3 my_HW3.py <F> <train-set-file> <test-set-file>

Where <F> represents one of the following modes:

  • mode 0: Revel in the mutual information of each attribute at the root.

  • mode 1: Witness the birth of a decision tree from your training set.

  • mode 2: Predict the future of your test set with your tree.

  • mode 3: Validate your tree's wisdom against the test set.

  • mode 4: Generate a GIF of your tree's growth.


πŸ“ˆ Example Usage

Dive into the examples to see the decision tree tackle real-world datasets, from tennis matches to loan approvals, demonstrating its versatility and accuracy across diverse scenarios.

🎾 Tennis Data Set

The following output are from the tennis data set (Tennis.txt), taken from p.222 of the studing material.

Note the Attributes are:

  • A1: Outlook
  • A2: Temperature
  • A3: Humidity
  • A4: Wind
  • Label: Play

tree_building

The train and test files are identical, so the accuracy is 1.0 as expected.

// tennis.txt
%%,Yes,No
##,A1,Sunny,Overcast,Rain
##,A2,Hot,Mild,Cool
##,A3,High,Normal
##,A4,Weak,Strong
Sunny,Hot,High,Weak,No
Sunny,Hot,High,Strong,No
Overcast,Hot,High,Weak,Yes
Rain,Mild,High,Weak,Yes
Rain,Cool,Normal,Weak,Yes
Rain,Cool,Normal,Strong,No
Overcast,Cool,Normal,Strong,Yes
Sunny,Mild,High,Weak,No
Sunny,Cool,Normal,Weak,Yes
Rain,Mild,Normal,Weak,Yes
Sunny,Mild,Normal,Strong,Yes
Overcast,Mild,High,Strong,Yes
Overcast,Hot,Normal,Weak,Yes
Rain,Mild,High,Strong,No

Outout of the program - matching the expected results from p.223:

dorpascal@Mac-mini HW3_Skeleton % python3.11 my_HW3.py 0 tennis.txt tennis.txt
A1 0.24675
A2 0.02922
A3 0.15184
A4 0.04813
dorpascal@Mac-mini HW3_Skeleton % python3.11 my_HW3.py 1 tennis.txt tennis.txt
└── [A1=?]
    β”‚ Sunny
    β”œβ”€β”€ [A3=?]
    β”‚   β”‚ High
    β”‚   β”œβ”€β”€ Label: No
    β”‚   β”‚ Normal
    β”‚   └── Label: Yes
    β”‚ Overcast
    β”œβ”€β”€ Label: Yes
    β”‚ Rain
    └── [A4=?]
        β”‚ Weak
        β”œβ”€β”€ Label: Yes
        β”‚ Strong
        └── Label: No
dorpascal@Mac-mini HW3_Skeleton % python3.11 my_HW3.py 2 tennis.txt tennis.txt
Classification of Instance: label=No, attributes=0, 0, 0, 0 = No - Correct? True
Classification of Instance: label=No, attributes=0, 0, 0, 1 = No - Correct? True
Classification of Instance: label=Yes, attributes=1, 0, 0, 0 = Yes - Correct? True
Classification of Instance: label=Yes, attributes=2, 1, 0, 0 = Yes - Correct? True
Classification of Instance: label=Yes, attributes=2, 2, 1, 0 = Yes - Correct? True
Classification of Instance: label=No, attributes=2, 2, 1, 1 = No - Correct? True
Classification of Instance: label=Yes, attributes=1, 2, 1, 1 = Yes - Correct? True
Classification of Instance: label=No, attributes=0, 1, 0, 0 = No - Correct? True
Classification of Instance: label=Yes, attributes=0, 2, 1, 0 = Yes - Correct? True
Classification of Instance: label=Yes, attributes=2, 1, 1, 0 = Yes - Correct? True
Classification of Instance: label=Yes, attributes=0, 1, 1, 1 = Yes - Correct? True
Classification of Instance: label=Yes, attributes=1, 1, 0, 1 = Yes - Correct? True
Classification of Instance: label=Yes, attributes=1, 0, 1, 0 = Yes - Correct? True
Classification of Instance: label=No, attributes=2, 1, 0, 1 = No - Correct? True
dorpascal@Mac-mini HW3_Skeleton % python3.11 my_HW3.py 3 tennis.txt tennis.txt
1.00000

🏦 Loans Data Set

loan_tree

GIF based on 108 instances for readability

The following output are from the loan application data set (prune_train.txt and prune_test.txt). Note that the name of the files probably should be loan_train.txt and loan_test.txt as the data set is about loans, but I kept the original names.

Mode 0

dorpascal@Mac-mini HW3_Skeleton % python3 my_HW3.py 0 prune_train.txt prune_test.txt
A1 0.08282
A2 0.03319
A3 0.06140
A4 0.01948
A5 0.00907
A6 0.02554
A7 0.00004
A8 0.00303
A9 0.00000
A10 0.00496

Mode 1

dorpascal@Mac-mini HW3_Skeleton % python3 my_HW3.py 1 prune_train.txt prune_test.txt
└── [A1=?]
    β”‚ x
    β”œβ”€β”€ [A3=?]
    β”‚   β”‚ a
    β”‚   β”œβ”€β”€ [A5=?]
    β”‚   β”‚   β”‚ h
    β”‚   β”‚   β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚ s
    β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚ u
    β”‚   β”‚   └── Label: G
    β”‚   β”‚ c
    β”‚   β”œβ”€β”€ [A2=?]
    β”‚   β”‚   β”‚ n
    β”‚   β”‚   β”œβ”€β”€ [A5=?]
    β”‚   β”‚   β”‚   β”‚ h
    β”‚   β”‚   β”‚   β”œβ”€β”€ [A4=?]
    β”‚   β”‚   β”‚   β”‚   β”‚ o
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚ f
    β”‚   β”‚   β”‚   β”‚   └── Label: B
    β”‚   β”‚   β”‚   β”‚ s
    β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚ u
    β”‚   β”‚   β”‚   └── [A4=?]
    β”‚   β”‚   β”‚       β”‚ r
    β”‚   β”‚   β”‚       β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚       β”‚ o
    β”‚   β”‚   β”‚       └── Label: B
    β”‚   β”‚   β”‚ b
    β”‚   β”‚   β”œβ”€β”€ [A6=?]
    β”‚   β”‚   β”‚   β”‚ c
    β”‚   β”‚   β”‚   β”œβ”€β”€ [A5=?]
    β”‚   β”‚   β”‚   β”‚   β”‚ h
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ [A8=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ 1
    β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ 2
    β”‚   β”‚   β”‚   β”‚   β”‚   └── [A9=?]
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚ y
    β”‚   β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ [A4=?]
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   β”‚ o
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   └── [A7=?]
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚       β”‚ 1
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚       └── [A10=?]
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚           β”‚ y
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚           └── Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚ n
    β”‚   β”‚   β”‚   β”‚   β”‚       └── Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚ s
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚ u
    β”‚   β”‚   β”‚   β”‚   └── Label: G
    β”‚   β”‚   β”‚   β”‚ l
    β”‚   β”‚   β”‚   β”œβ”€β”€ [A4=?]
    β”‚   β”‚   β”‚   β”‚   β”‚ r
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚ o
    β”‚   β”‚   β”‚   β”‚   └── [A5=?]
    β”‚   β”‚   β”‚   β”‚       β”‚ s
    β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ [A9=?]
    β”‚   β”‚   β”‚   β”‚       β”‚   β”‚ y
    β”‚   β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚       β”‚   β”‚ n
    β”‚   β”‚   β”‚   β”‚       β”‚   └── [A7=?]
    β”‚   β”‚   β”‚   β”‚       β”‚       β”‚ 1
    β”‚   β”‚   β”‚   β”‚       β”‚       └── [A8=?]
    β”‚   β”‚   β”‚   β”‚       β”‚           β”‚ 2
    β”‚   β”‚   β”‚   β”‚       β”‚           └── [A10=?]
    β”‚   β”‚   β”‚   β”‚       β”‚               β”‚ y
    β”‚   β”‚   β”‚   β”‚       β”‚               └── Label: G
    β”‚   β”‚   β”‚   β”‚       β”‚ n
    β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚       β”‚ u
    β”‚   β”‚   β”‚   β”‚       └── Label: G
    β”‚   β”‚   β”‚   β”‚ r
    β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚ n
    β”‚   β”‚   β”‚   └── Label: G
    β”‚   β”‚   β”‚ m
    β”‚   β”‚   β”œβ”€β”€ [A6=?]
    β”‚   β”‚   β”‚   β”‚ c
    β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚ l
    β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚ r
    β”‚   β”‚   β”‚   └── [A8=?]
    β”‚   β”‚   β”‚       β”‚ 1
    β”‚   β”‚   β”‚       β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚       β”‚ 2
    β”‚   β”‚   β”‚       β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚       β”‚ 3
    β”‚   β”‚   β”‚       └── Label: G
    β”‚   β”‚   β”‚ g
    β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚ w
    β”‚   β”‚   └── Label: G
    β”‚   β”‚ d
    β”‚   β”œβ”€β”€ [A7=?]
    β”‚   β”‚   β”‚ 1
    β”‚   β”‚   β”œβ”€β”€ [A5=?]
    β”‚   β”‚   β”‚   β”‚ h
    β”‚   β”‚   β”‚   β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚   β”‚ s
    β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚ u
    β”‚   β”‚   β”‚   └── Label: G
    β”‚   β”‚   β”‚ 2
    β”‚   β”‚   └── [A2=?]
    β”‚   β”‚       β”‚ n
    β”‚   β”‚       β”œβ”€β”€ Label: G
    β”‚   β”‚       β”‚ b
    β”‚   β”‚       β”œβ”€β”€ Label: B
    β”‚   β”‚       β”‚ g
    β”‚   β”‚       β”œβ”€β”€ Label: B
    β”‚   β”‚       β”‚ w
    β”‚   β”‚       └── Label: B
    β”‚   β”‚ e
    β”‚   β”œβ”€β”€ [A8=?]
    β”‚   β”‚   β”‚ 1
    β”‚   β”‚   β”œβ”€β”€ [A2=?]
    β”‚   β”‚   β”‚   β”‚ n
    β”‚   β”‚   β”‚   β”œβ”€β”€ [A9=?]
    β”‚   β”‚   β”‚   β”‚   β”‚ y
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚ n
    β”‚   β”‚   β”‚   β”‚   └── [A6=?]
    β”‚   β”‚   β”‚   β”‚       β”‚ c
    β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚       β”‚ l
    β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ [A5=?]
    β”‚   β”‚   β”‚   β”‚       β”‚   β”‚ s
    β”‚   β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚       β”‚   β”‚ u
    β”‚   β”‚   β”‚   β”‚       β”‚   └── [A10=?]
    β”‚   β”‚   β”‚   β”‚       β”‚       β”‚ y
    β”‚   β”‚   β”‚   β”‚       β”‚       β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚   β”‚       β”‚       β”‚ n
    β”‚   β”‚   β”‚   β”‚       β”‚       └── Label: G
    β”‚   β”‚   β”‚   β”‚       β”‚ r
    β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ [A5=?]
    β”‚   β”‚   β”‚   β”‚       β”‚   β”‚ s
    β”‚   β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ [A4=?]
    β”‚   β”‚   β”‚   β”‚       β”‚   β”‚   β”‚ o
    β”‚   β”‚   β”‚   β”‚       β”‚   β”‚   └── [A7=?]
    β”‚   β”‚   β”‚   β”‚       β”‚   β”‚       β”‚ 1
    β”‚   β”‚   β”‚   β”‚       β”‚   β”‚       └── [A10=?]
    β”‚   β”‚   β”‚   β”‚       β”‚   β”‚           β”‚ y
    β”‚   β”‚   β”‚   β”‚       β”‚   β”‚           └── Label: B
    β”‚   β”‚   β”‚   β”‚       β”‚   β”‚ u
    β”‚   β”‚   β”‚   β”‚       β”‚   └── Label: G
    β”‚   β”‚   β”‚   β”‚       β”‚ n
    β”‚   β”‚   β”‚   β”‚       └── Label: G
    β”‚   β”‚   β”‚   β”‚ b
    β”‚   β”‚   β”‚   β”œβ”€β”€ [A4=?]
    β”‚   β”‚   β”‚   β”‚   β”‚ r
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ [A5=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ h
    β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ [A6=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ c
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   └── [A7=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       β”‚ 1
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       └── [A9=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚           β”‚ y
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚           └── [A10=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚               β”‚ y
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚               └── Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ s
    β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ [A6=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ l
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ r
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   └── [A7=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       β”‚ 1
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       └── [A9=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚           β”‚ n
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚           └── [A10=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚               β”‚ y
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚               └── Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ u
    β”‚   β”‚   β”‚   β”‚   β”‚   └── Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚ o
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ [A5=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ h
    β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ s
    β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ [A6=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ c
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ l
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ r
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   └── [A7=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       β”‚ 1
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ [A9=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   β”‚ y
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   β”‚ n
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   └── [A10=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       β”‚       β”‚ y
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       β”‚       └── Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       β”‚ 2
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       └── Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ u
    β”‚   β”‚   β”‚   β”‚   β”‚   └── [A6=?]
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚ l
    β”‚   β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚ r
    β”‚   β”‚   β”‚   β”‚   β”‚       └── Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚ f
    β”‚   β”‚   β”‚   β”‚   └── Label: B
    β”‚   β”‚   β”‚   β”‚ m
    β”‚   β”‚   β”‚   β”œβ”€β”€ [A5=?]
    β”‚   β”‚   β”‚   β”‚   β”‚ h
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ [A4=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ r
    β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ o
    β”‚   β”‚   β”‚   β”‚   β”‚   └── Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚ s
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚ u
    β”‚   β”‚   β”‚   β”‚   └── Label: G
    β”‚   β”‚   β”‚   β”‚ g
    β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚ w
    β”‚   β”‚   β”‚   └── Label: G
    β”‚   β”‚   β”‚ 2
    β”‚   β”‚   β”œβ”€β”€ [A2=?]
    β”‚   β”‚   β”‚   β”‚ n
    β”‚   β”‚   β”‚   β”œβ”€β”€ [A4=?]
    β”‚   β”‚   β”‚   β”‚   β”‚ r
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚ o
    β”‚   β”‚   β”‚   β”‚   └── [A9=?]
    β”‚   β”‚   β”‚   β”‚       β”‚ y
    β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚   β”‚       β”‚ n
    β”‚   β”‚   β”‚   β”‚       └── Label: G
    β”‚   β”‚   β”‚   β”‚ b
    β”‚   β”‚   β”‚   β”œβ”€β”€ [A6=?]
    β”‚   β”‚   β”‚   β”‚   β”‚ c
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ [A5=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ h
    β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ [A4=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ r
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ o
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   └── Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ s
    β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ [A4=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ r
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ o
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   └── Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ u
    β”‚   β”‚   β”‚   β”‚   β”‚   └── Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚ r
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚ n
    β”‚   β”‚   β”‚   β”‚   └── Label: G
    β”‚   β”‚   β”‚   β”‚ m
    β”‚   β”‚   β”‚   └── Label: B
    β”‚   β”‚   β”‚ 3
    β”‚   β”‚   └── Label: G
    β”‚   β”‚ n
    β”‚   └── [A2=?]
    β”‚       β”‚ n
    β”‚       β”œβ”€β”€ Label: B
    β”‚       β”‚ b
    β”‚       β”œβ”€β”€ [A7=?]
    β”‚       β”‚   β”‚ 1
    β”‚       β”‚   β”œβ”€β”€ Label: G
    β”‚       β”‚   β”‚ 2
    β”‚       β”‚   └── Label: B
    β”‚       β”‚ m
    β”‚       └── Label: G
    β”‚ n
    β”œβ”€β”€ [A3=?]
    β”‚   β”‚ a
    β”‚   β”œβ”€β”€ [A6=?]
    β”‚   β”‚   β”‚ c
    β”‚   β”‚   β”œβ”€β”€ [A2=?]
    β”‚   β”‚   β”‚   β”‚ b
    β”‚   β”‚   β”‚   β”œβ”€β”€ [A4=?]
    β”‚   β”‚   β”‚   β”‚   β”‚ r
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚ o
    β”‚   β”‚   β”‚   β”‚   └── [A5=?]
    β”‚   β”‚   β”‚   β”‚       β”‚ s
    β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚   β”‚       β”‚ u
    β”‚   β”‚   β”‚   β”‚       └── Label: G
    β”‚   β”‚   β”‚   β”‚ m
    β”‚   β”‚   β”‚   └── Label: G
    β”‚   β”‚   β”‚ l
    β”‚   β”‚   β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚ n
    β”‚   β”‚   └── Label: B
    β”‚   β”‚ c
    β”‚   β”œβ”€β”€ [A5=?]
    β”‚   β”‚   β”‚ h
    β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚ s
    β”‚   β”‚   β”œβ”€β”€ [A4=?]
    β”‚   β”‚   β”‚   β”‚ r
    β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚ o
    β”‚   β”‚   β”‚   β”œβ”€β”€ [A2=?]
    β”‚   β”‚   β”‚   β”‚   β”‚ n
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚ b
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ [A7=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ 1
    β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ [A6=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ c
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ [A8=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ 2
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   └── [A9=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       β”‚ y
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       └── [A10=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚           β”‚ y
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚           └── Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ l
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   └── [A9=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       β”‚ y
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       β”‚ n
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       └── [A8=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚           β”‚ 2
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚           └── [A10=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚               β”‚ y
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚               └── Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ 2
    β”‚   β”‚   β”‚   β”‚   β”‚   └── Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚ g
    β”‚   β”‚   β”‚   β”‚   └── Label: G
    β”‚   β”‚   β”‚   β”‚ f
    β”‚   β”‚   β”‚   └── Label: B
    β”‚   β”‚   β”‚ n
    β”‚   β”‚   β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚ u
    β”‚   β”‚   └── Label: G
    β”‚   β”‚ d
    β”‚   β”œβ”€β”€ [A2=?]
    β”‚   β”‚   β”‚ n
    β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚ b
    β”‚   β”‚   └── Label: B
    β”‚   β”‚ e
    β”‚   β”œβ”€β”€ [A5=?]
    β”‚   β”‚   β”‚ h
    β”‚   β”‚   β”œβ”€β”€ [A6=?]
    β”‚   β”‚   β”‚   β”‚ c
    β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚ l
    β”‚   β”‚   β”‚   β”œβ”€β”€ [A2=?]
    β”‚   β”‚   β”‚   β”‚   β”‚ n
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚ b
    β”‚   β”‚   β”‚   β”‚   └── [A4=?]
    β”‚   β”‚   β”‚   β”‚       β”‚ r
    β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ [A7=?]
    β”‚   β”‚   β”‚   β”‚       β”‚   β”‚ 1
    β”‚   β”‚   β”‚   β”‚       β”‚   └── [A8=?]
    β”‚   β”‚   β”‚   β”‚       β”‚       β”‚ 1
    β”‚   β”‚   β”‚   β”‚       β”‚       └── [A9=?]
    β”‚   β”‚   β”‚   β”‚       β”‚           β”‚ y
    β”‚   β”‚   β”‚   β”‚       β”‚           └── [A10=?]
    β”‚   β”‚   β”‚   β”‚       β”‚               β”‚ y
    β”‚   β”‚   β”‚   β”‚       β”‚               └── Label: B
    β”‚   β”‚   β”‚   β”‚       β”‚ o
    β”‚   β”‚   β”‚   β”‚       └── Label: B
    β”‚   β”‚   β”‚   β”‚ r
    β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚ n
    β”‚   β”‚   β”‚   └── [A2=?]
    β”‚   β”‚   β”‚       β”‚ b
    β”‚   β”‚   β”‚       └── [A4=?]
    β”‚   β”‚   β”‚           β”‚ f
    β”‚   β”‚   β”‚           └── [A7=?]
    β”‚   β”‚   β”‚               β”‚ 1
    β”‚   β”‚   β”‚               └── [A8=?]
    β”‚   β”‚   β”‚                   β”‚ 1
    β”‚   β”‚   β”‚                   └── [A9=?]
    β”‚   β”‚   β”‚                       β”‚ y
    β”‚   β”‚   β”‚                       └── [A10=?]
    β”‚   β”‚   β”‚                           β”‚ y
    β”‚   β”‚   β”‚                           └── Label: B
    β”‚   β”‚   β”‚ s
    β”‚   β”‚   β”œβ”€β”€ [A2=?]
    β”‚   β”‚   β”‚   β”‚ n
    β”‚   β”‚   β”‚   β”œβ”€β”€ [A9=?]
    β”‚   β”‚   β”‚   β”‚   β”‚ y
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ [A4=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ r
    β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ o
    β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ f
    β”‚   β”‚   β”‚   β”‚   β”‚   └── Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚ n
    β”‚   β”‚   β”‚   β”‚   └── Label: B
    β”‚   β”‚   β”‚   β”‚ b
    β”‚   β”‚   β”‚   β”œβ”€β”€ [A8=?]
    β”‚   β”‚   β”‚   β”‚   β”‚ 1
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ [A9=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ y
    β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ [A6=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ c
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ l
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ [A4=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ o
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   └── [A7=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       β”‚ 1
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       └── [A10=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚           β”‚ y
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚           └── Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ r
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ n
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   └── Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ n
    β”‚   β”‚   β”‚   β”‚   β”‚   └── [A6=?]
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚ c
    β”‚   β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ [A4=?]
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   β”‚ r
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   β”‚ o
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   └── [A7=?]
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚       β”‚ 1
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚       └── [A10=?]
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚           β”‚ y
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚           └── Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚ l
    β”‚   β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ [A7=?]
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   β”‚ 1
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ [A4=?]
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   β”‚   β”‚ r
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   β”‚   β”œβ”€β”€ [A10=?]
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   β”‚   β”‚   β”‚ y
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   β”‚   β”‚   └── Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   β”‚   β”‚ o
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   β”‚   └── Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   β”‚ 2
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   └── [A4=?]
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚       β”‚ o
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚       └── [A10=?]
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚           β”‚ y
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚           └── Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚ r
    β”‚   β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ [A4=?]
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   β”‚ r
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   β”‚ o
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   └── [A10=?]
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚       β”‚ y
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚       β”œβ”€β”€ [A7=?]
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚       β”‚   β”‚ 1
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚       β”‚   └── Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚       β”‚ n
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚       └── Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚ n
    β”‚   β”‚   β”‚   β”‚   β”‚       └── [A7=?]
    β”‚   β”‚   β”‚   β”‚   β”‚           β”‚ 1
    β”‚   β”‚   β”‚   β”‚   β”‚           β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚           β”‚ 2
    β”‚   β”‚   β”‚   β”‚   β”‚           └── [A4=?]
    β”‚   β”‚   β”‚   β”‚   β”‚               β”‚ f
    β”‚   β”‚   β”‚   β”‚   β”‚               └── [A10=?]
    β”‚   β”‚   β”‚   β”‚   β”‚                   β”‚ y
    β”‚   β”‚   β”‚   β”‚   β”‚                   └── Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚ 2
    β”‚   β”‚   β”‚   β”‚   └── Label: B
    β”‚   β”‚   β”‚   β”‚ m
    β”‚   β”‚   β”‚   β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚   β”‚ g
    β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚ w
    β”‚   β”‚   β”‚   └── Label: G
    β”‚   β”‚   β”‚ n
    β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚ u
    β”‚   β”‚   └── [A6=?]
    β”‚   β”‚       β”‚ c
    β”‚   β”‚       β”œβ”€β”€ [A2=?]
    β”‚   β”‚       β”‚   β”‚ b
    β”‚   β”‚       β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚       β”‚   β”‚ m
    β”‚   β”‚       β”‚   └── [A7=?]
    β”‚   β”‚       β”‚       β”‚ 1
    β”‚   β”‚       β”‚       β”œβ”€β”€ Label: B
    β”‚   β”‚       β”‚       β”‚ 2
    β”‚   β”‚       β”‚       └── Label: G
    β”‚   β”‚       β”‚ l
    β”‚   β”‚       β”œβ”€β”€ Label: G
    β”‚   β”‚       β”‚ r
    β”‚   β”‚       β”œβ”€β”€ [A9=?]
    β”‚   β”‚       β”‚   β”‚ y
    β”‚   β”‚       β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚       β”‚   β”‚ n
    β”‚   β”‚       β”‚   └── [A2=?]
    β”‚   β”‚       β”‚       β”‚ n
    β”‚   β”‚       β”‚       β”œβ”€β”€ Label: G
    β”‚   β”‚       β”‚       β”‚ b
    β”‚   β”‚       β”‚       └── [A4=?]
    β”‚   β”‚       β”‚           β”‚ r
    β”‚   β”‚       β”‚           β”œβ”€β”€ Label: G
    β”‚   β”‚       β”‚           β”‚ o
    β”‚   β”‚       β”‚           └── [A7=?]
    β”‚   β”‚       β”‚               β”‚ 1
    β”‚   β”‚       β”‚               β”œβ”€β”€ [A8=?]
    β”‚   β”‚       β”‚               β”‚   β”‚ 1
    β”‚   β”‚       β”‚               β”‚   └── [A10=?]
    β”‚   β”‚       β”‚               β”‚       β”‚ y
    β”‚   β”‚       β”‚               β”‚       └── Label: B
    β”‚   β”‚       β”‚               β”‚ 2
    β”‚   β”‚       β”‚               └── Label: B
    β”‚   β”‚       β”‚ n
    β”‚   β”‚       └── Label: B
    β”‚   β”‚ n
    β”‚   └── [A6=?]
    β”‚       β”‚ c
    β”‚       β”œβ”€β”€ [A2=?]
    β”‚       β”‚   β”‚ n
    β”‚       β”‚   β”œβ”€β”€ Label: G
    β”‚       β”‚   β”‚ b
    β”‚       β”‚   └── Label: B
    β”‚       β”‚ l
    β”‚       β”œβ”€β”€ Label: B
    β”‚       β”‚ r
    β”‚       β”œβ”€β”€ Label: G
    β”‚       β”‚ n
    β”‚       └── Label: B
    β”‚ b
    β”œβ”€β”€ [A6=?]
    β”‚   β”‚ c
    β”‚   β”œβ”€β”€ [A2=?]
    β”‚   β”‚   β”‚ n
    β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚ b
    β”‚   β”‚   β”œβ”€β”€ [A4=?]
    β”‚   β”‚   β”‚   β”‚ r
    β”‚   β”‚   β”‚   β”œβ”€β”€ [A8=?]
    β”‚   β”‚   β”‚   β”‚   β”‚ 1
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚ 2
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚ 3
    β”‚   β”‚   β”‚   β”‚   └── Label: G
    β”‚   β”‚   β”‚   β”‚ o
    β”‚   β”‚   β”‚   β”œβ”€β”€ [A3=?]
    β”‚   β”‚   β”‚   β”‚   β”‚ c
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ [A5=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ h
    β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ s
    β”‚   β”‚   β”‚   β”‚   β”‚   └── [A8=?]
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚ 1
    β”‚   β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚ 2
    β”‚   β”‚   β”‚   β”‚   β”‚       └── Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚ d
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚ e
    β”‚   β”‚   β”‚   β”‚   └── [A8=?]
    β”‚   β”‚   β”‚   β”‚       β”‚ 1
    β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ [A9=?]
    β”‚   β”‚   β”‚   β”‚       β”‚   β”‚ y
    β”‚   β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ [A5=?]
    β”‚   β”‚   β”‚   β”‚       β”‚   β”‚   β”‚ s
    β”‚   β”‚   β”‚   β”‚       β”‚   β”‚   β”œβ”€β”€ [A7=?]
    β”‚   β”‚   β”‚   β”‚       β”‚   β”‚   β”‚   β”‚ 1
    β”‚   β”‚   β”‚   β”‚       β”‚   β”‚   β”‚   β”œβ”€β”€ [A10=?]
    β”‚   β”‚   β”‚   β”‚       β”‚   β”‚   β”‚   β”‚   β”‚ y
    β”‚   β”‚   β”‚   β”‚       β”‚   β”‚   β”‚   β”‚   └── Label: B
    β”‚   β”‚   β”‚   β”‚       β”‚   β”‚   β”‚   β”‚ 2
    β”‚   β”‚   β”‚   β”‚       β”‚   β”‚   β”‚   └── Label: B
    β”‚   β”‚   β”‚   β”‚       β”‚   β”‚   β”‚ u
    β”‚   β”‚   β”‚   β”‚       β”‚   β”‚   └── Label: B
    β”‚   β”‚   β”‚   β”‚       β”‚   β”‚ n
    β”‚   β”‚   β”‚   β”‚       β”‚   └── [A10=?]
    β”‚   β”‚   β”‚   β”‚       β”‚       β”‚ y
    β”‚   β”‚   β”‚   β”‚       β”‚       β”œβ”€β”€ [A5=?]
    β”‚   β”‚   β”‚   β”‚       β”‚       β”‚   β”‚ s
    β”‚   β”‚   β”‚   β”‚       β”‚       β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚       β”‚       β”‚   β”‚ u
    β”‚   β”‚   β”‚   β”‚       β”‚       β”‚   └── [A7=?]
    β”‚   β”‚   β”‚   β”‚       β”‚       β”‚       β”‚ 1
    β”‚   β”‚   β”‚   β”‚       β”‚       β”‚       └── Label: B
    β”‚   β”‚   β”‚   β”‚       β”‚       β”‚ n
    β”‚   β”‚   β”‚   β”‚       β”‚       └── Label: B
    β”‚   β”‚   β”‚   β”‚       β”‚ 2
    β”‚   β”‚   β”‚   β”‚       └── Label: G
    β”‚   β”‚   β”‚   β”‚ f
    β”‚   β”‚   β”‚   └── Label: G
    β”‚   β”‚   β”‚ m
    β”‚   β”‚   β”œβ”€β”€ [A3=?]
    β”‚   β”‚   β”‚   β”‚ a
    β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚ c
    β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚ d
    β”‚   β”‚   β”‚   β”œβ”€β”€ [A5=?]
    β”‚   β”‚   β”‚   β”‚   β”‚ h
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚ s
    β”‚   β”‚   β”‚   β”‚   └── Label: G
    β”‚   β”‚   β”‚   β”‚ e
    β”‚   β”‚   β”‚   β”œβ”€β”€ [A4=?]
    β”‚   β”‚   β”‚   β”‚   β”‚ r
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚ o
    β”‚   β”‚   β”‚   β”‚   └── [A8=?]
    β”‚   β”‚   β”‚   β”‚       β”‚ 1
    β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚   β”‚       β”‚ 2
    β”‚   β”‚   β”‚   β”‚       └── Label: G
    β”‚   β”‚   β”‚   β”‚ n
    β”‚   β”‚   β”‚   └── Label: B
    β”‚   β”‚   β”‚ g
    β”‚   β”‚   β”œβ”€β”€ [A3=?]
    β”‚   β”‚   β”‚   β”‚ c
    β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚ e
    β”‚   β”‚   β”‚   └── Label: B
    β”‚   β”‚   β”‚ w
    β”‚   β”‚   └── Label: G
    β”‚   β”‚ l
    β”‚   β”œβ”€β”€ [A8=?]
    β”‚   β”‚   β”‚ 1
    β”‚   β”‚   β”œβ”€β”€ [A5=?]
    β”‚   β”‚   β”‚   β”‚ h
    β”‚   β”‚   β”‚   β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚   β”‚ s
    β”‚   β”‚   β”‚   β”œβ”€β”€ [A2=?]
    β”‚   β”‚   β”‚   β”‚   β”‚ n
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ [A3=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ e
    β”‚   β”‚   β”‚   β”‚   β”‚   └── [A4=?]
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚ o
    β”‚   β”‚   β”‚   β”‚   β”‚       └── [A7=?]
    β”‚   β”‚   β”‚   β”‚   β”‚           β”‚ 1
    β”‚   β”‚   β”‚   β”‚   β”‚           └── [A9=?]
    β”‚   β”‚   β”‚   β”‚   β”‚               β”‚ n
    β”‚   β”‚   β”‚   β”‚   β”‚               └── [A10=?]
    β”‚   β”‚   β”‚   β”‚   β”‚                   β”‚ y
    β”‚   β”‚   β”‚   β”‚   β”‚                   └── Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚ b
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ [A3=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ c
    β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ [A4=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ o
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   └── [A7=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       β”‚ 1
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       └── [A9=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚           β”‚ n
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚           └── [A10=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚               β”‚ y
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚               └── Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ d
    β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ e
    β”‚   β”‚   β”‚   β”‚   β”‚   └── [A9=?]
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚ y
    β”‚   β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ [A7=?]
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   β”‚ 1
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   β”‚ 2
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚   └── Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚       β”‚ n
    β”‚   β”‚   β”‚   β”‚   β”‚       └── Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚ m
    β”‚   β”‚   β”‚   β”‚   └── Label: B
    β”‚   β”‚   β”‚   β”‚ n
    β”‚   β”‚   β”‚   β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚   β”‚ u
    β”‚   β”‚   β”‚   └── [A2=?]
    β”‚   β”‚   β”‚       β”‚ n
    β”‚   β”‚   β”‚       β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚       β”‚ b
    β”‚   β”‚   β”‚       β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚       β”‚ m
    β”‚   β”‚   β”‚       β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚       β”‚ w
    β”‚   β”‚   β”‚       └── Label: G
    β”‚   β”‚   β”‚ 2
    β”‚   β”‚   └── Label: G
    β”‚   β”‚ r
    β”‚   β”œβ”€β”€ [A8=?]
    β”‚   β”‚   β”‚ 1
    β”‚   β”‚   β”œβ”€β”€ [A2=?]
    β”‚   β”‚   β”‚   β”‚ n
    β”‚   β”‚   β”‚   β”œβ”€β”€ [A5=?]
    β”‚   β”‚   β”‚   β”‚   β”‚ h
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚ s
    β”‚   β”‚   β”‚   β”‚   └── Label: B
    β”‚   β”‚   β”‚   β”‚ b
    β”‚   β”‚   β”‚   β”œβ”€β”€ [A4=?]
    β”‚   β”‚   β”‚   β”‚   β”‚ r
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ [A5=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ h
    β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ s
    β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ [A3=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ e
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   └── [A7=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       β”‚ 1
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚       └── [A9=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚           β”‚ n
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚           └── [A10=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚               β”‚ y
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚               └── Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ u
    β”‚   β”‚   β”‚   β”‚   β”‚   └── Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚ o
    β”‚   β”‚   β”‚   β”‚   └── Label: G
    β”‚   β”‚   β”‚   β”‚ m
    β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚ g
    β”‚   β”‚   β”‚   β”œβ”€β”€ [A5=?]
    β”‚   β”‚   β”‚   β”‚   β”‚ s
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚ u
    β”‚   β”‚   β”‚   β”‚   └── [A3=?]
    β”‚   β”‚   β”‚   β”‚       β”‚ e
    β”‚   β”‚   β”‚   β”‚       └── [A4=?]
    β”‚   β”‚   β”‚   β”‚           β”‚ o
    β”‚   β”‚   β”‚   β”‚           └── [A7=?]
    β”‚   β”‚   β”‚   β”‚               β”‚ 1
    β”‚   β”‚   β”‚   β”‚               └── [A9=?]
    β”‚   β”‚   β”‚   β”‚                   β”‚ n
    β”‚   β”‚   β”‚   β”‚                   └── [A10=?]
    β”‚   β”‚   β”‚   β”‚                       β”‚ y
    β”‚   β”‚   β”‚   β”‚                       └── Label: B
    β”‚   β”‚   β”‚   β”‚ w
    β”‚   β”‚   β”‚   └── Label: G
    β”‚   β”‚   β”‚ 2
    β”‚   β”‚   β”œβ”€β”€ [A5=?]
    β”‚   β”‚   β”‚   β”‚ h
    β”‚   β”‚   β”‚   β”œβ”€β”€ Label: B
    β”‚   β”‚   β”‚   β”‚ s
    β”‚   β”‚   β”‚   β”œβ”€β”€ [A3=?]
    β”‚   β”‚   β”‚   β”‚   β”‚ c
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ [A2=?]
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ n
    β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚   β”‚ b
    β”‚   β”‚   β”‚   β”‚   β”‚   └── Label: B
    β”‚   β”‚   β”‚   β”‚   β”‚ d
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Label: G
    β”‚   β”‚   β”‚   β”‚   β”‚ e
    β”‚   β”‚   β”‚   β”‚   └── Label: B
    β”‚   β”‚   β”‚   β”‚ u
    β”‚   β”‚   β”‚   └── [A7=?]
    β”‚   β”‚   β”‚       β”‚ 1
    β”‚   β”‚   β”‚       β”œβ”€β”€ [A3=?]
    β”‚   β”‚   β”‚       β”‚   β”‚ c
    β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ [A2=?]
    β”‚   β”‚   β”‚       β”‚   β”‚   β”‚ b
    β”‚   β”‚   β”‚       β”‚   β”‚   └── [A4=?]
    β”‚   β”‚   β”‚       β”‚   β”‚       β”‚ o
    β”‚   β”‚   β”‚       β”‚   β”‚       └── [A9=?]
    β”‚   β”‚   β”‚       β”‚   β”‚           β”‚ n
    β”‚   β”‚   β”‚       β”‚   β”‚           └── [A10=?]
    β”‚   β”‚   β”‚       β”‚   β”‚               β”‚ y
    β”‚   β”‚   β”‚       β”‚   β”‚               └── Label: B
    β”‚   β”‚   β”‚       β”‚   β”‚ e
    β”‚   β”‚   β”‚       β”‚   └── Label: G
    β”‚   β”‚   β”‚       β”‚ 2
    β”‚   β”‚   β”‚       └── Label: G
    β”‚   β”‚   β”‚ 3
    β”‚   β”‚   └── [A2=?]
    β”‚   β”‚       β”‚ n
    β”‚   β”‚       β”œβ”€β”€ Label: G
    β”‚   β”‚       β”‚ b
    β”‚   β”‚       └── Label: B
    β”‚   β”‚ n
    β”‚   └── [A3=?]
    β”‚       β”‚ a
    β”‚       β”œβ”€β”€ [A2=?]
    β”‚       β”‚   β”‚ n
    β”‚       β”‚   β”œβ”€β”€ Label: G
    β”‚       β”‚   β”‚ b
    β”‚       β”‚   β”œβ”€β”€ Label: B
    β”‚       β”‚   β”‚ m
    β”‚       β”‚   └── Label: B
    β”‚       β”‚ c
    β”‚       β”œβ”€β”€ Label: G
    β”‚       β”‚ d
    β”‚       β”œβ”€β”€ [A2=?]
    β”‚       β”‚   β”‚ b
    β”‚       β”‚   β”œβ”€β”€ Label: B
    β”‚       β”‚   β”‚ m
    β”‚       β”‚   └── [A4=?]
    β”‚       β”‚       β”‚ o
    β”‚       β”‚       β”œβ”€β”€ Label: B
    β”‚       β”‚       β”‚ f
    β”‚       β”‚       └── Label: G
    β”‚       β”‚ e
    β”‚       β”œβ”€β”€ [A4=?]
    β”‚       β”‚   β”‚ r
    β”‚       β”‚   β”œβ”€β”€ Label: B
    β”‚       β”‚   β”‚ o
    β”‚       β”‚   β”œβ”€β”€ Label: B
    β”‚       β”‚   β”‚ f
    β”‚       β”‚   └── [A5=?]
    β”‚       β”‚       β”‚ h
    β”‚       β”‚       β”œβ”€β”€ [A2=?]
    β”‚       β”‚       β”‚   β”‚ b
    β”‚       β”‚       β”‚   └── [A7=?]
    β”‚       β”‚       β”‚       β”‚ 1
    β”‚       β”‚       β”‚       └── [A8=?]
    β”‚       β”‚       β”‚           β”‚ 1
    β”‚       β”‚       β”‚           └── [A9=?]
    β”‚       β”‚       β”‚               β”‚ y
    β”‚       β”‚       β”‚               └── [A10=?]
    β”‚       β”‚       β”‚                   β”‚ y
    β”‚       β”‚       β”‚                   └── Label: B
    β”‚       β”‚       β”‚ s
    β”‚       β”‚       β”œβ”€β”€ [A2=?]
    β”‚       β”‚       β”‚   β”‚ n
    β”‚       β”‚       β”‚   β”œβ”€β”€ [A7=?]
    β”‚       β”‚       β”‚   β”‚   β”‚ 1
    β”‚       β”‚       β”‚   β”‚   └── [A8=?]
    β”‚       β”‚       β”‚   β”‚       β”‚ 1
    β”‚       β”‚       β”‚   β”‚       └── [A9=?]
    β”‚       β”‚       β”‚   β”‚           β”‚ y
    β”‚       β”‚       β”‚   β”‚           └── [A10=?]
    β”‚       β”‚       β”‚   β”‚               β”‚ y
    β”‚       β”‚       β”‚   β”‚               └── Label: B
    β”‚       β”‚       β”‚   β”‚ m
    β”‚       β”‚       β”‚   └── [A7=?]
    β”‚       β”‚       β”‚       β”‚ 1
    β”‚       β”‚       β”‚       └── [A8=?]
    β”‚       β”‚       β”‚           β”‚ 1
    β”‚       β”‚       β”‚           └── [A9=?]
    β”‚       β”‚       β”‚               β”‚ n
    β”‚       β”‚       β”‚               └── [A10=?]
    β”‚       β”‚       β”‚                   β”‚ y
    β”‚       β”‚       β”‚                   └── Label: B
    β”‚       β”‚       β”‚ n
    β”‚       β”‚       └── Label: G
    β”‚       β”‚ n
    β”‚       └── Label: B
    β”‚ g
    └── [A3=?]
        β”‚ a
        β”œβ”€β”€ [A2=?]
        β”‚   β”‚ n
        β”‚   β”œβ”€β”€ Label: G
        β”‚   β”‚ b
        β”‚   β”œβ”€β”€ Label: B
        β”‚   β”‚ w
        β”‚   └── Label: G
        β”‚ c
        β”œβ”€β”€ [A4=?]
        β”‚   β”‚ r
        β”‚   β”œβ”€β”€ Label: B
        β”‚   β”‚ o
        β”‚   β”œβ”€β”€ Label: G
        β”‚   β”‚ f
        β”‚   └── Label: G
        β”‚ d
        β”œβ”€β”€ Label: B
        β”‚ e
        β”œβ”€β”€ Label: G
        β”‚ n
        └── Label: G

Mode 2

dorpascal@Mac-mini HW3_Skeleton % python3 my_HW3.py 2 prune_train.txt prune_test.txt
Classification of Instance: label=B, attributes=1, 1, 2, 2, 1, 3, 1, 1, 1, 0 = B - Correct? True
Classification of Instance: label=B, attributes=1, 1, 0, 1, 1, 0, 0, 1, 0, 0 = B - Correct? True
Classification of Instance: label=G, attributes=0, 1, 3, 1, 1, 2, 0, 0, 0, 1 = G - Correct? True
Classification of Instance: label=G, attributes=3, 1, 3, 1, 3, 0, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 1, 3, 1, 3, 2, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 2, 1, 1, 1, 1, 0, 1, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=3, 1, 3, 0, 3, 0, 0, 0, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 1, 3, 1, 3, 1, 0, 1, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 1, 2, 1, 1, 0, 1, 1, 0, 0 = B - Correct? False
Classification of Instance: label=B, attributes=1, 1, 3, 0, 1, 0, 0, 0, 1, 0 = G - Correct? False
Classification of Instance: label=B, attributes=1, 1, 1, 2, 3, 3, 0, 1, 1, 0 = G - Correct? False
Classification of Instance: label=B, attributes=2, 2, 0, 2, 0, 3, 0, 1, 0, 0 = B - Correct? True
Classification of Instance: label=B, attributes=1, 0, 3, 1, 1, 0, 0, 0, 1, 0 = B - Correct? True
Classification of Instance: label=G, attributes=3, 1, 2, 1, 1, 0, 0, 1, 0, 0 = B - Correct? False
Classification of Instance: label=B, attributes=2, 1, 3, 2, 1, 3, 0, 0, 1, 0 = G - Correct? False
Classification of Instance: label=B, attributes=1, 1, 3, 0, 1, 0, 0, 0, 1, 0 = G - Correct? False
Classification of Instance: label=G, attributes=0, 1, 3, 2, 0, 3, 0, 0, 0, 0 = B - Correct? False
Classification of Instance: label=G, attributes=0, 1, 3, 1, 1, 0, 0, 1, 0, 0 = G - Correct? True
Classification of Instance: label=B, attributes=0, 1, 2, 1, 1, 0, 0, 1, 1, 0 = G - Correct? False
Classification of Instance: label=G, attributes=0, 0, 3, 1, 1, 0, 0, 0, 0, 0 = G - Correct? True
Classification of Instance: label=B, attributes=1, 1, 4, 1, 1, 2, 0, 1, 1, 0 = G - Correct? False
Classification of Instance: label=G, attributes=0, 0, 3, 1, 0, 1, 1, 0, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=2, 1, 3, 1, 1, 2, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 1, 0, 1, 1, 0, 0, 0, 0, 0 = G - Correct? True
Classification of Instance: label=B, attributes=1, 1, 3, 1, 3, 0, 0, 0, 1, 0 = G - Correct? False
Classification of Instance: label=G, attributes=1, 1, 3, 2, 1, 1, 1, 0, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=3, 1, 3, 1, 1, 1, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=B, attributes=2, 1, 1, 1, 3, 0, 0, 0, 1, 0 = G - Correct? False
Classification of Instance: label=G, attributes=1, 1, 1, 2, 0, 3, 0, 1, 1, 0 = G - Correct? True
Classification of Instance: label=B, attributes=1, 1, 3, 1, 1, 1, 0, 0, 1, 0 = B - Correct? True
Classification of Instance: label=G, attributes=3, 1, 1, 1, 1, 1, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 2, 3, 1, 1, 2, 1, 0, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 0, 1, 1, 1, 1, 0, 1, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=3, 0, 1, 0, 1, 3, 0, 1, 1, 0 = B - Correct? False
Classification of Instance: label=G, attributes=1, 1, 2, 1, 3, 1, 0, 1, 1, 0 = B - Correct? False
Classification of Instance: label=B, attributes=0, 3, 1, 2, 1, 3, 0, 0, 1, 0 = G - Correct? False
Classification of Instance: label=G, attributes=2, 1, 3, 1, 0, 3, 0, 0, 0, 0 = B - Correct? False
Classification of Instance: label=B, attributes=1, 1, 3, 1, 3, 0, 0, 0, 1, 0 = G - Correct? False
Classification of Instance: label=B, attributes=1, 1, 2, 1, 1, 3, 0, 1, 0, 0 = B - Correct? True
Classification of Instance: label=G, attributes=1, 4, 3, 1, 1, 1, 1, 0, 1, 0 = G - Correct? True
Classification of Instance: label=B, attributes=1, 1, 3, 2, 1, 3, 1, 2, 0, 0 = G - Correct? False
Classification of Instance: label=B, attributes=0, 1, 3, 1, 0, 0, 0, 0, 0, 0 = G - Correct? False
Classification of Instance: label=B, attributes=2, 4, 1, 2, 1, 3, 1, 1, 1, 0 = G - Correct? False
Classification of Instance: label=G, attributes=1, 1, 3, 1, 1, 3, 1, 0, 0, 0 = B - Correct? False
Classification of Instance: label=B, attributes=1, 1, 1, 0, 1, 2, 0, 2, 0, 0 = G - Correct? False
Classification of Instance: label=B, attributes=1, 1, 1, 0, 1, 1, 0, 0, 0, 0 = G - Correct? False
Classification of Instance: label=B, attributes=2, 0, 3, 1, 1, 1, 0, 0, 0, 0 = G - Correct? False
Classification of Instance: label=B, attributes=2, 1, 4, 2, 0, 3, 0, 0, 0, 0 = B - Correct? True
Classification of Instance: label=G, attributes=0, 1, 3, 1, 1, 2, 0, 0, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 3, 3, 1, 1, 1, 0, 1, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 3, 3, 1, 1, 1, 0, 0, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=1, 0, 3, 0, 1, 2, 0, 0, 1, 0 = B - Correct? False
Classification of Instance: label=G, attributes=1, 1, 3, 1, 0, 1, 0, 0, 0, 0 = B - Correct? False
Classification of Instance: label=G, attributes=2, 3, 1, 1, 0, 0, 0, 0, 0, 0 = G - Correct? True
Classification of Instance: label=B, attributes=1, 1, 3, 0, 1, 3, 0, 0, 1, 0 = G - Correct? False
Classification of Instance: label=G, attributes=1, 1, 3, 1, 3, 1, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=1, 1, 0, 2, 0, 3, 0, 0, 0, 0 = B - Correct? False
Classification of Instance: label=G, attributes=1, 1, 1, 0, 1, 2, 1, 1, 1, 0 = G - Correct? True
Classification of Instance: label=B, attributes=1, 1, 4, 0, 1, 3, 1, 1, 1, 0 = B - Correct? True
Classification of Instance: label=B, attributes=1, 1, 3, 2, 1, 3, 0, 0, 0, 0 = B - Correct? True
Classification of Instance: label=G, attributes=0, 1, 3, 1, 1, 2, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 1, 3, 1, 1, 0, 0, 0, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=2, 2, 3, 1, 1, 0, 0, 0, 1, 0 = B - Correct? False
Classification of Instance: label=B, attributes=1, 1, 3, 2, 0, 3, 0, 0, 1, 0 = G - Correct? False
Classification of Instance: label=G, attributes=0, 1, 3, 1, 1, 2, 0, 0, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 2, 3, 1, 1, 0, 0, 1, 0, 0 = B - Correct? False
Classification of Instance: label=B, attributes=2, 2, 1, 1, 1, 3, 1, 1, 1, 0 = G - Correct? False
Classification of Instance: label=G, attributes=0, 1, 3, 1, 1, 0, 1, 0, 1, 0 = G - Correct? True
Classification of Instance: label=B, attributes=0, 1, 3, 1, 3, 0, 1, 0, 1, 0 = G - Correct? False
Classification of Instance: label=G, attributes=0, 1, 3, 1, 1, 2, 0, 1, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 1, 1, 1, 1, 0, 0, 1, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 4, 1, 1, 1, 0, 0, 1, 1, 0 = G - Correct? True
Classification of Instance: label=B, attributes=2, 1, 1, 1, 1, 2, 0, 1, 1, 0 = B - Correct? True
Classification of Instance: label=G, attributes=3, 1, 2, 1, 1, 1, 0, 0, 1, 0 = B - Correct? False
Classification of Instance: label=B, attributes=1, 0, 3, 1, 1, 0, 0, 0, 1, 0 = B - Correct? True
Classification of Instance: label=G, attributes=0, 3, 3, 1, 0, 0, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=B, attributes=2, 1, 0, 2, 3, 3, 0, 0, 1, 0 = B - Correct? True
Classification of Instance: label=G, attributes=2, 4, 3, 1, 1, 2, 0, 0, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=1, 1, 1, 1, 3, 2, 1, 0, 1, 1 = G - Correct? True
Classification of Instance: label=B, attributes=2, 1, 3, 2, 0, 3, 0, 0, 0, 0 = B - Correct? True
Classification of Instance: label=G, attributes=1, 3, 3, 1, 1, 2, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 2, 2, 1, 3, 1, 0, 1, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=1, 1, 1, 1, 3, 2, 0, 1, 1, 0 = G - Correct? True
Classification of Instance: label=B, attributes=1, 1, 3, 1, 1, 1, 1, 0, 1, 0 = G - Correct? False
Classification of Instance: label=G, attributes=0, 0, 1, 1, 1, 0, 0, 1, 1, 1 = G - Correct? True
Classification of Instance: label=G, attributes=2, 4, 1, 1, 1, 0, 0, 1, 0, 0 = G - Correct? True
Classification of Instance: label=B, attributes=1, 3, 0, 2, 1, 3, 1, 0, 0, 0 = B - Correct? True
Classification of Instance: label=G, attributes=0, 4, 3, 1, 1, 2, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=3, 0, 3, 1, 0, 0, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=2, 3, 4, 1, 1, 0, 0, 1, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=2, 1, 2, 0, 1, 1, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=B, attributes=1, 1, 1, 0, 1, 1, 0, 1, 1, 1 = G - Correct? False
Classification of Instance: label=B, attributes=2, 1, 3, 1, 1, 2, 0, 0, 1, 0 = G - Correct? False
Classification of Instance: label=G, attributes=1, 0, 3, 0, 3, 0, 0, 1, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 4, 1, 1, 1, 0, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 0, 1, 1, 1, 0, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=2, 0, 2, 2, 1, 3, 1, 0, 0, 0 = G - Correct? True
Classification of Instance: label=B, attributes=3, 1, 4, 1, 0, 0, 0, 1, 0, 0 = G - Correct? False
Classification of Instance: label=G, attributes=0, 1, 1, 1, 1, 0, 0, 1, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 1, 2, 0, 1, 2, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 0, 1, 1, 1, 0, 0, 1, 1, 0 = G - Correct? True
Classification of Instance: label=B, attributes=0, 1, 3, 1, 1, 1, 0, 0, 1, 0 = G - Correct? False
Classification of Instance: label=G, attributes=2, 0, 1, 1, 1, 2, 0, 1, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=1, 1, 1, 1, 1, 0, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=2, 1, 3, 1, 0, 2, 0, 0, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 2, 3, 1, 1, 0, 0, 0, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=1, 1, 3, 1, 3, 1, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 1, 3, 1, 0, 0, 0, 0, 0, 0 = G - Correct? True
Classification of Instance: label=B, attributes=2, 1, 4, 1, 1, 0, 0, 0, 0, 0 = G - Correct? False
Classification of Instance: label=G, attributes=0, 0, 3, 1, 0, 2, 0, 0, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=2, 2, 1, 1, 1, 0, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=1, 1, 1, 2, 0, 3, 1, 1, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 0, 3, 1, 1, 0, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=B, attributes=0, 0, 0, 1, 0, 2, 0, 0, 0, 0 = B - Correct? True
Classification of Instance: label=G, attributes=2, 0, 3, 1, 3, 1, 0, 0, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 0, 1, 1, 3, 2, 1, 1, 1, 0 = B - Correct? False
Classification of Instance: label=G, attributes=0, 1, 3, 1, 1, 0, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 1, 2, 2, 1, 3, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=1, 1, 1, 2, 0, 3, 0, 2, 0, 0 = G - Correct? True
Classification of Instance: label=B, attributes=2, 1, 3, 1, 1, 2, 0, 0, 1, 0 = G - Correct? False
Classification of Instance: label=G, attributes=1, 1, 3, 2, 0, 3, 0, 0, 0, 0 = B - Correct? False
Classification of Instance: label=B, attributes=1, 1, 0, 1, 1, 1, 0, 0, 0, 0 = B - Correct? True
Classification of Instance: label=G, attributes=0, 1, 1, 1, 1, 0, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=B, attributes=2, 1, 3, 1, 1, 3, 0, 0, 1, 0 = B - Correct? True
Classification of Instance: label=B, attributes=3, 2, 3, 2, 3, 3, 1, 0, 1, 0 = G - Correct? False
Classification of Instance: label=G, attributes=0, 1, 1, 1, 1, 1, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=2, 2, 2, 0, 1, 1, 0, 1, 0, 0 = G - Correct? True
Classification of Instance: label=B, attributes=1, 1, 1, 0, 0, 2, 0, 0, 0, 0 = G - Correct? False
Classification of Instance: label=G, attributes=0, 1, 3, 1, 1, 1, 0, 0, 0, 1 = G - Correct? True
Classification of Instance: label=G, attributes=3, 1, 1, 2, 1, 3, 0, 1, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=1, 0, 1, 1, 0, 1, 0, 1, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=1, 1, 1, 0, 1, 2, 1, 2, 1, 0 = G - Correct? True
Classification of Instance: label=B, attributes=1, 1, 3, 1, 1, 0, 0, 0, 0, 0 = B - Correct? True
Classification of Instance: label=G, attributes=2, 0, 2, 2, 0, 3, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=2, 1, 2, 1, 1, 0, 0, 1, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 1, 3, 1, 1, 1, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=B, attributes=2, 1, 3, 1, 1, 0, 0, 0, 1, 0 = G - Correct? False
Classification of Instance: label=G, attributes=0, 1, 3, 1, 2, 2, 0, 0, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=1, 1, 3, 1, 0, 1, 0, 0, 0, 0 = B - Correct? False
Classification of Instance: label=B, attributes=0, 1, 2, 1, 1, 2, 0, 0, 1, 0 = G - Correct? False
Classification of Instance: label=G, attributes=0, 0, 3, 1, 1, 1, 0, 1, 1, 0 = G - Correct? True
Classification of Instance: label=B, attributes=0, 3, 3, 1, 1, 1, 0, 0, 1, 0 = G - Correct? False
Classification of Instance: label=G, attributes=0, 0, 2, 1, 1, 0, 1, 1, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=2, 1, 3, 1, 3, 2, 1, 0, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=1, 1, 1, 1, 1, 1, 0, 1, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=1, 1, 1, 1, 1, 3, 0, 1, 0, 0 = G - Correct? True
Classification of Instance: label=B, attributes=0, 1, 3, 1, 1, 0, 0, 0, 1, 0 = G - Correct? False
Classification of Instance: label=B, attributes=2, 1, 3, 1, 1, 1, 0, 0, 1, 0 = G - Correct? False
Classification of Instance: label=G, attributes=0, 1, 3, 1, 1, 2, 0, 0, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=2, 2, 2, 0, 0, 0, 0, 0, 0, 0 = B - Correct? False
Classification of Instance: label=B, attributes=1, 1, 2, 1, 1, 0, 0, 1, 0, 0 = B - Correct? True
Classification of Instance: label=G, attributes=0, 1, 3, 1, 1, 0, 0, 0, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=1, 0, 3, 1, 3, 1, 0, 0, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=2, 0, 3, 1, 1, 0, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=1, 0, 3, 2, 1, 3, 1, 0, 0, 0 = B - Correct? False
Classification of Instance: label=G, attributes=0, 1, 1, 1, 1, 2, 0, 1, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=2, 1, 3, 1, 1, 2, 0, 0, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=1, 1, 3, 2, 0, 3, 0, 0, 0, 0 = B - Correct? False
Classification of Instance: label=G, attributes=0, 0, 3, 0, 1, 0, 0, 0, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 1, 3, 1, 3, 2, 1, 0, 1, 1 = G - Correct? True
Classification of Instance: label=G, attributes=0, 1, 1, 1, 1, 3, 0, 1, 1, 0 = G - Correct? True
Classification of Instance: label=G, attributes=0, 0, 3, 1, 1, 0, 0, 0, 0, 0 = G - Correct? True
Classification of Instance: label=G, attributes=1, 1, 3, 1, 0, 0, 0, 0, 1, 0 = G - Correct? True

Mode 3

dorpascal@Mac-mini HW3_Skeleton % python3 my_HW3.py 3 prune_train.txt prune_test.txt
0.67485

About

An innovative Python implementation of decision trees for machine learning, showcasing algorithmic learning from scratch with practical examples and a focus on AI principles.

https://pages.cs.wisc.edu/~dyer/cs540/hw-toc.html


Languages

Language:Python 100.0%