Dealing with (# of events) = 0 in a bin when computing weight of evidence (WOE) I want to compute the WOE of X (categorical) and Y (binary, 0 or 1). But one bin does not contain any Y = 0. 

As a result, I cannot compute the WOE of this bin. How should I proceed to compute the WOE?
 A: Some toughts that may serve as an answer :


*

*Generally speaking you need more data. Not being able to calculate a statistic may indicate you don't have enough values. You have bins with 10 to 20 instances, even if it was enough to calculate WoE, you are likely to encounter some problems with the signifiance of your subsequent model. 

*Excel give you a div/0 error because it cannot handle $ +/-\infty$. Another langage may have given you a $ +/-\infty$. This is something actually usefull. A $ +/-\infty$, indicate a perfect separation. You might want to keep that category as is. For that you would just need to handle infinite values. However, in the real world, you might want to avoid to create a class with a 0 / 100 % predicted value. Categories with perfect prediction may also indicates you don't have enough data, which is generally dealt with getting more data (see above). 

*You might want to look at how your categories are built. If they are given you may want to consider merging some of them, either based on expert knowledge or on statistical considerations (like consideration on WOE being $+/- \infty$). In your exemple, you would merge 2 into 3, rather than 2 into 1, this would create a class with enough 0 and 1. 

*If your categories are not given, you must consider building them such that they have a minimal number of 0 and 1. For exemple, in the case of a rare event problem (lot of 0, few 1), you may consider grouping your instance by a constant number of 1, so that you ensure having enough 1 in your bins. If you cannot get more data, another "trick" is to drop categories with low population count.
