Skip to content

ENH: prediction evaluation: point versus probability prediction, zeros in zero-inflated models #9696

Open

Description

@josef-pkt

A puzzling graph Fig 3 in

Alomair, Gadir. 2024. “Predictive Performance of Count Regression Models versus Machine Learning Techniques: A Comparative Analysis Using an Automobile Insurance Claims Frequency Dataset.” PLOS ONE 19 (12): e0314975. https://doi.org/10.1371/journal.pone.0314975.

observed number of zeros is 62%
the count regression models Poisson, Negbin and zero-inflated and hurdle version only "predict" around 19%.

In my examples, the predicted probability of zeros was always very close to the observed frequency in zero-inflated models.

Alomair computes the fraction of predicted zeros in online R code as
sum(round(zinb_test_preds) == 0) / total_obs

where zinb_test_preds is what predict returns, i.e. the mean, expected value (AFAIR, that's the default also in R)

However, the predictive distribution could be bimodal, will be bimodal if mean of the main model is large.
Looking at the prediction of the mean or expected value does not give a good point prediction.
For example, the mode might be better, e.g. point predict zero if prob of zero > 0.5 (or actually prob can be smaller and zero can still be the mode).

In their example support vector machine performed best and predicted 66 % zeros.
Their overall performance measure is mean absolute error.
The count regression models only use 5 + 1 explanatory variables (12 regression parameters in inflated and hurdle models) for 2,250 observations.
No nonlinearity or interaction terms is included.

In general MLE can do well in estimating the mean, conditional expectation E(y|x), and possibly the predictive distribution.
However, using the mean prediction might not do well according to different prediction evaluation measures.

What's the best point prediction if the predictive distribution is bimodal, so it scores high in prediction evaluation scores?
e.g. for MAE.
median? We could use ppf of predictive distribution to predict the median.
for mode: Wikipedia has explicit formulas for mode of negative binomial and poisson distributions. In zero-inflated models we would have to compare prob at zero with prob at mode of main model. (In poisson, mode = floor(mean) if mean is not an integer)

What are the objective functions, scoring rules for the different machine learning models?
For example what is SVM predicting in their article? It cannot be the mean if the zero predictions are so high.
update The article says "The best hyperparameters were selected based on the lowest mean absolute error (MAE) averaged across the folds." So it is targeting the specific scoring rule

Aside:
I was looking at Brier score for binary y, because it is a "proper" scoring rule and does not use classification measures/scoring rules.
Brier score is based on predicted probabilities in binary or categorical models.
We would need something similar for count regression.
Which I actually already did, i.e. mean squared deviation between predicted and expected frequencies. However, I used in only in-sample.

Google search AI for "scoring rules when distribution is bimodal"
shows two proper scoring rules that are based on predictive distributions
The answer ends with
"Avoid using standard single-point metrics like mean or median, as they are unrepresentative of either peak in a bimodal distribution and will provide a misleading assessment of forecast accuracy. "

update
Alomair cites the following article for using MAE
Buyrukoğlu, Gonca, Selim Buyrukoğlu, and Zeynal Topalcengiz. 2021. “Comparing Regression Models with Count Data to Artificial Neural Network and Ensemble Models for Prediction of Generic Escherichia Coli Population in Agricultural Ponds Based on Weather Station Measurements.” Microbial Risk Analysis 19 (December): 100171. https://doi.org/10.1016/j.mran.2021.100171.

In their table 3 observed and "predicted" zero probability closely or perfectly match for ZIP and HNB. So, I guess that they are calculating the actual predicted probabilites.
Their forecast evaluation use MAE and the regression models don't perform well.
They mention sensitivity to outliers as one reason for their bad performance.
AFAICS, the data look more heavy-tailed than the usual count distributions. Also the number of observations is not very large.

It would be useful to add a heavy-tailed discrete, count distribution.
Maybe discretized log-normal, or ???

Activity

  1. dhairya-motta commented on Jun 21, 2026

    @dhairya-motta

    Hi @josef-pkt,

    I had a chance to read the Alomair paper and thought this was really interesting.

    based on my reading of this, the problem with the inconsistency in fig 3 for the 19% vs 66% zero predictions may boil down to the fact that the optimal point prediction under MAE is the median, not the mean (Gneiting, 2011). MLE optimizes the log-score while SVM optimized MAE, so they could be optimizing completely different objectives from the start. although maybe there is something else going on here.

    speaking of proper scoring rules, im wondering if the Ranked Probability Score (RPS) could be the right tool that you are after as the analogue of the brier score for count data? RPS evaluates the entire predictive CDF instead of a single point estimate, but im not sure how well it works in your case with a bimodal distribution.

    concerning the heavy-tailed distribution, I think the discretized log-normal distribution would be a good starting point for insurance data. also COM-Poisson is often used in the actuarial literature as a flexible alternative to handle dispersion, although not sure how useful it is here.

    any corrections would be appreciated as im still learning, would love to hear where youd want to take this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions