Merge remote-tracking branch 'origin/main'

pull/1210/head
Divyanshi Singh 2024-06-19 16:05:27 +05:30
rodzic ccc3f025bb
commit 631528e334
6 zmienionych plików z 5 dodań i 3 usunięć

Wyświetl plik

@ -75,7 +75,9 @@ P(Spam|Keywords) > P(Not Spam|Keywords), we classify the new email as "Spam".
#### 1. Gaussian Naive Bayes #### 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: 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. * Assumption: Each feature follows a Gaussian distribution.
* Formula: The likelihood of the features given the class is computed using the Gaussian (normal) distribution formula: * 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. 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 implementation of Gaussian Naive Bayes classifier using scikit-learn:
```python ```python
from sklearn.datasets import load_iris 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. * 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: * 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) 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)
$$ $$

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 3.4 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 26 KiB

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 8.2 KiB

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 18 KiB

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 6.5 KiB

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 3.7 KiB