We can compare two algorithms in different categories —
Criteria | Logistic Regression | Decision Tree Classification | tr>
---|---|---|
Interpretability | Less interpretable | More interpretable |
Decision Boundaries | Linear and single decision boundary | Bisects the space into smaller spaces |
Ease of Decision Making | A decision threshold has to be set | Automatically handles decision making td > | Overfitting | Not prone to overfitting | Prone to overfitting |
Robustness to noise | Robust to noise | Majorly affected by noise |
Scalability | Requires a large enough training set | Can be train ed on a small training set |
As a simple experiment, we run two models on the same dataset and compare their characteristics.
Step 1: Import the required libraries
|
Step 2: Read and clear the dataset
|
Step 3: Train and evaluate the Logisitc regression model
|
Step 4: Train and evaluate the decision tree classifier model
|
Comparing the scores, we see that the logistic regression model performed better in the current dataset, but this may not always be the case.