A great question about the baseline performance of a random predictor!
Assume we have a binary classification problem (2 classes: Positive and Negative) and a balanced dataset, meaning:
- 50% of the samples are Positive (P) instances
- 50% of the samples are Negative (N) instances
A random predictor (also called a "random guesser" or "coin flipper") is a classifier that makes predictions randomly, without using any information from the input features. It's like flipping a fair coin to decide the class label.
Here's what happens when a random predictor makes predictions on our balanced dataset:
- True Positives (TP): The predictor correctly predicts a Positive instance. Probability: 0.5 (chance of predicting P) × 0.5 (chance that the true label is P) = 0.25 (or 25% of all instances)
- True Negatives (TN): The predictor correctly predicts a Negative instance. Probability: 0.5 (chance of predicting N) × 0.5 (chance that the true label is N) = 0.25 (or 25% of all instances)
- False Positives (FP): The predictor incorrectly predicts a Negative instance as Positive. Probability: 0.5 (chance of predicting P) × 0.5 (chance that the true label is N) = 0.25 (or 25% of all instances)
- False Negatives (FN): The predictor incorrectly predicts a Positive instance as Negative. Probability: 0.5 (chance of predicting N) × 0.5 (chance that the true label is P) = 0.25 (or 25% of all instances)
Now, let's compute the metrics you asked about:
Precision (P): Out of all predicted Positive instances, how many are truly Positive?
= TP / (TP + FP) = 0.25 / (0.25 + 0.25) = 0.5
Recall (R) or True Positive Rate (TPR): Out of all truly Positive instances, how many are predicted Positive?
= TP / (TP + FN) = 0.25 / (0.25 + 0.25) = 0.5
False Positive Rate (FPR): Out of all truly Negative instances, how many are predicted Positive (i.e., false alarms)?
= FP / (FP + TN) = 0.25 / (0.25 + 0.25) = 0.5
And, just for completeness:
Accuracy (ACC): Overall proportion of correct predictions = (TP + TN) / (TP + TN + FP + FN) = (0.25 + 0.25) / 1 = 0.5
F1-score (F1): Harmonic mean of Precision and Recall = 2 × (P × R) / (P + R) = 2 × (0.5 × 0.5) / (0.5 + 0.5) = 0.5
In summary, for a random predictor on a balanced dataset:
- Precision = 0.5
- Recall = 0.5
- False Positive Rate (FPR) = 0.5
- Accuracy = 0.5
- F1-score = 0.5
Intuitively, this makes sense:
- The random predictor has no preference for either class, so it gets half of the Positive and half of the Negative instances correct (Precision = Recall = 0.5).
- Since it's random, half of the time it predicts Positive when the true label is Negative (FPR = 0.5).
- Overall, it correctly classifies half of the instances (Accuracy = 0.5).
These values serve as a baseline performance: any reasonable machine learning model should beat these metrics (e.g., Precision, Recall, F1-score > 0.5) to demonstrate it's actually learning something useful from the data.
Hope this helps!