Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Machine Learning Quick Reference

You're reading from  Machine Learning Quick Reference

Product type Book
Published in Jan 2019
Publisher Packt
ISBN-13 9781788830577
Pages 294 pages
Edition 1st Edition
Languages
Author (1):
Rahul Kumar Rahul Kumar
Profile icon Rahul Kumar
Toc

Table of Contents (18) Chapters close

Title Page
Copyright and Credits
About Packt
Contributors
Preface
1. Quantifying Learning Algorithms 2. Evaluating Kernel Learning 3. Performance in Ensemble Learning 4. Training Neural Networks 5. Time Series Analysis 6. Natural Language Processing 7. Temporal and Sequential Pattern Discovery 8. Probabilistic Graphical Models 9. Selected Topics in Deep Learning 10. Causal Inference 11. Advanced Methods 1. Other Books You May Enjoy Index

The Bayes theorem


The Bayes theorem helps us in finding posterior probability, given a certain condition:

P(A|B)= P(B|A) * P(A)/P(B)

A and B can be deemed as the target and features, respectively.

Where, P(A|B): posterior probability, which implies the probability of event A, given that B has taken place:

  • P(B|A): The likelihood that implies the probability of feature B, given the target A
  • P(A): The prior probability of target A
  • P(B): The prior probability of feature B

How the Naive Bayes classifier works

We will try to understand all of this by looking at the example of the Titanic. While the Titanic was sinking, a few of the categories had priority over others, in terms of being saved. We have the following dataset (it is a Kaggle dataset):

Person category

Survival chance

Woman

Yes

Kid

Yes

Kid

Yes

Man

No

Woman

Yes

Woman

Yes

Man

No

Man

Yes

Kid

Yes

Woman

No

Kid

No

Woman

No

Man

Yes

Man

No

Woman

Yes

 

Now, let's prepare a likelihood table for the preceding information:

 

 

Survival chance

 

 

 

 

No

Yes

Grand Total

 

 

Category

Kid

1

3

4

4/15=

0.27

Man...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime