Classification models predict a category, such as whether a customer will leave or stay, or whether an email is spam. They are among the first models a data science learner builds.
How classification works
The model learns from past examples where the answer is known, then predicts the category for new examples. The answer is a class, not a number.
Common models for beginners
- Logistic regression: simple and easy to explain.
- Decision tree: makes decisions in steps that you can draw.
- Random forest: combines many trees, and is often more accurate.
Check the balance of classes
If only a few examples belong to one class, a model can look accurate by always predicting the common class. Look at how many examples are in each class before you train.
A practice project
Use a public dataset, such as customer churn, train a logistic regression and a decision tree, and compare which one predicts the rare class better.
Next step: see our data science course at ScholarLogic, or book a free demo class. A counsellor will share the fee and the next batch dates.
