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."
and we can use Maximum A Posteriori (MAP) estimation to estimate $P(y)$ and $P(x_i|y)$; the former is then the relative frequency of class $y$ in the training set.
Why would we estimate P(y)$P(y)$ and P(xi|y)$P(x_i|y)$ through MAP? Shouldn't we calculate P(y)$P(y)$ and P(xi|y)$P(x_i|y)$ through training data?