Naive Bayes classifier problem

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Here's that example worked:

Code:
       --A--- ----B---- ----C---- ---D---- ----E---- ---F---- ----G---- ---H---- ----I----
   1   gender            height             weight              foot                      
   2   male                  6.00                180                 12                   
   3   male                  5.92                190                 11                   
   4   male                  5.58                170                 12                   
   5   male                  5.92                165                 10                   
   6   female                5.00                100                  6                   
   7   female                5.50                150                  8                   
   8   female                5.42                130                  7                   
   9   female                5.75                150                  9                   
  10                                                                                      
  11   gender           mean (ht) var (ht) mean (wt) var (wt) mean (ft) var (ft)          
  12   male                  5.86   0.0350    176.25      123     11.25    0.917          
  13   female                5.42   0.0972    132.50      558      7.50    1.667          
  14                                                                                      
  15   gender P(gender)  height             weight              foot             numerator
  16                         6.00                130                  8                   
  17   male         0.5   1.58E+0            5.99E-6            1.31E-3            6.20E-9
  18   female       0.5   2.23E-1            1.68E-2            2.87E-1            5.38E-4

Formulas:

C12 and down: {= AVERAGE(IF($A$2:$A$9= $A12, C$2:C$9))}

D12 and down: {=VAR(IF($A$2:$A$9=$A12, C$2:C$9))}

B17 and down: Input

C17 and down: =NORMDIST(C$16, C12, SQRT(D12), FALSE)

E17 and down: =NORMDIST(E$16, E12, SQRT(F12), FALSE)

G17 and down: =NORMDIST(G$16, G12, SQRT(H12), FALSE)

I17 and down: =PRODUCT(B17:G17)

The numerator in I18 is larger than that in I17, so you conclude it's a female.

The formulas with curly braces are array formulas.
 
Upvote 0
i think it should be like this --> if expression is 3.5033e-02, there is term e, which is neper´s value = 2,71828, so 3.5033*2,71828^-2 should be 0.474120736 etc.
 
Upvote 0
you see var (wt) values can't be so big 123 and 558... in formula letter e means neper's number. It made me wonder...
 
Upvote 0
Variance is the square of the standard deviation. It is that big, and Napier's number doesn't factor into the calculation at all.
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,827
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top