0% found this document useful (0 votes)
9 views

Decision Trees

Decision trees are a widely used method in data mining and machine learning for classification and regression, represented as a tree structure with decision rules. They are particularly suitable for categorical datasets and differ from linear regression, which uses equations to model relationships. Implementation involves using libraries like sklearn in Python, and model accuracy can range from 0% to 100%, with various classifications of accuracy levels.

Uploaded by

ayeshasadiqa148
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Decision Trees

Decision trees are a widely used method in data mining and machine learning for classification and regression, represented as a tree structure with decision rules. They are particularly suitable for categorical datasets and differ from linear regression, which uses equations to model relationships. Implementation involves using libraries like sklearn in Python, and model accuracy can range from 0% to 100%, with various classifications of accuracy levels.

Uploaded by

ayeshasadiqa148
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Decision Trees

Definition
• Decision trees are a popular method used in data mining and machine
learning for both classification and regression tasks. They model
decisions and their possible consequences, including chance event
outcomes.
Differences from Regression
• Model Representation:
• Decision Trees: Represented as a tree structure with nodes and
branches.
• Linear Regression: Represented by an equation that models the
relationship between input features and the continuous output.
Decision Rules:
• Decision Trees: Use a series of if-then-else decision rules derived from
the data features.
• Linear Regression: Uses a linear equation to model the relationship
between the dependent and independent variables.
Types of Datasets Suitable for
Decision Trees
• Categorical Data: Suitable for datasets where the output variable is
categorical (e.g., yes/no, spam/ham, disease/no disease).
Implementation
• To implement a decision tree for predicting whether a patient has a
particular disease, we can use a sample dataset and the
DecisionTreeClassifier from the sklearn library in Python. Here’s a
step-by-step implementation:
• Load and prepare the data
• Train a decision tree classifier
• Make predictions
• Evaluate the model
Accuracy
• The accuracy score of a model ranges from 0 to 1:

0: The model made no correct predictions; it's completely


inaccurate.
1: The model made all correct predictions; it's perfectly accurate.
Continue
• In percentage terms, this is equivalent to a range from 0% to 100%.
For example, an accuracy score of 0.85 means the model was correct
85% of the time.
• Generally, in practice:

• 0.9 to 1: Excellent accuracy


• 0.7 to 0.9: Good accuracy
• 0.5 to 0.7: Fair accuracy
• Below 0.5: Poor accuracy

You might also like