Before choosing a machine learning model, it is essential to understand the type of problem we are trying to solve.
In supervised learning, problems are generally divided into regression and classification.
Regression problems aim to predict a continuous numerical value.
The target variable can take any value within a range, and the model learns a quantitative relationship between the input features and the target.
Classification problems aim to assign an input to a discrete class.
The target variable represents categories, and the model learns to distinguish between different classes based on the input features.
| Aspect | Regression | Classification |
|---|---|---|
| Target type | Continuous | Discrete |
| Output | Numeric value | Class or probability |
| Typical metrics | MSE, RMSE, R² | Accuracy, Precision, Recall |
| Common models | Linear Regression, Random Forest | Logistic Regression, KNN |
Choosing the wrong problem type leads to: - incorrect model selection - inappropriate evaluation metrics - misleading results
Understanding whether a problem is a regression or a classification task is the first fundamental step in any machine learning project.