kopia lustrzana https://github.com/animator/learn-python
Merge remote-tracking branch 'origin/main'
rodzic
ccc3f025bb
commit
631528e334
|
@ -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:
|
||||
|
||||

|
||||
###### Normal 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:
|
||||
|
@ -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:
|
||||
|
||||

|
||||
$$ 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)
|
||||
$$
|
||||
|
|
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 |
Ładowanie…
Reference in New Issue