issues
search
param087
/
swiftML
Swift library for Machine Learning
Apache License 2.0
60
stars
8
forks
source link
Add Naive Bayes
#12
Closed
param087
closed
4 years ago
param087
commented
5 years ago
1. Bernoulli Naive Bayes Classifier -
BernoullilNB( alpha:1.0)
-
alpha
(Float) - Smoothing parameter.
API Methods -
fit(data: , labels: )
- Fit naive bayes classifier.
prediction(for: )
- Perform classification on input data.
predictLogProba(data: )
- Returns log probability of input data.
score(data: , labels: )
- Returns the mean accuracy.
References
https://en.wikipedia.org/wiki/Naive_Bayes_classifier
https://scikit-learn.org/stable/modules/generated/sklearn.naive_bayes.BernoulliNB.html
https://nlp.stanford.edu/IR-book/html/htmledition/the-bernoulli-model-1.html
2. Multinomial Naive Bayes Classifier -
MultinomialNB( alpha:1.0)
-
alpha
(Float) - Smoothing parameter.
API Methods -
fit(data: , labels: )
- Fit naive bayes classifier
prediction(for: )
- Perform classification on data.
predictLogProba(data: )
- Returns log probability of data.
score(data: , labels: )
- Returns the mean accuracy.
References
https://en.wikipedia.org/wiki/Naive_Bayes_classifier
https://scikit-learn.org/stable/modules/generated/sklearn.naive_bayes.MultinomialNB.htmll
https://nlp.stanford.edu/IR-book/html/htmledition/naive-bayes-text-classification-1.html
3. Gaussian Naive Bayes Classifier -
GaussianNB( )
-
API Methods -
fit(data: , labels: )
- Fit naive bayes classifier
prediction(for: )
- Perform classification on data.
prob(data: )
- Return gaussian probability in log.
predictLogProba(data: )
- Returns log probability of data.
score(data: ,labels: )
- Returns the mean accuracy.
References
https://en.wikipedia.org/wiki/Naive_Bayes_classifier
https://scikit-learn.org/stable/modules/generated/sklearn.naive_bayes.GaussianNB.html
1. Bernoulli Naive Bayes Classifier -
BernoullilNB( alpha:1.0) -
API Methods -
References
2. Multinomial Naive Bayes Classifier -
MultinomialNB( alpha:1.0) -
API Methods -
References
3. Gaussian Naive Bayes Classifier -
API Methods -
References