Add a Safe Rate

Start with four pinned rows of clicks and impressions. Keep both original count columns unchanged. Create click_rate only when the denominator is safe. The rate is shown as an exact fraction, so 2 / 10 and 4 / 20 both become 1/5 without floating rounding.

Adding an exact rate feature from pinned counts while guarding against division by zero.

highlighted = computed this step

Input counts

Start with 4 pinned rows of click and impression counts.

clicks and impressions\text{clicks and impressions}
Input CountsrowclicksimpressionsA210B08C30D420

Safe division rule

Divide only when impressions is greater than 0; otherwise leave the rate undefined.

safe rate rule\text{safe rate rule}
Safe Rate Ruleconditionnew featureimpressions > 0click_rate = clicks / impressionsimpressions = 0click_rate = (undefined)

Add click_rate

Keep the counts unchanged and add the exact click_rate feature.

counts plus exact rate\text{counts plus exact rate}
Counts with Exact Raterowclicksimpressionsclick_rateA2101/5B080C30(undefined)D4201/5