In machine learning, Naive Bayes is used to compute conditional probability of predicted class $y$ occuring given all the predictor variables $x$. In other words, Bayes theorem relates P(outcome/evidence) (what we want to predict) to P(evidence / outcome) (training set).
The algorithm builds the conditional probability and applies prediction. The algorithm is called naive because it assumes independence between predictor variables, while in reality this may not be true in all cases.
Consider $A_1 ,… A_k$ as $k$ predictor variables in machine learning. The Naive Bayes classifier will build the conditional probabilities of $p(B_j|A_k)$ to later predict what would $p(A_i | B_j)$ be.
import seaborn as sns iris = sns.load_dataset('iris')
<matplotlib.axes._subplots.AxesSubplot at 0x1a0d0e03c8>
%matplotlib inline sns.pairplot(iris, hue='species')
<seaborn.axisgrid.PairGrid at 0x1a17a970b8>
X_iris = iris.drop('species', axis=1) X_iris.shape
y_iris = iris['species'] y_iris.shape
X_iris is in caps as
X is a vector of multiple features for each record, whereas
y_iris is in small case as it is a scalar for each record.