Add-one smoothing is a visible count policy chosen before scoring. This side example shows a zero feature count becoming an exact nonzero fraction.
highlighted = computed this step
A side example with a zero count
Keep the main scoring path separate. In this side example, feature F3 has value 1. Its visible count is 0 in class A and 1 in class B.
F3=1:A count 0,B count 1
Add one before the ratio
With add-one smoothing, class A uses numerator 0 plus 1 and denominator 4 plus 2. That gives 1/6.
P(F3=1∣A)=(0+1)/(4+2)=1/6
The same policy for B
Class B uses numerator 1 plus 1 and denominator 2 plus 2, giving 1/2. This policy is chosen before scoring; the existing scoring lesson still uses smoothing none.