diff --git a/contrib/machine-learning/Naive_Bayes_Classifiers.md b/contrib/machine-learning/Naive_Bayes_Classifiers.md index 1be9f3d..ee9d0ec 100644 --- a/contrib/machine-learning/Naive_Bayes_Classifiers.md +++ b/contrib/machine-learning/Naive_Bayes_Classifiers.md @@ -75,7 +75,9 @@ P(Spam|Keywords) > P(Not Spam|Keywords), we classify the new email as "Spam". #### 1. Gaussian Naive Bayes In Gaussian Naive Bayes, continuous values associated with each feature are assumed to be distributed according to a Gaussian distribution. A Gaussian distribution is also called Normal distribution When plotted, it gives a bell shaped curve which is symmetric about the mean of the feature values as shown below: -![img_2.png](img_2.png) +###### Normal Distribution: +![img.png](img.png) + * Assumption: Each feature follows a Gaussian distribution. * Formula: The likelihood of the features given the class is computed using the Gaussian (normal) distribution formula: @@ -86,7 +88,6 @@ $$ where 𝜇𝐶 and 𝜎𝐶 are the mean and standard deviation of the feature 𝑥𝑖 for class C. - * Python implementation of Gaussian Naive Bayes classifier using scikit-learn: ```python from sklearn.datasets import load_iris @@ -117,7 +118,8 @@ Typically used for discrete features, especially for text (or document) classifi * Assumption: Features represent the number of times events (e.g., words) occur. * Formula: The likelihood of the features given the class is computed using the multinomial distribution formula: -![img_3.png](img_3.png) +$$ P(C_k | x) = \frac{1}{\sqrt{2\pi\sigma^2}} \exp\left(-\frac{(x - \mu)^2}{2\sigma^2}\right) $$ + $$ P(x_k | C) = \frac{1}{\sqrt{2\pi\sigma_C^2}} \exp\left(-\frac{(x_k - \mu_C)^2}{2\sigma_C^2}\right) $$ diff --git a/contrib/machine-learning/img.png b/contrib/machine-learning/img.png index afc5587..1028288 100644 Binary files a/contrib/machine-learning/img.png and b/contrib/machine-learning/img.png differ diff --git a/contrib/machine-learning/img_1.png b/contrib/machine-learning/img_1.png deleted file mode 100644 index 81bbfd8..0000000 Binary files a/contrib/machine-learning/img_1.png and /dev/null differ diff --git a/contrib/machine-learning/img_2.png b/contrib/machine-learning/img_2.png deleted file mode 100644 index 597147e..0000000 Binary files a/contrib/machine-learning/img_2.png and /dev/null differ diff --git a/contrib/machine-learning/img_3.png b/contrib/machine-learning/img_3.png deleted file mode 100644 index ebc9723..0000000 Binary files a/contrib/machine-learning/img_3.png and /dev/null differ diff --git a/contrib/machine-learning/img_4.png b/contrib/machine-learning/img_4.png deleted file mode 100644 index f03adb1..0000000 Binary files a/contrib/machine-learning/img_4.png and /dev/null differ