I am modeling the probability of success in a dataset where I have a both the number of trials and the number of successes (and, obviously, I am modeling $p_i=\frac{\textrm{total successes}}{\textrm{total trials}}$). I wonder how to do it in h2o, since the classical binomial model requires the outcome to be a two class variable. I have created a column probability using the above formula, setting the family as "quasibinomial" and specifying the total trials' column as weight columns but the model does not work. In fact the log of a search grid keeps saying that binomial distribution still requires a two class dependent variable.
1 Answer
"quasibinomial" is just "bernoulli" but when you have a numeric column with two values, rather than a factor column with two values (aka classes or levels).
If you want to predict a probability, you are doing a regression. It sounds like (*) you want to set distribution to "poisson", according to the descriptions at http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/algo-params/distribution.html
By the way, an alternative approach: don't model probability. Just try to predict success or not, from your raw data. All H2O's categorical algorithms actually output a probability, so it will be there for you to use.
*: If I thought the choice of distribution was critical, I'd personally set up a grid search, trying each of them and see which one works best. I.e. let the data decide what it is. But I know that idea gives real scientists the heebie-jeebies. :-)
-
$\begingroup$ Sigh, I realise it is too late, but downvoter please give your reasons. Is there some factual inaccuracy with this answer? Some change in h2o since 2019? (I think not as the link I give still works, and still answers the OPs question of why quasibinomial does not work.) $\endgroup$ Commented Jun 20, 2023 at 21:12