Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Naive Bayes Text Classification

Project Description

# Naive Bayes Text Classifier

Text classifier based on Naive Bayes.

## Instalation

$ pip install naive-bayes

## Usage example

from naivebayes import NaiveBayesTextClassifier

classifier = NaiveBayesTextClassifier(
classifier.train(train_docs, train_classes)
predicted_classes = classifier.classify(test_docs)

`NaiveBayesTextClassifier` is a simple wrapper around `scikit-learn` class `CountVectorizer`. You can put all arguments which support this class. For more information please check `scikit-learn` official documentation.

## More examples

Check examples at `examples` folder. Before run them, install requirements in this folder.

Clone repository from github

$ git clone
$ cd naive-bayes/examples
$ pip install -r requirements.txt

And run some example

### Usenet 20 newsgroup

$ python 20newsgroup

### Kaggle IMDB reviews competition

$ python imdb_reviews

Release History

This version
History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Hash SHA256 Hash Help Version File Type Upload Date
(1.8 kB) Copy SHA256 Hash SHA256
Source Apr 25, 2015

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting