The ONE rule that decides everything 🧠
If the target is a number and the distance between values matters → REGRESSION If the target is a category and distance does NOT matter → CLASSIFICATION
| Aspect | Regression | Classification |
|---|---|---|
| Target | numeric score | category |
| Output | 1 neuron | N neurons |
| Loss | MSE / MAE | CrossEntropy |
| Prediction | 5.6 | "medium" |
| Error meaning | distance matters | distance ignored |
| Natural fit here | ✅ YES |
📌 MSELoss expects FLOAT targets, not integers (Long).
This answers:
“What if I don’t have labels?”
Learn
Clustering (KMeans, DBSCAN)
PCA / dimensionality reduction
Anomaly detection
With your wine data
Cluster wines by chemistry
Visualize red vs white separation
Detect outlier wines
📌 This is common in real datasets, where labels are missing or unreliable.