Classification
Classification is what you do when the thing you want to predict is a label, not a number. Instead of guessing “how much,” you’re deciding “which kind,” like spam vs. not spam or fraud vs. legitimate.
What classification really means
In supervised learning, a classification model learns from examples where each input (features) is paired with a known category (the target label). The model’s job is to draw boundaries in feature space so new cases fall on the right side. Many classifiers also output a probability for each class (or a score that can be turned into one), which lets you choose a decision threshold instead of blindly taking the “most likely” label.
Common flavors and examples
Classification shows up everywhere because many business and medical decisions are naturally categorical:
- Binary classification: spam detection (spam / not spam), churn (leave / stay), disease screening (positive / negative).
- Multiclass classification: route a support ticket to billing/tech/sales; recognize digits 0–9.
- Multilabel classification: tag a document as both “legal” and “urgent.”
In scikit-learn, you’ll meet classifiers like LogisticRegression, RandomForestClassifier, and SVC, typically trained with fit(X, y) and used via predict or predict_proba.
Why it matters in practice
Getting classification right affects more than accuracy. Class imbalance (rare fraud) can make accuracy misleading, so metrics like precision, recall, F1, and ROC-AUC matter. Threshold choice controls trade-offs (catch more fraud vs. annoy more customers), and good probability estimates support risk-based decisions rather than rigid yes/no outputs.
Classification is a supervised learning task where a model predicts a discrete class label for each input, typically by estimating class probabilities and selecting the most likely category (e.g., spam vs. not spam). It matters because many real-world decisions require assigning inputs to predefined categories, and model choice, loss functions, evaluation metrics (accuracy, F1, ROC-AUC), and deployment thresholds all depend on the classification framing.
Classification is like sorting mail into different bins: “bills,” “personal,” “ads,” and “important.” You look at each envelope and decide which label fits best. In AI, classification means teaching a model to pick a category for something new, based on examples where the right answer is already known.
For example, a spam filter classifies emails as “spam” or “not spam.” A medical app might classify a skin photo as “likely benign” or “needs a doctor.” The key idea is that the output is a named group, not a number—so the system’s job is to choose the right label.