Classification Algorithm-1 Notes – Class 12 Data Science (844)
Classification Algorithm-1 Notes for Class 12 Data Science (CBSE) covering Decision Trees, their applications, and steps to create them with easy, pointwise explanations.
Introduction to Decision Trees
- A Decision Tree is a diagrammatic representation of the decision-making process that has a tree-like structure.
- Each internal node represents a question or decision based on a specific condition or test.
- Each branch represents the outcome of the decision or test performed at the previous node.
- Each leaf node contains the final class label or decision.
- Decision Trees are commonly used in everyday life to make decisions by evaluating different conditions step by step.
- Decision Trees are one of the most efficient techniques used for classification problems.
Applications of Decision Trees
- Decision Trees are one of the most widely used supervised learning algorithms because they are easy to visualize, understand, and interpret.
- They are especially useful for solving problems where the relationship between variables is non-linear and linear classification techniques do not produce accurate results.
- Decision Trees can model both linear and non-linear relationships effectively.
- They are versatile and can be used for both classification and regression problems.
Decision Trees for Classification and Regression
- Regression Trees are used when the dependent (target) variable is continuous.
- Classification Trees are used when the dependent (target) variable is categorical.
- In a Regression Tree, the terminal (leaf) node stores the mean of the observations, and predictions are made using this mean value.
- In a Classification Tree, the terminal (leaf) node stores the mode (most frequent class) of the observations, and predictions are made using this mode.
Creating a Decision Tree
- A Decision Tree is created by breaking down a problem into a series of decisions that lead to a final outcome.
- One of the early real-world applications of Decision Trees was developed by Lee Goldman, a U.S. Navy cardiologist, to help doctors identify possible heart attack cases and make quick treatment decisions.
Steps to Create a Decision Tree
- Step 1: Identify the Main Objective
Decide the main problem or objective that the Decision Tree is intended to solve. This main objective is placed at the top of the tree and is called the root node. - Step 2: Draw Branches and Leaf Nodes
Create branches for every possible decision or outcome from the root node. Each branch represents a possible path, and each leaf node represents the final result of a decision. If another decision is required, add another decision node before reaching the final outcome. - Step 3: Calculate the Probability of Each Decision
Estimate the probability of success for each decision by analyzing previous data, past projects, or research. After calculating the expected values, assign them to the corresponding branches of the Decision Tree.