
XKCD classification
The building blocks of ML are algorithms for regression and classification:
Classification algorithms learn to assign labels to data points based on their features. In health data, this might mean predicting whether a patient has a disease based on lab results.
| Method | Description | Strengths |
|---|---|---|
| Logistic Regression | Linear model for binary outcomes | Easy to interpret, fast |
| Decision Trees | Tree structure, splits data by feature values | Intuitive but can overfit |
| Random Forest | Many decision trees combined | More robust, less overfitting |
| Support Vector Machines (SVM) | Finds the best boundary between classes | Good for complex data |
| Naive Bayes | Probabilistic, assumes features are independent | Fast and simple |
| Neural Networks | Layers of nodes, can model complex patterns | Powerful but less interpretable |

There are many more classification approaches than data scientists, so choosing the best one for your application can be daunting. Thankfully, all of them output predicted classes for each data point. We can use this similarity to define objective performance criteria based on how often the predicted class matches the underlying truth.
I get in trouble with the data science police if I don’t include something about confusion matrices:

Evaluation metrics
Precision (Positive Predictive Value) = $\frac{TP}{TP + FP}$
How well it performs when it predicts positive
Recall (Sensitivity, True Positive Rate) = $\frac{TP}{TP+FN}$
How well it performs among actual positives