Evaluate rare-event models against the event frequency and the cost of each decision, not overall accuracy alone. Class weighting can change the training objective, but it does not create new rare events or guarantee calibrated probabilities. Keep the forward test distribution representative of the environment where the detector will operate.
The model and its assumptions
A model predicting no rare event can appear highly accurate when positives are scarce. Whether that is acceptable depends on the task. Missing a severe execution failure may matter far more than an unnecessary review, while a trading filter that escalates everything can become operationally unusable.
Training interventions such as reweighting or resampling alter the influence of observations. Their effect should be measured separately from the underlying information quality. Artificially balanced test data can obscure the number of false alerts a team would receive at real-world prevalence.
A worked example
Consider a hypothetical set of 10,000 eligible events, of which 100 are positive. Predicting negative every time yields 99% accuracy and zero recall of the events of interest. The commonly used balanced-weight formula n/(number of classes × class count) gives positive weight 10,000/(2×100) = 50 and negative weight approximately 0.505.
Those weights equalise class influence in the specified loss; they do not imply that positives now occur half the time in deployment. A threshold selected under the wrong prevalence can produce far more alerts than the operations team expects.
Practical review and implementation
Define the positive event and its observability carefully. Report precision, recall and alerts per day at several prespecified decision thresholds. Inspect false negatives and false positives by market condition and event type, with separate attention to the most consequential misses.
Apply training weights inside the validation procedure and recalibrate probabilities where necessary on suitable historical data. Avoid generating synthetic observations across train/test time boundaries. If there are only a handful of independent rare episodes, acknowledge that limitation and consider a simpler rule or a narrower deployment decision.
Assumptions and limitations
No weighting scheme resolves missing labels, delayed discovery or a changing event definition. Rare positives may also cluster within one incident, making the raw positive count look more informative than it is. A detector's operational value depends on what happens after an alert, including reviewer capacity and the consequences of incorrectly blocking or allowing an action.
Primary references
Further detail on the underlying concepts and data definitions:
