This is from https://scikit-learn.org/stable/modules/naive_bayes.html

In the last line it says "and we can use Maximum A Posteriori (MAP) estimation to estimate P(y) and P(xi|y); the former is then the relative frequency of class y in the training set."

Why would we estimate P(y) and P(xi|y) through MAP? Shouldn't we calculate P(y) and P(xi|y) through training data?
[![enter image description here][1]][1]


  [1]: https://i.sstatic.net/XlymD.png