Bayes theorem is a way of calculating conditional probability ie. finding the probability of an event occurring based on the given probability of other events that have already occurred. Mathematically, it is stated as -

P(A|B) = {P(B|A).P(A)}/P(B)

Bayes theorem has become a very useful tool in applied machine learning. It provides a way of thinking about the relationship shared by data and the models.

A machine learning model is a specific way of thinking about the structured relationship in the data such as relationships shared by input (x) and output (y).

If we have some prior domain knowledge about the hypothesis, Then the Bayes theorem can help in solving machine learning problems.