https://github.com/freakwill/nb-combination
ensemble classifier with naive bayes combination
https://github.com/freakwill/nb-combination
bayes-classifier python scikit-learn
Last synced: about 1 month ago
JSON representation
ensemble classifier with naive bayes combination
- Host: GitHub
- URL: https://github.com/freakwill/nb-combination
- Owner: Freakwill
- License: mit
- Created: 2020-06-08T12:41:41.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-07-03T03:31:34.000Z (almost 4 years ago)
- Last Synced: 2025-01-26T12:44:23.397Z (over 1 year ago)
- Topics: bayes-classifier, python, scikit-learn
- Language: Python
- Size: 17.2 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nb-combination
ensemble classifier with naive bayes combination
The algorithm is implemented in `nb_comb.py`
## Download
Just download it from github.
## use
just run `script.py` and have a look at the source code.
## Example
```python
X=np.array([[1,2,3.1],[2,2,2.3],[1,1,1.1], [1,1,2.1]])
Y= [0,1,0,1]
from sklearn.naive_bayes import *
estimators = [('multinomial', MultinomialNB()), ('gauss', GaussianNB())]
model = NBAdditive(estimators)
model.fit(X, Y, inds=[[0,1], [2]])
print(model.predict(X))
```