liveBook · Manning

Conditional probability

As explained in Grokking Machine Learning, Second Edition

A conditional probability is the probability of an event given that another event is known to have occurred.

Conditional probability asks how likely event A is when event B is already known to have happened. Written as P(A|B), it means “the probability of A given B.” section 1.3

Rain in the Amazon

Suppose A means “it rains today” and B means “we live in the Amazon rainforest.” If P(A|B) = 0.8, rain has an 80% probability given that location. The additional information changes the estimate. section 1.3

New information can update a probability:

  • Without clues, the probability that an unknown animal is a dog may be small. section 8.0
  • Learning that it is a house pet raises the estimate; learning that it has wings reduces the estimate to zero. section 8.0
  • Bayes’ theorem formalizes this updating, while naive Bayes simplifies the calculation when there are many features. section 8.0

In machine learning, conditional probability connects observed features to likely labels: a classifier can estimate whether a sentence is happy given its words or whether an email is spam given its contents. section 8.0

How Grokking Machine Learning, Second Edition covers it

How deep it goes
Defines the notation through concrete examples and connects it to Bayes’ theorem, without developing the underlying formula.
Examples
Uses rain in the Amazon, animal clues, sentiment sentences, and spam emails as concrete examples.
What you can do after
Evaluate probabilities after receiving evidence and apply the idea to classification with Bayes’ theorem or naive Bayes.
How it connects
Connects conditional probability to Bayes’ theorem, naive Bayes, classification, sentiment analysis, and spam classification.

Also explained in

Compare how 14 books explain conditional probability →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Machine Learning, Second Edition. The section links point to the parts of the book it draws on.