A prior is the class share before the query features are applied. The lesson turns class counts into exact rational priors and keeps the count-over-total provenance visible.

highlighted = computed this step

The prior rule

The class prior is count(c) divided by the total count. For A this is 4/6 = 2/3.

P(A)=4/6=2/3P(A)=4/6=2/3
Class priorsClass priors are count over total.Naive Bayes from countstotal=6; counts=A:4, B:2classcount(c)P(c)=count/totalA4P(A)=4/6 (=2/3)B2P(B)=2/6 (=1/3)

The other class

For B the same rule gives 2/6 = 1/3. The two priors sum to 1.

P(B)=2/6=1/3P(B)=2/6=1/3
Class priorsClass priors are count over total.Naive Bayes from countstotal=6; counts=A:4, B:2classcount(c)P(c)=count/totalA4P(A)=4/6 (=2/3)B2P(B)=2/6 (=1/3)

Summary

The prior is each class's share of the shown data. No feature count has entered the product yet.

P(A)+P(B)=1P(A)+P(B)=1
Class priorsClass priors are count over total.Naive Bayes from countstotal=6; counts=A:4, B:2classcount(c)P(c)=count/totalA4P(A)=4/6 (=2/3)B2P(B)=2/6 (=1/3)