1. What is a Decision Tree?
A Decision Tree is a supervised machine learning algorithm used for classification and regression tasks. It splits data into branches based on conditions and helps make predictions by following a path from the root node to a leaf node.
2. How does a Decision Tree work?
A Decision Tree works by repeatedly splitting the dataset based on the feature that gives the best separation of classes. Each split reduces impurity, and the process continues until a stopping condition is reached or all data is classified.
3. What are the main components of a Decision Tree?
- Root Node: Starting point of the tree
- Decision Node: A node where the split happens
- Leaf Node: Final output or prediction
- Branches: Paths connecting decision nodes
4. What is Gini Impurity?
Gini Impurity measures how often a randomly chosen element from the set would be incorrectly labeled. A lower Gini value means a purer node.
5. What is Entropy?
Entropy is a measure of impurity or randomness in the data. It is used in Information Gain to decide the best split in Decision Trees.
6. What is Information Gain?
Information Gain measures how much a feature improves purity after a split. The feature with the highest Information Gain is chosen for splitting the node.
7. Difference between Gini Impurity and Entropy?
- Gini Impurity: Faster and simpler to compute
- Entropy: Includes logarithmic calculations
Both measure impurity, and the choice depends on algorithm preference.
8. What is Overfitting in Decision Trees?
Overfitting happens when the tree learns too much detail from the training data, making it perform badly on new unseen data.
9. How to avoid Overfitting in Decision Trees?
- Pruning
- Setting maximum depth
- Setting minimum samples per leaf
- Limiting the number of features in splits
10. What is Pruning?
Pruning is a technique to reduce the size of a Decision Tree to prevent overfitting. It removes unnecessary branches that do not improve prediction.
11. What is the difference between Pre-Pruning and Post-Pruning?
- Pre-Pruning: Stops tree growth early
- Post-Pruning: Grows full tree and then removes weak nodes
12. Can Decision Trees handle missing values?
Yes, Decision Trees can handle missing values by using surrogate splits or distributing samples based on existing patterns.
13. What type of data can Decision Trees handle?
They can handle both numerical and categorical data, making them very flexible.
14. What are the advantages of Decision Trees?
- Easy to understand and visualize
- No need for feature scaling
- Works for both classification and regression
- Handles nonlinear data
15. What are the disadvantages of Decision Trees?
- Prone to overfitting
- Can become complex with deep trees
- Small changes in data may change the tree drastically
16. What is a Random Forest?
Random Forest is an ensemble of multiple Decision Trees. Each tree makes a prediction, and the final output is based on majority vote or averaging, solving the overfitting problem.
17. When should you use a Decision Tree?
Use it when you want interpretable models, quick results, and when working with data that includes both text, numbers, and category variables.
Onlei Technologies Reviews at Trustmyview
Onlei Technologies Reviews at Qnaspot
Onlei Technologies Reviews at MediaToz
Onlei Technologies Reviews at AASOFT
Onlei Technologies Trusted and Best at Medium
Onlei Technoogies Reviews by Sakshi
ONLEI Technologies Reviews : Onlei Technologies Reviews , Onlei Technologies Reviews , Onlei Technologies Reviews , Onlei Technologies Reviews , Onlei Technologies Reviews , Onlei Technologies Reviews