{"id":21314633,"url":"https://github.com/dor-sketch/decisiontreeai","last_synced_at":"2025-03-15T21:22:42.690Z","repository":{"id":225229237,"uuid":"764634646","full_name":"Dor-sketch/DecisionTreeAI","owner":"Dor-sketch","description":"An innovative Python implementation of decision trees for machine learning, showcasing algorithmic learning from scratch with practical examples and a focus on AI principles.","archived":false,"fork":false,"pushed_at":"2024-03-12T11:37:55.000Z","size":4554,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-22T10:23:06.010Z","etag":null,"topics":["ai","desiciontree","information-gain","learning-from-data","openui","python3"],"latest_commit_sha":null,"homepage":"https://pages.cs.wisc.edu/~dyer/cs540/hw-toc.html","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Dor-sketch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-28T12:45:17.000Z","updated_at":"2024-02-28T12:50:08.000Z","dependencies_parsed_at":"2024-03-12T12:54:07.685Z","dependency_job_id":"59840391-4f03-4521-b511-4d738ec1fa6f","html_url":"https://github.com/Dor-sketch/DecisionTreeAI","commit_stats":null,"previous_names":["dor-sketch/decisiontreeai"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dor-sketch%2FDecisionTreeAI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dor-sketch%2FDecisionTreeAI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dor-sketch%2FDecisionTreeAI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dor-sketch%2FDecisionTreeAI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dor-sketch","download_url":"https://codeload.github.com/Dor-sketch/DecisionTreeAI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243791136,"owners_count":20348423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","desiciontree","information-gain","learning-from-data","openui","python3"],"created_at":"2024-11-21T18:14:22.842Z","updated_at":"2025-03-15T21:22:42.634Z","avatar_url":"https://github.com/Dor-sketch.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌳 Learning Decision Trees 🌳\n\nThis 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! 🎯\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./images/cover.png\" alt=\"Decision Tree\" width=\"500\"\u003e\n\u003c/p\u003e\n\n---\n\n- [📖 Overview](#-overview)\n- [🛠 Technical Details](#-technical-details)\n  - [`Formulas.py`](#formulaspy)\n  - [`my_DecisionTreeImpl.py`](#my_decisiontreeimplpy)\n  - [`my_HW3.py`](#my_hw3py)\n  - [`my_Instance.py`](#my_instancepy)\n  - [`my_DecisionTree.py` \\\u0026 `my_DataSet.py`](#my_decisiontreepy--my_datasetpy)\n- [🚀 How to Run](#-how-to-run)\n- [📈 Example Usage](#-example-usage)\n  - [:tennis: Tennis Data Set](#tennis-tennis-data-set)\n  - [:bank: Loans Data Set](#bank-loans-data-set)\n    - [Mode 0](#mode-0)\n    - [Mode 1](#mode-1)\n    - [Mode 2](#mode-2)\n    - [Mode 3](#mode-3)\n\n---\n\n## 📖 Overview\n\nThe 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.\n\n## 🛠 Technical Details\n\n### `Formulas.py`\n\nThis 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.\n\nImportant formulas includes:\n\n- 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).\n\n- 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$.\n\n- Information Gain: $IG(S, A) = H(S) - Remainder(S, A)$ gives the information gain of attribute $A$ on set $S$.\n\n### `my_DecisionTreeImpl.py`\n\nAt 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.\n\n### `my_HW3.py`\n\nThis 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.\n\n### `my_Instance.py`\n\nA 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.\n\n### `my_DecisionTree.py` \\\u0026 `my_DataSet.py`\n\nThese 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.\n\n---\n\n## 🚀 How to Run\n\nExecute your decision tree adventure with the following command, substituting `\u003cF\u003e` with your desired mode of operation:\n\n```bash\npython3 my_HW3.py \u003cF\u003e \u003ctrain-set-file\u003e \u003ctest-set-file\u003e\n\n```\n\nWhere `\u003cF\u003e` represents one of the following modes:\n\n- `mode 0`: Revel in the mutual information of each attribute at the root.\n\n- `mode 1`: Witness the birth of a decision tree from your training set.\n\n- `mode 2`: Predict the future of your test set with your tree.\n\n- `mode 3`: Validate your tree's wisdom against the test set.\n\n- `mode 4`: Generate a GIF of your tree's growth.\n\n---\n\n## 📈 Example Usage\n\nDive 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.\n\n### :tennis: Tennis Data Set\n\nThe following output are from the tennis data set (`Tennis.txt`), taken from p.222 of the studing material.\n\nNote the Attributes are:\n\n- A1: Outlook\n- A2: Temperature\n- A3: Humidity\n- A4: Wind\n- Label: Play\n\n![tree_building](https://github.com/Dor-sketch/DecisionTreeAI/assets/138825033/116235a1-13cc-42da-bf03-8c9debde8301)\n\nThe train and test files are identical, so the accuracy is 1.0 as expected.\n\n```plaintext\n// tennis.txt\n%%,Yes,No\n##,A1,Sunny,Overcast,Rain\n##,A2,Hot,Mild,Cool\n##,A3,High,Normal\n##,A4,Weak,Strong\nSunny,Hot,High,Weak,No\nSunny,Hot,High,Strong,No\nOvercast,Hot,High,Weak,Yes\nRain,Mild,High,Weak,Yes\nRain,Cool,Normal,Weak,Yes\nRain,Cool,Normal,Strong,No\nOvercast,Cool,Normal,Strong,Yes\nSunny,Mild,High,Weak,No\nSunny,Cool,Normal,Weak,Yes\nRain,Mild,Normal,Weak,Yes\nSunny,Mild,Normal,Strong,Yes\nOvercast,Mild,High,Strong,Yes\nOvercast,Hot,Normal,Weak,Yes\nRain,Mild,High,Strong,No\n```\n\n---\n\nOutout of the program - matching the expected results from p.223:\n\n```bash\ndorpascal@Mac-mini HW3_Skeleton % python3.11 my_HW3.py 0 tennis.txt tennis.txt\nA1 0.24675\nA2 0.02922\nA3 0.15184\nA4 0.04813\ndorpascal@Mac-mini HW3_Skeleton % python3.11 my_HW3.py 1 tennis.txt tennis.txt\n└── [A1=?]\n    │ Sunny\n    ├── [A3=?]\n    │   │ High\n    │   ├── Label: No\n    │   │ Normal\n    │   └── Label: Yes\n    │ Overcast\n    ├── Label: Yes\n    │ Rain\n    └── [A4=?]\n        │ Weak\n        ├── Label: Yes\n        │ Strong\n        └── Label: No\ndorpascal@Mac-mini HW3_Skeleton % python3.11 my_HW3.py 2 tennis.txt tennis.txt\nClassification of Instance: label=No, attributes=0, 0, 0, 0 = No - Correct? True\nClassification of Instance: label=No, attributes=0, 0, 0, 1 = No - Correct? True\nClassification of Instance: label=Yes, attributes=1, 0, 0, 0 = Yes - Correct? True\nClassification of Instance: label=Yes, attributes=2, 1, 0, 0 = Yes - Correct? True\nClassification of Instance: label=Yes, attributes=2, 2, 1, 0 = Yes - Correct? True\nClassification of Instance: label=No, attributes=2, 2, 1, 1 = No - Correct? True\nClassification of Instance: label=Yes, attributes=1, 2, 1, 1 = Yes - Correct? True\nClassification of Instance: label=No, attributes=0, 1, 0, 0 = No - Correct? True\nClassification of Instance: label=Yes, attributes=0, 2, 1, 0 = Yes - Correct? True\nClassification of Instance: label=Yes, attributes=2, 1, 1, 0 = Yes - Correct? True\nClassification of Instance: label=Yes, attributes=0, 1, 1, 1 = Yes - Correct? True\nClassification of Instance: label=Yes, attributes=1, 1, 0, 1 = Yes - Correct? True\nClassification of Instance: label=Yes, attributes=1, 0, 1, 0 = Yes - Correct? True\nClassification of Instance: label=No, attributes=2, 1, 0, 1 = No - Correct? True\ndorpascal@Mac-mini HW3_Skeleton % python3.11 my_HW3.py 3 tennis.txt tennis.txt\n1.00000\n```\n\n---\n\n### :bank: Loans Data Set\n\n![loan_tree](https://github.com/Dor-sketch/DecisionTreeAI/assets/138825033/50e3f7f0-d904-4ecb-83d1-d1bdbcbc0f66)\n\n*GIF based on 108 instances for readability*\n\nThe 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.\n\n#### Mode 0\n\n```bash\ndorpascal@Mac-mini HW3_Skeleton % python3 my_HW3.py 0 prune_train.txt prune_test.txt\nA1 0.08282\nA2 0.03319\nA3 0.06140\nA4 0.01948\nA5 0.00907\nA6 0.02554\nA7 0.00004\nA8 0.00303\nA9 0.00000\nA10 0.00496\n```\n\n#### Mode 1\n\n```bash\ndorpascal@Mac-mini HW3_Skeleton % python3 my_HW3.py 1 prune_train.txt prune_test.txt\n└── [A1=?]\n    │ x\n    ├── [A3=?]\n    │   │ a\n    │   ├── [A5=?]\n    │   │   │ h\n    │   │   ├── Label: B\n    │   │   │ s\n    │   │   ├── Label: G\n    │   │   │ u\n    │   │   └── Label: G\n    │   │ c\n    │   ├── [A2=?]\n    │   │   │ n\n    │   │   ├── [A5=?]\n    │   │   │   │ h\n    │   │   │   ├── [A4=?]\n    │   │   │   │   │ o\n    │   │   │   │   ├── Label: G\n    │   │   │   │   │ f\n    │   │   │   │   └── Label: B\n    │   │   │   │ s\n    │   │   │   ├── Label: G\n    │   │   │   │ u\n    │   │   │   └── [A4=?]\n    │   │   │       │ r\n    │   │   │       ├── Label: G\n    │   │   │       │ o\n    │   │   │       └── Label: B\n    │   │   │ b\n    │   │   ├── [A6=?]\n    │   │   │   │ c\n    │   │   │   ├── [A5=?]\n    │   │   │   │   │ h\n    │   │   │   │   ├── [A8=?]\n    │   │   │   │   │   │ 1\n    │   │   │   │   │   ├── Label: G\n    │   │   │   │   │   │ 2\n    │   │   │   │   │   └── [A9=?]\n    │   │   │   │   │       │ y\n    │   │   │   │   │       ├── [A4=?]\n    │   │   │   │   │       │   │ o\n    │   │   │   │   │       │   └── [A7=?]\n    │   │   │   │   │       │       │ 1\n    │   │   │   │   │       │       └── [A10=?]\n    │   │   │   │   │       │           │ y\n    │   │   │   │   │       │           └── Label: G\n    │   │   │   │   │       │ n\n    │   │   │   │   │       └── Label: G\n    │   │   │   │   │ s\n    │   │   │   │   ├── Label: G\n    │   │   │   │   │ u\n    │   │   │   │   └── Label: G\n    │   │   │   │ l\n    │   │   │   ├── [A4=?]\n    │   │   │   │   │ r\n    │   │   │   │   ├── Label: B\n    │   │   │   │   │ o\n    │   │   │   │   └── [A5=?]\n    │   │   │   │       │ s\n    │   │   │   │       ├── [A9=?]\n    │   │   │   │       │   │ y\n    │   │   │   │       │   ├── Label: G\n    │   │   │   │       │   │ n\n    │   │   │   │       │   └── [A7=?]\n    │   │   │   │       │       │ 1\n    │   │   │   │       │       └── [A8=?]\n    │   │   │   │       │           │ 2\n    │   │   │   │       │           └── [A10=?]\n    │   │   │   │       │               │ y\n    │   │   │   │       │               └── Label: G\n    │   │   │   │       │ n\n    │   │   │   │       ├── Label: G\n    │   │   │   │       │ u\n    │   │   │   │       └── Label: G\n    │   │   │   │ r\n    │   │   │   ├── Label: G\n    │   │   │   │ n\n    │   │   │   └── Label: G\n    │   │   │ m\n    │   │   ├── [A6=?]\n    │   │   │   │ c\n    │   │   │   ├── Label: G\n    │   │   │   │ l\n    │   │   │   ├── Label: G\n    │   │   │   │ r\n    │   │   │   └── [A8=?]\n    │   │   │       │ 1\n    │   │   │       ├── Label: G\n    │   │   │       │ 2\n    │   │   │       ├── Label: B\n    │   │   │       │ 3\n    │   │   │       └── Label: G\n    │   │   │ g\n    │   │   ├── Label: G\n    │   │   │ w\n    │   │   └── Label: G\n    │   │ d\n    │   ├── [A7=?]\n    │   │   │ 1\n    │   │   ├── [A5=?]\n    │   │   │   │ h\n    │   │   │   ├── Label: B\n    │   │   │   │ s\n    │   │   │   ├── Label: G\n    │   │   │   │ u\n    │   │   │   └── Label: G\n    │   │   │ 2\n    │   │   └── [A2=?]\n    │   │       │ n\n    │   │       ├── Label: G\n    │   │       │ b\n    │   │       ├── Label: B\n    │   │       │ g\n    │   │       ├── Label: B\n    │   │       │ w\n    │   │       └── Label: B\n    │   │ e\n    │   ├── [A8=?]\n    │   │   │ 1\n    │   │   ├── [A2=?]\n    │   │   │   │ n\n    │   │   │   ├── [A9=?]\n    │   │   │   │   │ y\n    │   │   │   │   ├── Label: G\n    │   │   │   │   │ n\n    │   │   │   │   └── [A6=?]\n    │   │   │   │       │ c\n    │   │   │   │       ├── Label: G\n    │   │   │   │       │ l\n    │   │   │   │       ├── [A5=?]\n    │   │   │   │       │   │ s\n    │   │   │   │       │   ├── Label: G\n    │   │   │   │       │   │ u\n    │   │   │   │       │   └── [A10=?]\n    │   │   │   │       │       │ y\n    │   │   │   │       │       ├── Label: B\n    │   │   │   │       │       │ n\n    │   │   │   │       │       └── Label: G\n    │   │   │   │       │ r\n    │   │   │   │       ├── [A5=?]\n    │   │   │   │       │   │ s\n    │   │   │   │       │   ├── [A4=?]\n    │   │   │   │       │   │   │ o\n    │   │   │   │       │   │   └── [A7=?]\n    │   │   │   │       │   │       │ 1\n    │   │   │   │       │   │       └── [A10=?]\n    │   │   │   │       │   │           │ y\n    │   │   │   │       │   │           └── Label: B\n    │   │   │   │       │   │ u\n    │   │   │   │       │   └── Label: G\n    │   │   │   │       │ n\n    │   │   │   │       └── Label: G\n    │   │   │   │ b\n    │   │   │   ├── [A4=?]\n    │   │   │   │   │ r\n    │   │   │   │   ├── [A5=?]\n    │   │   │   │   │   │ h\n    │   │   │   │   │   ├── [A6=?]\n    │   │   │   │   │   │   │ c\n    │   │   │   │   │   │   └── [A7=?]\n    │   │   │   │   │   │       │ 1\n    │   │   │   │   │   │       └── [A9=?]\n    │   │   │   │   │   │           │ y\n    │   │   │   │   │   │           └── [A10=?]\n    │   │   │   │   │   │               │ y\n    │   │   │   │   │   │               └── Label: B\n    │   │   │   │   │   │ s\n    │   │   │   │   │   ├── [A6=?]\n    │   │   │   │   │   │   │ l\n    │   │   │   │   │   │   ├── Label: G\n    │   │   │   │   │   │   │ r\n    │   │   │   │   │   │   └── [A7=?]\n    │   │   │   │   │   │       │ 1\n    │   │   │   │   │   │       └── [A9=?]\n    │   │   │   │   │   │           │ n\n    │   │   │   │   │   │           └── [A10=?]\n    │   │   │   │   │   │               │ y\n    │   │   │   │   │   │               └── Label: B\n    │   │   │   │   │   │ u\n    │   │   │   │   │   └── Label: G\n    │   │   │   │   │ o\n    │   │   │   │   ├── [A5=?]\n    │   │   │   │   │   │ h\n    │   │   │   │   │   ├── Label: G\n    │   │   │   │   │   │ s\n    │   │   │   │   │   ├── [A6=?]\n    │   │   │   │   │   │   │ c\n    │   │   │   │   │   │   ├── Label: G\n    │   │   │   │   │   │   │ l\n    │   │   │   │   │   │   ├── Label: G\n    │   │   │   │   │   │   │ r\n    │   │   │   │   │   │   └── [A7=?]\n    │   │   │   │   │   │       │ 1\n    │   │   │   │   │   │       ├── [A9=?]\n    │   │   │   │   │   │       │   │ y\n    │   │   │   │   │   │       │   ├── Label: G\n    │   │   │   │   │   │       │   │ n\n    │   │   │   │   │   │       │   └── [A10=?]\n    │   │   │   │   │   │       │       │ y\n    │   │   │   │   │   │       │       └── Label: G\n    │   │   │   │   │   │       │ 2\n    │   │   │   │   │   │       └── Label: G\n    │   │   │   │   │   │ u\n    │   │   │   │   │   └── [A6=?]\n    │   │   │   │   │       │ l\n    │   │   │   │   │       ├── Label: B\n    │   │   │   │   │       │ r\n    │   │   │   │   │       └── Label: G\n    │   │   │   │   │ f\n    │   │   │   │   └── Label: B\n    │   │   │   │ m\n    │   │   │   ├── [A5=?]\n    │   │   │   │   │ h\n    │   │   │   │   ├── [A4=?]\n    │   │   │   │   │   │ r\n    │   │   │   │   │   ├── Label: G\n    │   │   │   │   │   │ o\n    │   │   │   │   │   └── Label: B\n    │   │   │   │   │ s\n    │   │   │   │   ├── Label: G\n    │   │   │   │   │ u\n    │   │   │   │   └── Label: G\n    │   │   │   │ g\n    │   │   │   ├── Label: G\n    │   │   │   │ w\n    │   │   │   └── Label: G\n    │   │   │ 2\n    │   │   ├── [A2=?]\n    │   │   │   │ n\n    │   │   │   ├── [A4=?]\n    │   │   │   │   │ r\n    │   │   │   │   ├── Label: B\n    │   │   │   │   │ o\n    │   │   │   │   └── [A9=?]\n    │   │   │   │       │ y\n    │   │   │   │       ├── Label: B\n    │   │   │   │       │ n\n    │   │   │   │       └── Label: G\n    │   │   │   │ b\n    │   │   │   ├── [A6=?]\n    │   │   │   │   │ c\n    │   │   │   │   ├── [A5=?]\n    │   │   │   │   │   │ h\n    │   │   │   │   │   ├── [A4=?]\n    │   │   │   │   │   │   │ r\n    │   │   │   │   │   │   ├── Label: G\n    │   │   │   │   │   │   │ o\n    │   │   │   │   │   │   └── Label: B\n    │   │   │   │   │   │ s\n    │   │   │   │   │   ├── [A4=?]\n    │   │   │   │   │   │   │ r\n    │   │   │   │   │   │   ├── Label: B\n    │   │   │   │   │   │   │ o\n    │   │   │   │   │   │   └── Label: G\n    │   │   │   │   │   │ u\n    │   │   │   │   │   └── Label: G\n    │   │   │   │   │ r\n    │   │   │   │   ├── Label: G\n    │   │   │   │   │ n\n    │   │   │   │   └── Label: G\n    │   │   │   │ m\n    │   │   │   └── Label: B\n    │   │   │ 3\n    │   │   └── Label: G\n    │   │ n\n    │   └── [A2=?]\n    │       │ n\n    │       ├── Label: B\n    │       │ b\n    │       ├── [A7=?]\n    │       │   │ 1\n    │       │   ├── Label: G\n    │       │   │ 2\n    │       │   └── Label: B\n    │       │ m\n    │       └── Label: G\n    │ n\n    ├── [A3=?]\n    │   │ a\n    │   ├── [A6=?]\n    │   │   │ c\n    │   │   ├── [A2=?]\n    │   │   │   │ b\n    │   │   │   ├── [A4=?]\n    │   │   │   │   │ r\n    │   │   │   │   ├── Label: G\n    │   │   │   │   │ o\n    │   │   │   │   └── [A5=?]\n    │   │   │   │       │ s\n    │   │   │   │       ├── Label: B\n    │   │   │   │       │ u\n    │   │   │   │       └── Label: G\n    │   │   │   │ m\n    │   │   │   └── Label: G\n    │   │   │ l\n    │   │   ├── Label: B\n    │   │   │ n\n    │   │   └── Label: B\n    │   │ c\n    │   ├── [A5=?]\n    │   │   │ h\n    │   │   ├── Label: G\n    │   │   │ s\n    │   │   ├── [A4=?]\n    │   │   │   │ r\n    │   │   │   ├── Label: G\n    │   │   │   │ o\n    │   │   │   ├── [A2=?]\n    │   │   │   │   │ n\n    │   │   │   │   ├── Label: G\n    │   │   │   │   │ b\n    │   │   │   │   ├── [A7=?]\n    │   │   │   │   │   │ 1\n    │   │   │   │   │   ├── [A6=?]\n    │   │   │   │   │   │   │ c\n    │   │   │   │   │   │   ├── [A8=?]\n    │   │   │   │   │   │   │   │ 2\n    │   │   │   │   │   │   │   └── [A9=?]\n    │   │   │   │   │   │   │       │ y\n    │   │   │   │   │   │   │       └── [A10=?]\n    │   │   │   │   │   │   │           │ y\n    │   │   │   │   │   │   │           └── Label: B\n    │   │   │   │   │   │   │ l\n    │   │   │   │   │   │   └── [A9=?]\n    │   │   │   │   │   │       │ y\n    │   │   │   │   │   │       ├── Label: G\n    │   │   │   │   │   │       │ n\n    │   │   │   │   │   │       └── [A8=?]\n    │   │   │   │   │   │           │ 2\n    │   │   │   │   │   │           └── [A10=?]\n    │   │   │   │   │   │               │ y\n    │   │   │   │   │   │               └── Label: B\n    │   │   │   │   │   │ 2\n    │   │   │   │   │   └── Label: G\n    │   │   │   │   │ g\n    │   │   │   │   └── Label: G\n    │   │   │   │ f\n    │   │   │   └── Label: B\n    │   │   │ n\n    │   │   ├── Label: B\n    │   │   │ u\n    │   │   └── Label: G\n    │   │ d\n    │   ├── [A2=?]\n    │   │   │ n\n    │   │   ├── Label: G\n    │   │   │ b\n    │   │   └── Label: B\n    │   │ e\n    │   ├── [A5=?]\n    │   │   │ h\n    │   │   ├── [A6=?]\n    │   │   │   │ c\n    │   │   │   ├── Label: G\n    │   │   │   │ l\n    │   │   │   ├── [A2=?]\n    │   │   │   │   │ n\n    │   │   │   │   ├── Label: G\n    │   │   │   │   │ b\n    │   │   │   │   └── [A4=?]\n    │   │   │   │       │ r\n    │   │   │   │       ├── [A7=?]\n    │   │   │   │       │   │ 1\n    │   │   │   │       │   └── [A8=?]\n    │   │   │   │       │       │ 1\n    │   │   │   │       │       └── [A9=?]\n    │   │   │   │       │           │ y\n    │   │   │   │       │           └── [A10=?]\n    │   │   │   │       │               │ y\n    │   │   │   │       │               └── Label: B\n    │   │   │   │       │ o\n    │   │   │   │       └── Label: B\n    │   │   │   │ r\n    │   │   │   ├── Label: G\n    │   │   │   │ n\n    │   │   │   └── [A2=?]\n    │   │   │       │ b\n    │   │   │       └── [A4=?]\n    │   │   │           │ f\n    │   │   │           └── [A7=?]\n    │   │   │               │ 1\n    │   │   │               └── [A8=?]\n    │   │   │                   │ 1\n    │   │   │                   └── [A9=?]\n    │   │   │                       │ y\n    │   │   │                       └── [A10=?]\n    │   │   │                           │ y\n    │   │   │                           └── Label: B\n    │   │   │ s\n    │   │   ├── [A2=?]\n    │   │   │   │ n\n    │   │   │   ├── [A9=?]\n    │   │   │   │   │ y\n    │   │   │   │   ├── [A4=?]\n    │   │   │   │   │   │ r\n    │   │   │   │   │   ├── Label: G\n    │   │   │   │   │   │ o\n    │   │   │   │   │   ├── Label: G\n    │   │   │   │   │   │ f\n    │   │   │   │   │   └── Label: B\n    │   │   │   │   │ n\n    │   │   │   │   └── Label: B\n    │   │   │   │ b\n    │   │   │   ├── [A8=?]\n    │   │   │   │   │ 1\n    │   │   │   │   ├── [A9=?]\n    │   │   │   │   │   │ y\n    │   │   │   │   │   ├── [A6=?]\n    │   │   │   │   │   │   │ c\n    │   │   │   │   │   │   ├── Label: B\n    │   │   │   │   │   │   │ l\n    │   │   │   │   │   │   ├── [A4=?]\n    │   │   │   │   │   │   │   │ o\n    │   │   │   │   │   │   │   └── [A7=?]\n    │   │   │   │   │   │   │       │ 1\n    │   │   │   │   │   │   │       └── [A10=?]\n    │   │   │   │   │   │   │           │ y\n    │   │   │   │   │   │   │           └── Label: B\n    │   │   │   │   │   │   │ r\n    │   │   │   │   │   │   ├── Label: B\n    │   │   │   │   │   │   │ n\n    │   │   │   │   │   │   └── Label: B\n    │   │   │   │   │   │ n\n    │   │   │   │   │   └── [A6=?]\n    │   │   │   │   │       │ c\n    │   │   │   │   │       ├── [A4=?]\n    │   │   │   │   │       │   │ r\n    │   │   │   │   │       │   ├── Label: G\n    │   │   │   │   │       │   │ o\n    │   │   │   │   │       │   └── [A7=?]\n    │   │   │   │   │       │       │ 1\n    │   │   │   │   │       │       └── [A10=?]\n    │   │   │   │   │       │           │ y\n    │   │   │   │   │       │           └── Label: G\n    │   │   │   │   │       │ l\n    │   │   │   │   │       ├── [A7=?]\n    │   │   │   │   │       │   │ 1\n    │   │   │   │   │       │   ├── [A4=?]\n    │   │   │   │   │       │   │   │ r\n    │   │   │   │   │       │   │   ├── [A10=?]\n    │   │   │   │   │       │   │   │   │ y\n    │   │   │   │   │       │   │   │   └── Label: B\n    │   │   │   │   │       │   │   │ o\n    │   │   │   │   │       │   │   └── Label: B\n    │   │   │   │   │       │   │ 2\n    │   │   │   │   │       │   └── [A4=?]\n    │   │   │   │   │       │       │ o\n    │   │   │   │   │       │       └── [A10=?]\n    │   │   │   │   │       │           │ y\n    │   │   │   │   │       │           └── Label: G\n    │   │   │   │   │       │ r\n    │   │   │   │   │       ├── [A4=?]\n    │   │   │   │   │       │   │ r\n    │   │   │   │   │       │   ├── Label: B\n    │   │   │   │   │       │   │ o\n    │   │   │   │   │       │   └── [A10=?]\n    │   │   │   │   │       │       │ y\n    │   │   │   │   │       │       ├── [A7=?]\n    │   │   │   │   │       │       │   │ 1\n    │   │   │   │   │       │       │   └── Label: B\n    │   │   │   │   │       │       │ n\n    │   │   │   │   │       │       └── Label: G\n    │   │   │   │   │       │ n\n    │   │   │   │   │       └── [A7=?]\n    │   │   │   │   │           │ 1\n    │   │   │   │   │           ├── Label: G\n    │   │   │   │   │           │ 2\n    │   │   │   │   │           └── [A4=?]\n    │   │   │   │   │               │ f\n    │   │   │   │   │               └── [A10=?]\n    │   │   │   │   │                   │ y\n    │   │   │   │   │                   └── Label: B\n    │   │   │   │   │ 2\n    │   │   │   │   └── Label: B\n    │   │   │   │ m\n    │   │   │   ├── Label: B\n    │   │   │   │ g\n    │   │   │   ├── Label: G\n    │   │   │   │ w\n    │   │   │   └── Label: G\n    │   │   │ n\n    │   │   ├── Label: G\n    │   │   │ u\n    │   │   └── [A6=?]\n    │   │       │ c\n    │   │       ├── [A2=?]\n    │   │       │   │ b\n    │   │       │   ├── Label: G\n    │   │       │   │ m\n    │   │       │   └── [A7=?]\n    │   │       │       │ 1\n    │   │       │       ├── Label: B\n    │   │       │       │ 2\n    │   │       │       └── Label: G\n    │   │       │ l\n    │   │       ├── Label: G\n    │   │       │ r\n    │   │       ├── [A9=?]\n    │   │       │   │ y\n    │   │       │   ├── Label: G\n    │   │       │   │ n\n    │   │       │   └── [A2=?]\n    │   │       │       │ n\n    │   │       │       ├── Label: G\n    │   │       │       │ b\n    │   │       │       └── [A4=?]\n    │   │       │           │ r\n    │   │       │           ├── Label: G\n    │   │       │           │ o\n    │   │       │           └── [A7=?]\n    │   │       │               │ 1\n    │   │       │               ├── [A8=?]\n    │   │       │               │   │ 1\n    │   │       │               │   └── [A10=?]\n    │   │       │               │       │ y\n    │   │       │               │       └── Label: B\n    │   │       │               │ 2\n    │   │       │               └── Label: B\n    │   │       │ n\n    │   │       └── Label: B\n    │   │ n\n    │   └── [A6=?]\n    │       │ c\n    │       ├── [A2=?]\n    │       │   │ n\n    │       │   ├── Label: G\n    │       │   │ b\n    │       │   └── Label: B\n    │       │ l\n    │       ├── Label: B\n    │       │ r\n    │       ├── Label: G\n    │       │ n\n    │       └── Label: B\n    │ b\n    ├── [A6=?]\n    │   │ c\n    │   ├── [A2=?]\n    │   │   │ n\n    │   │   ├── Label: G\n    │   │   │ b\n    │   │   ├── [A4=?]\n    │   │   │   │ r\n    │   │   │   ├── [A8=?]\n    │   │   │   │   │ 1\n    │   │   │   │   ├── Label: G\n    │   │   │   │   │ 2\n    │   │   │   │   ├── Label: B\n    │   │   │   │   │ 3\n    │   │   │   │   └── Label: G\n    │   │   │   │ o\n    │   │   │   ├── [A3=?]\n    │   │   │   │   │ c\n    │   │   │   │   ├── [A5=?]\n    │   │   │   │   │   │ h\n    │   │   │   │   │   ├── Label: B\n    │   │   │   │   │   │ s\n    │   │   │   │   │   └── [A8=?]\n    │   │   │   │   │       │ 1\n    │   │   │   │   │       ├── Label: B\n    │   │   │   │   │       │ 2\n    │   │   │   │   │       └── Label: G\n    │   │   │   │   │ d\n    │   │   │   │   ├── Label: G\n    │   │   │   │   │ e\n    │   │   │   │   └── [A8=?]\n    │   │   │   │       │ 1\n    │   │   │   │       ├── [A9=?]\n    │   │   │   │       │   │ y\n    │   │   │   │       │   ├── [A5=?]\n    │   │   │   │       │   │   │ s\n    │   │   │   │       │   │   ├── [A7=?]\n    │   │   │   │       │   │   │   │ 1\n    │   │   │   │       │   │   │   ├── [A10=?]\n    │   │   │   │       │   │   │   │   │ y\n    │   │   │   │       │   │   │   │   └── Label: B\n    │   │   │   │       │   │   │   │ 2\n    │   │   │   │       │   │   │   └── Label: B\n    │   │   │   │       │   │   │ u\n    │   │   │   │       │   │   └── Label: B\n    │   │   │   │       │   │ n\n    │   │   │   │       │   └── [A10=?]\n    │   │   │   │       │       │ y\n    │   │   │   │       │       ├── [A5=?]\n    │   │   │   │       │       │   │ s\n    │   │   │   │       │       │   ├── Label: G\n    │   │   │   │       │       │   │ u\n    │   │   │   │       │       │   └── [A7=?]\n    │   │   │   │       │       │       │ 1\n    │   │   │   │       │       │       └── Label: B\n    │   │   │   │       │       │ n\n    │   │   │   │       │       └── Label: B\n    │   │   │   │       │ 2\n    │   │   │   │       └── Label: G\n    │   │   │   │ f\n    │   │   │   └── Label: G\n    │   │   │ m\n    │   │   ├── [A3=?]\n    │   │   │   │ a\n    │   │   │   ├── Label: G\n    │   │   │   │ c\n    │   │   │   ├── Label: G\n    │   │   │   │ d\n    │   │   │   ├── [A5=?]\n    │   │   │   │   │ h\n    │   │   │   │   ├── Label: B\n    │   │   │   │   │ s\n    │   │   │   │   └── Label: G\n    │   │   │   │ e\n    │   │   │   ├── [A4=?]\n    │   │   │   │   │ r\n    │   │   │   │   ├── Label: B\n    │   │   │   │   │ o\n    │   │   │   │   └── [A8=?]\n    │   │   │   │       │ 1\n    │   │   │   │       ├── Label: B\n    │   │   │   │       │ 2\n    │   │   │   │       └── Label: G\n    │   │   │   │ n\n    │   │   │   └── Label: B\n    │   │   │ g\n    │   │   ├── [A3=?]\n    │   │   │   │ c\n    │   │   │   ├── Label: G\n    │   │   │   │ e\n    │   │   │   └── Label: B\n    │   │   │ w\n    │   │   └── Label: G\n    │   │ l\n    │   ├── [A8=?]\n    │   │   │ 1\n    │   │   ├── [A5=?]\n    │   │   │   │ h\n    │   │   │   ├── Label: B\n    │   │   │   │ s\n    │   │   │   ├── [A2=?]\n    │   │   │   │   │ n\n    │   │   │   │   ├── [A3=?]\n    │   │   │   │   │   │ e\n    │   │   │   │   │   └── [A4=?]\n    │   │   │   │   │       │ o\n    │   │   │   │   │       └── [A7=?]\n    │   │   │   │   │           │ 1\n    │   │   │   │   │           └── [A9=?]\n    │   │   │   │   │               │ n\n    │   │   │   │   │               └── [A10=?]\n    │   │   │   │   │                   │ y\n    │   │   │   │   │                   └── Label: G\n    │   │   │   │   │ b\n    │   │   │   │   ├── [A3=?]\n    │   │   │   │   │   │ c\n    │   │   │   │   │   ├── [A4=?]\n    │   │   │   │   │   │   │ o\n    │   │   │   │   │   │   └── [A7=?]\n    │   │   │   │   │   │       │ 1\n    │   │   │   │   │   │       └── [A9=?]\n    │   │   │   │   │   │           │ n\n    │   │   │   │   │   │           └── [A10=?]\n    │   │   │   │   │   │               │ y\n    │   │   │   │   │   │               └── Label: B\n    │   │   │   │   │   │ d\n    │   │   │   │   │   ├── Label: G\n    │   │   │   │   │   │ e\n    │   │   │   │   │   └── [A9=?]\n    │   │   │   │   │       │ y\n    │   │   │   │   │       ├── [A7=?]\n    │   │   │   │   │       │   │ 1\n    │   │   │   │   │       │   ├── Label: B\n    │   │   │   │   │       │   │ 2\n    │   │   │   │   │       │   └── Label: G\n    │   │   │   │   │       │ n\n    │   │   │   │   │       └── Label: G\n    │   │   │   │   │ m\n    │   │   │   │   └── Label: B\n    │   │   │   │ n\n    │   │   │   ├── Label: B\n    │   │   │   │ u\n    │   │   │   └── [A2=?]\n    │   │   │       │ n\n    │   │   │       ├── Label: G\n    │   │   │       │ b\n    │   │   │       ├── Label: B\n    │   │   │       │ m\n    │   │   │       ├── Label: B\n    │   │   │       │ w\n    │   │   │       └── Label: G\n    │   │   │ 2\n    │   │   └── Label: G\n    │   │ r\n    │   ├── [A8=?]\n    │   │   │ 1\n    │   │   ├── [A2=?]\n    │   │   │   │ n\n    │   │   │   ├── [A5=?]\n    │   │   │   │   │ h\n    │   │   │   │   ├── Label: G\n    │   │   │   │   │ s\n    │   │   │   │   └── Label: B\n    │   │   │   │ b\n    │   │   │   ├── [A4=?]\n    │   │   │   │   │ r\n    │   │   │   │   ├── [A5=?]\n    │   │   │   │   │   │ h\n    │   │   │   │   │   ├── Label: G\n    │   │   │   │   │   │ s\n    │   │   │   │   │   ├── [A3=?]\n    │   │   │   │   │   │   │ e\n    │   │   │   │   │   │   └── [A7=?]\n    │   │   │   │   │   │       │ 1\n    │   │   │   │   │   │       └── [A9=?]\n    │   │   │   │   │   │           │ n\n    │   │   │   │   │   │           └── [A10=?]\n    │   │   │   │   │   │               │ y\n    │   │   │   │   │   │               └── Label: B\n    │   │   │   │   │   │ u\n    │   │   │   │   │   └── Label: G\n    │   │   │   │   │ o\n    │   │   │   │   └── Label: G\n    │   │   │   │ m\n    │   │   │   ├── Label: G\n    │   │   │   │ g\n    │   │   │   ├── [A5=?]\n    │   │   │   │   │ s\n    │   │   │   │   ├── Label: G\n    │   │   │   │   │ u\n    │   │   │   │   └── [A3=?]\n    │   │   │   │       │ e\n    │   │   │   │       └── [A4=?]\n    │   │   │   │           │ o\n    │   │   │   │           └── [A7=?]\n    │   │   │   │               │ 1\n    │   │   │   │               └── [A9=?]\n    │   │   │   │                   │ n\n    │   │   │   │                   └── [A10=?]\n    │   │   │   │                       │ y\n    │   │   │   │                       └── Label: B\n    │   │   │   │ w\n    │   │   │   └── Label: G\n    │   │   │ 2\n    │   │   ├── [A5=?]\n    │   │   │   │ h\n    │   │   │   ├── Label: B\n    │   │   │   │ s\n    │   │   │   ├── [A3=?]\n    │   │   │   │   │ c\n    │   │   │   │   ├── [A2=?]\n    │   │   │   │   │   │ n\n    │   │   │   │   │   ├── Label: G\n    │   │   │   │   │   │ b\n    │   │   │   │   │   └── Label: B\n    │   │   │   │   │ d\n    │   │   │   │   ├── Label: G\n    │   │   │   │   │ e\n    │   │   │   │   └── Label: B\n    │   │   │   │ u\n    │   │   │   └── [A7=?]\n    │   │   │       │ 1\n    │   │   │       ├── [A3=?]\n    │   │   │       │   │ c\n    │   │   │       │   ├── [A2=?]\n    │   │   │       │   │   │ b\n    │   │   │       │   │   └── [A4=?]\n    │   │   │       │   │       │ o\n    │   │   │       │   │       └── [A9=?]\n    │   │   │       │   │           │ n\n    │   │   │       │   │           └── [A10=?]\n    │   │   │       │   │               │ y\n    │   │   │       │   │               └── Label: B\n    │   │   │       │   │ e\n    │   │   │       │   └── Label: G\n    │   │   │       │ 2\n    │   │   │       └── Label: G\n    │   │   │ 3\n    │   │   └── [A2=?]\n    │   │       │ n\n    │   │       ├── Label: G\n    │   │       │ b\n    │   │       └── Label: B\n    │   │ n\n    │   └── [A3=?]\n    │       │ a\n    │       ├── [A2=?]\n    │       │   │ n\n    │       │   ├── Label: G\n    │       │   │ b\n    │       │   ├── Label: B\n    │       │   │ m\n    │       │   └── Label: B\n    │       │ c\n    │       ├── Label: G\n    │       │ d\n    │       ├── [A2=?]\n    │       │   │ b\n    │       │   ├── Label: B\n    │       │   │ m\n    │       │   └── [A4=?]\n    │       │       │ o\n    │       │       ├── Label: B\n    │       │       │ f\n    │       │       └── Label: G\n    │       │ e\n    │       ├── [A4=?]\n    │       │   │ r\n    │       │   ├── Label: B\n    │       │   │ o\n    │       │   ├── Label: B\n    │       │   │ f\n    │       │   └── [A5=?]\n    │       │       │ h\n    │       │       ├── [A2=?]\n    │       │       │   │ b\n    │       │       │   └── [A7=?]\n    │       │       │       │ 1\n    │       │       │       └── [A8=?]\n    │       │       │           │ 1\n    │       │       │           └── [A9=?]\n    │       │       │               │ y\n    │       │       │               └── [A10=?]\n    │       │       │                   │ y\n    │       │       │                   └── Label: B\n    │       │       │ s\n    │       │       ├── [A2=?]\n    │       │       │   │ n\n    │       │       │   ├── [A7=?]\n    │       │       │   │   │ 1\n    │       │       │   │   └── [A8=?]\n    │       │       │   │       │ 1\n    │       │       │   │       └── [A9=?]\n    │       │       │   │           │ y\n    │       │       │   │           └── [A10=?]\n    │       │       │   │               │ y\n    │       │       │   │               └── Label: B\n    │       │       │   │ m\n    │       │       │   └── [A7=?]\n    │       │       │       │ 1\n    │       │       │       └── [A8=?]\n    │       │       │           │ 1\n    │       │       │           └── [A9=?]\n    │       │       │               │ n\n    │       │       │               └── [A10=?]\n    │       │       │                   │ y\n    │       │       │                   └── Label: B\n    │       │       │ n\n    │       │       └── Label: G\n    │       │ n\n    │       └── Label: B\n    │ g\n    └── [A3=?]\n        │ a\n        ├── [A2=?]\n        │   │ n\n        │   ├── Label: G\n        │   │ b\n        │   ├── Label: B\n        │   │ w\n        │   └── Label: G\n        │ c\n        ├── [A4=?]\n        │   │ r\n        │   ├── Label: B\n        │   │ o\n        │   ├── Label: G\n        │   │ f\n        │   └── Label: G\n        │ d\n        ├── Label: B\n        │ e\n        ├── Label: G\n        │ n\n        └── Label: G\n```\n\n---\n\n#### Mode 2\n\n```bash\ndorpascal@Mac-mini HW3_Skeleton % python3 my_HW3.py 2 prune_train.txt prune_test.txt\nClassification of Instance: label=B, attributes=1, 1, 2, 2, 1, 3, 1, 1, 1, 0 = B - Correct? True\nClassification of Instance: label=B, attributes=1, 1, 0, 1, 1, 0, 0, 1, 0, 0 = B - Correct? True\nClassification of Instance: label=G, attributes=0, 1, 3, 1, 1, 2, 0, 0, 0, 1 = G - Correct? True\nClassification of Instance: label=G, attributes=3, 1, 3, 1, 3, 0, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 1, 3, 1, 3, 2, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 2, 1, 1, 1, 1, 0, 1, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=3, 1, 3, 0, 3, 0, 0, 0, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 1, 3, 1, 3, 1, 0, 1, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 1, 2, 1, 1, 0, 1, 1, 0, 0 = B - Correct? False\nClassification of Instance: label=B, attributes=1, 1, 3, 0, 1, 0, 0, 0, 1, 0 = G - Correct? False\nClassification of Instance: label=B, attributes=1, 1, 1, 2, 3, 3, 0, 1, 1, 0 = G - Correct? False\nClassification of Instance: label=B, attributes=2, 2, 0, 2, 0, 3, 0, 1, 0, 0 = B - Correct? True\nClassification of Instance: label=B, attributes=1, 0, 3, 1, 1, 0, 0, 0, 1, 0 = B - Correct? True\nClassification of Instance: label=G, attributes=3, 1, 2, 1, 1, 0, 0, 1, 0, 0 = B - Correct? False\nClassification of Instance: label=B, attributes=2, 1, 3, 2, 1, 3, 0, 0, 1, 0 = G - Correct? False\nClassification of Instance: label=B, attributes=1, 1, 3, 0, 1, 0, 0, 0, 1, 0 = G - Correct? False\nClassification of Instance: label=G, attributes=0, 1, 3, 2, 0, 3, 0, 0, 0, 0 = B - Correct? False\nClassification of Instance: label=G, attributes=0, 1, 3, 1, 1, 0, 0, 1, 0, 0 = G - Correct? True\nClassification of Instance: label=B, attributes=0, 1, 2, 1, 1, 0, 0, 1, 1, 0 = G - Correct? False\nClassification of Instance: label=G, attributes=0, 0, 3, 1, 1, 0, 0, 0, 0, 0 = G - Correct? True\nClassification of Instance: label=B, attributes=1, 1, 4, 1, 1, 2, 0, 1, 1, 0 = G - Correct? False\nClassification of Instance: label=G, attributes=0, 0, 3, 1, 0, 1, 1, 0, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=2, 1, 3, 1, 1, 2, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 1, 0, 1, 1, 0, 0, 0, 0, 0 = G - Correct? True\nClassification of Instance: label=B, attributes=1, 1, 3, 1, 3, 0, 0, 0, 1, 0 = G - Correct? False\nClassification of Instance: label=G, attributes=1, 1, 3, 2, 1, 1, 1, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=3, 1, 3, 1, 1, 1, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=B, attributes=2, 1, 1, 1, 3, 0, 0, 0, 1, 0 = G - Correct? False\nClassification of Instance: label=G, attributes=1, 1, 1, 2, 0, 3, 0, 1, 1, 0 = G - Correct? True\nClassification of Instance: label=B, attributes=1, 1, 3, 1, 1, 1, 0, 0, 1, 0 = B - Correct? True\nClassification of Instance: label=G, attributes=3, 1, 1, 1, 1, 1, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 2, 3, 1, 1, 2, 1, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 0, 1, 1, 1, 1, 0, 1, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=3, 0, 1, 0, 1, 3, 0, 1, 1, 0 = B - Correct? False\nClassification of Instance: label=G, attributes=1, 1, 2, 1, 3, 1, 0, 1, 1, 0 = B - Correct? False\nClassification of Instance: label=B, attributes=0, 3, 1, 2, 1, 3, 0, 0, 1, 0 = G - Correct? False\nClassification of Instance: label=G, attributes=2, 1, 3, 1, 0, 3, 0, 0, 0, 0 = B - Correct? False\nClassification of Instance: label=B, attributes=1, 1, 3, 1, 3, 0, 0, 0, 1, 0 = G - Correct? False\nClassification of Instance: label=B, attributes=1, 1, 2, 1, 1, 3, 0, 1, 0, 0 = B - Correct? True\nClassification of Instance: label=G, attributes=1, 4, 3, 1, 1, 1, 1, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=B, attributes=1, 1, 3, 2, 1, 3, 1, 2, 0, 0 = G - Correct? False\nClassification of Instance: label=B, attributes=0, 1, 3, 1, 0, 0, 0, 0, 0, 0 = G - Correct? False\nClassification of Instance: label=B, attributes=2, 4, 1, 2, 1, 3, 1, 1, 1, 0 = G - Correct? False\nClassification of Instance: label=G, attributes=1, 1, 3, 1, 1, 3, 1, 0, 0, 0 = B - Correct? False\nClassification of Instance: label=B, attributes=1, 1, 1, 0, 1, 2, 0, 2, 0, 0 = G - Correct? False\nClassification of Instance: label=B, attributes=1, 1, 1, 0, 1, 1, 0, 0, 0, 0 = G - Correct? False\nClassification of Instance: label=B, attributes=2, 0, 3, 1, 1, 1, 0, 0, 0, 0 = G - Correct? False\nClassification of Instance: label=B, attributes=2, 1, 4, 2, 0, 3, 0, 0, 0, 0 = B - Correct? True\nClassification of Instance: label=G, attributes=0, 1, 3, 1, 1, 2, 0, 0, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 3, 3, 1, 1, 1, 0, 1, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 3, 3, 1, 1, 1, 0, 0, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=1, 0, 3, 0, 1, 2, 0, 0, 1, 0 = B - Correct? False\nClassification of Instance: label=G, attributes=1, 1, 3, 1, 0, 1, 0, 0, 0, 0 = B - Correct? False\nClassification of Instance: label=G, attributes=2, 3, 1, 1, 0, 0, 0, 0, 0, 0 = G - Correct? True\nClassification of Instance: label=B, attributes=1, 1, 3, 0, 1, 3, 0, 0, 1, 0 = G - Correct? False\nClassification of Instance: label=G, attributes=1, 1, 3, 1, 3, 1, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=1, 1, 0, 2, 0, 3, 0, 0, 0, 0 = B - Correct? False\nClassification of Instance: label=G, attributes=1, 1, 1, 0, 1, 2, 1, 1, 1, 0 = G - Correct? True\nClassification of Instance: label=B, attributes=1, 1, 4, 0, 1, 3, 1, 1, 1, 0 = B - Correct? True\nClassification of Instance: label=B, attributes=1, 1, 3, 2, 1, 3, 0, 0, 0, 0 = B - Correct? True\nClassification of Instance: label=G, attributes=0, 1, 3, 1, 1, 2, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 1, 3, 1, 1, 0, 0, 0, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=2, 2, 3, 1, 1, 0, 0, 0, 1, 0 = B - Correct? False\nClassification of Instance: label=B, attributes=1, 1, 3, 2, 0, 3, 0, 0, 1, 0 = G - Correct? False\nClassification of Instance: label=G, attributes=0, 1, 3, 1, 1, 2, 0, 0, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 2, 3, 1, 1, 0, 0, 1, 0, 0 = B - Correct? False\nClassification of Instance: label=B, attributes=2, 2, 1, 1, 1, 3, 1, 1, 1, 0 = G - Correct? False\nClassification of Instance: label=G, attributes=0, 1, 3, 1, 1, 0, 1, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=B, attributes=0, 1, 3, 1, 3, 0, 1, 0, 1, 0 = G - Correct? False\nClassification of Instance: label=G, attributes=0, 1, 3, 1, 1, 2, 0, 1, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 1, 1, 1, 1, 0, 0, 1, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 4, 1, 1, 1, 0, 0, 1, 1, 0 = G - Correct? True\nClassification of Instance: label=B, attributes=2, 1, 1, 1, 1, 2, 0, 1, 1, 0 = B - Correct? True\nClassification of Instance: label=G, attributes=3, 1, 2, 1, 1, 1, 0, 0, 1, 0 = B - Correct? False\nClassification of Instance: label=B, attributes=1, 0, 3, 1, 1, 0, 0, 0, 1, 0 = B - Correct? True\nClassification of Instance: label=G, attributes=0, 3, 3, 1, 0, 0, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=B, attributes=2, 1, 0, 2, 3, 3, 0, 0, 1, 0 = B - Correct? True\nClassification of Instance: label=G, attributes=2, 4, 3, 1, 1, 2, 0, 0, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=1, 1, 1, 1, 3, 2, 1, 0, 1, 1 = G - Correct? True\nClassification of Instance: label=B, attributes=2, 1, 3, 2, 0, 3, 0, 0, 0, 0 = B - Correct? True\nClassification of Instance: label=G, attributes=1, 3, 3, 1, 1, 2, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 2, 2, 1, 3, 1, 0, 1, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=1, 1, 1, 1, 3, 2, 0, 1, 1, 0 = G - Correct? True\nClassification of Instance: label=B, attributes=1, 1, 3, 1, 1, 1, 1, 0, 1, 0 = G - Correct? False\nClassification of Instance: label=G, attributes=0, 0, 1, 1, 1, 0, 0, 1, 1, 1 = G - Correct? True\nClassification of Instance: label=G, attributes=2, 4, 1, 1, 1, 0, 0, 1, 0, 0 = G - Correct? True\nClassification of Instance: label=B, attributes=1, 3, 0, 2, 1, 3, 1, 0, 0, 0 = B - Correct? True\nClassification of Instance: label=G, attributes=0, 4, 3, 1, 1, 2, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=3, 0, 3, 1, 0, 0, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=2, 3, 4, 1, 1, 0, 0, 1, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=2, 1, 2, 0, 1, 1, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=B, attributes=1, 1, 1, 0, 1, 1, 0, 1, 1, 1 = G - Correct? False\nClassification of Instance: label=B, attributes=2, 1, 3, 1, 1, 2, 0, 0, 1, 0 = G - Correct? False\nClassification of Instance: label=G, attributes=1, 0, 3, 0, 3, 0, 0, 1, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 4, 1, 1, 1, 0, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 0, 1, 1, 1, 0, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=2, 0, 2, 2, 1, 3, 1, 0, 0, 0 = G - Correct? True\nClassification of Instance: label=B, attributes=3, 1, 4, 1, 0, 0, 0, 1, 0, 0 = G - Correct? False\nClassification of Instance: label=G, attributes=0, 1, 1, 1, 1, 0, 0, 1, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 1, 2, 0, 1, 2, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 0, 1, 1, 1, 0, 0, 1, 1, 0 = G - Correct? True\nClassification of Instance: label=B, attributes=0, 1, 3, 1, 1, 1, 0, 0, 1, 0 = G - Correct? False\nClassification of Instance: label=G, attributes=2, 0, 1, 1, 1, 2, 0, 1, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=1, 1, 1, 1, 1, 0, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=2, 1, 3, 1, 0, 2, 0, 0, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 2, 3, 1, 1, 0, 0, 0, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=1, 1, 3, 1, 3, 1, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 1, 3, 1, 0, 0, 0, 0, 0, 0 = G - Correct? True\nClassification of Instance: label=B, attributes=2, 1, 4, 1, 1, 0, 0, 0, 0, 0 = G - Correct? False\nClassification of Instance: label=G, attributes=0, 0, 3, 1, 0, 2, 0, 0, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=2, 2, 1, 1, 1, 0, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=1, 1, 1, 2, 0, 3, 1, 1, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 0, 3, 1, 1, 0, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=B, attributes=0, 0, 0, 1, 0, 2, 0, 0, 0, 0 = B - Correct? True\nClassification of Instance: label=G, attributes=2, 0, 3, 1, 3, 1, 0, 0, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 0, 1, 1, 3, 2, 1, 1, 1, 0 = B - Correct? False\nClassification of Instance: label=G, attributes=0, 1, 3, 1, 1, 0, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 1, 2, 2, 1, 3, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=1, 1, 1, 2, 0, 3, 0, 2, 0, 0 = G - Correct? True\nClassification of Instance: label=B, attributes=2, 1, 3, 1, 1, 2, 0, 0, 1, 0 = G - Correct? False\nClassification of Instance: label=G, attributes=1, 1, 3, 2, 0, 3, 0, 0, 0, 0 = B - Correct? False\nClassification of Instance: label=B, attributes=1, 1, 0, 1, 1, 1, 0, 0, 0, 0 = B - Correct? True\nClassification of Instance: label=G, attributes=0, 1, 1, 1, 1, 0, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=B, attributes=2, 1, 3, 1, 1, 3, 0, 0, 1, 0 = B - Correct? True\nClassification of Instance: label=B, attributes=3, 2, 3, 2, 3, 3, 1, 0, 1, 0 = G - Correct? False\nClassification of Instance: label=G, attributes=0, 1, 1, 1, 1, 1, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=2, 2, 2, 0, 1, 1, 0, 1, 0, 0 = G - Correct? True\nClassification of Instance: label=B, attributes=1, 1, 1, 0, 0, 2, 0, 0, 0, 0 = G - Correct? False\nClassification of Instance: label=G, attributes=0, 1, 3, 1, 1, 1, 0, 0, 0, 1 = G - Correct? True\nClassification of Instance: label=G, attributes=3, 1, 1, 2, 1, 3, 0, 1, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=1, 0, 1, 1, 0, 1, 0, 1, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=1, 1, 1, 0, 1, 2, 1, 2, 1, 0 = G - Correct? True\nClassification of Instance: label=B, attributes=1, 1, 3, 1, 1, 0, 0, 0, 0, 0 = B - Correct? True\nClassification of Instance: label=G, attributes=2, 0, 2, 2, 0, 3, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=2, 1, 2, 1, 1, 0, 0, 1, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 1, 3, 1, 1, 1, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=B, attributes=2, 1, 3, 1, 1, 0, 0, 0, 1, 0 = G - Correct? False\nClassification of Instance: label=G, attributes=0, 1, 3, 1, 2, 2, 0, 0, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=1, 1, 3, 1, 0, 1, 0, 0, 0, 0 = B - Correct? False\nClassification of Instance: label=B, attributes=0, 1, 2, 1, 1, 2, 0, 0, 1, 0 = G - Correct? False\nClassification of Instance: label=G, attributes=0, 0, 3, 1, 1, 1, 0, 1, 1, 0 = G - Correct? True\nClassification of Instance: label=B, attributes=0, 3, 3, 1, 1, 1, 0, 0, 1, 0 = G - Correct? False\nClassification of Instance: label=G, attributes=0, 0, 2, 1, 1, 0, 1, 1, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=2, 1, 3, 1, 3, 2, 1, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=1, 1, 1, 1, 1, 1, 0, 1, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=1, 1, 1, 1, 1, 3, 0, 1, 0, 0 = G - Correct? True\nClassification of Instance: label=B, attributes=0, 1, 3, 1, 1, 0, 0, 0, 1, 0 = G - Correct? False\nClassification of Instance: label=B, attributes=2, 1, 3, 1, 1, 1, 0, 0, 1, 0 = G - Correct? False\nClassification of Instance: label=G, attributes=0, 1, 3, 1, 1, 2, 0, 0, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=2, 2, 2, 0, 0, 0, 0, 0, 0, 0 = B - Correct? False\nClassification of Instance: label=B, attributes=1, 1, 2, 1, 1, 0, 0, 1, 0, 0 = B - Correct? True\nClassification of Instance: label=G, attributes=0, 1, 3, 1, 1, 0, 0, 0, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=1, 0, 3, 1, 3, 1, 0, 0, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=2, 0, 3, 1, 1, 0, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=1, 0, 3, 2, 1, 3, 1, 0, 0, 0 = B - Correct? False\nClassification of Instance: label=G, attributes=0, 1, 1, 1, 1, 2, 0, 1, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=2, 1, 3, 1, 1, 2, 0, 0, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=1, 1, 3, 2, 0, 3, 0, 0, 0, 0 = B - Correct? False\nClassification of Instance: label=G, attributes=0, 0, 3, 0, 1, 0, 0, 0, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 1, 3, 1, 3, 2, 1, 0, 1, 1 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 1, 1, 1, 1, 3, 0, 1, 1, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=0, 0, 3, 1, 1, 0, 0, 0, 0, 0 = G - Correct? True\nClassification of Instance: label=G, attributes=1, 1, 3, 1, 0, 0, 0, 0, 1, 0 = G - Correct? True\n```\n\n#### Mode 3\n\n```bash\ndorpascal@Mac-mini HW3_Skeleton % python3 my_HW3.py 3 prune_train.txt prune_test.txt\n0.67485\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdor-sketch%2Fdecisiontreeai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdor-sketch%2Fdecisiontreeai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdor-sketch%2Fdecisiontreeai/lists"}