Naive Bayes is a popular (baseline) method for text-classification.
Questions tagged [naivebayes]
1035 questions
575
votes
5 answers
A simple explanation of Naive Bayes Classification
I am finding it hard to understand the process of Naive Bayes, and I was wondering if someone could explain it with a simple step by step process in English. I understand it takes comparisons by times occurred as a probability, but I have no idea…

Aeonitis
- 5,887
- 3
- 14
- 8
72
votes
6 answers
Ways to improve the accuracy of a Naive Bayes Classifier?
I am using a Naive Bayes Classifier to categorize several thousand documents into 30 different categories. I have implemented a Naive Bayes Classifier, and with some feature selection (mostly filtering useless words), I've gotten about a 30% test…

wmute
- 1,581
- 1
- 10
- 17
49
votes
3 answers
Save Naive Bayes Trained Classifier in NLTK
I'm slightly confused in regard to how I save a trained classifier. As in, re-training a classifier each time I want to use it is obviously really bad and slow, how do I save it and the load it again when I need it? Code is below, thanks in advance…
user179169
37
votes
5 answers
34
votes
3 answers
Classifying Documents into Categories
I've got about 300k documents stored in a Postgres database that are tagged with topic categories (there are about 150 categories in total). I have another 150k documents that don't yet have categories. I'm trying to find the best way to…

erikcw
- 10,787
- 15
- 58
- 75
31
votes
3 answers
What is the difference between a Bayesian network and a naive Bayes classifier?
What is the difference between a Bayesian network and a Naive Bayes classifier? I noticed one is just implemented in Matlab as classify the other has an entire net toolbox.
If you could explain in your answer which one is more likely to provide a…

G Gr
- 6,030
- 20
- 91
- 184
30
votes
5 answers
How to use the a k-fold cross validation in scikit with naive bayes classifier and NLTK
I have a small corpus and I want to calculate the accuracy of naive Bayes classifier using 10-fold cross validation, how can do it.

user2284345
- 501
- 2
- 5
- 9
29
votes
6 answers
Object Oriented Bayesian Spam Filtering?
I was wondering if there is any good and clean object-oriented programming (OOP) implementation of Bayesian filtering for spam and text classification? This is just for learning purposes.

gyurisc
- 11,234
- 16
- 68
- 102
24
votes
3 answers
Implementing Bag-of-Words Naive-Bayes classifier in NLTK
I basically have the same question as this guy.. The example in the NLTK book for the Naive Bayes classifier considers only whether a word occurs in a document as a feature.. it doesn't consider the frequency of the words as the feature to look at…

Ben G
- 26,091
- 34
- 103
- 170
23
votes
2 answers
How can I use sklearn.naive_bayes with (multiple) categorical features?
I want to learn a Naive Bayes model for a problem where the class is boolean. Some of the features are boolean, but other features are categorical and can take on a small number of values (~5).
If all my features were boolean then I would want to…

Ned Ruggeri
- 1,058
- 2
- 8
- 13
22
votes
6 answers
Any Naive Bayesian Classifier in python?
I have tried the Orange Framework for Naive Bayesian classification.
The methods are extremely unintuitive, and the documentation is extremely unorganized. Does anyone here have another framework to recommend?
I use mostly NaiveBayesian for…

disappearedng
- 493
- 1
- 7
- 12
18
votes
4 answers
How to tune GaussianNB?
Trying to fit data with GaussianNB() gives me low accuracy score.
I'd like to try Grid Search, but it seems that parameters sigma and theta cannot be set. Is there anyway to tune GausssianNB?

vlad
- 771
- 2
- 10
- 21
17
votes
4 answers
How to get feature Importance in naive bayes?
I have a dataset of reviews which has a class label of positive/negative. I am applying Naive Bayes to that reviews dataset. Firstly, I am converting into Bag of words. Here sorted_data['Text'] is reviews and final_counts is a sparse…

merkle
- 1,585
- 4
- 18
- 33
17
votes
3 answers
is it possible Apply PCA on any Text Classification?
I'm trying a classification with python. I'm using Naive Bayes MultinomialNB classifier for the web pages (Retrieving data form web to text , later I classify this text: web classification).
Now, I'm trying to apply PCA on this data, but python is…

zer03
- 325
- 1
- 4
- 15
16
votes
3 answers
how to use tf-idf with Naive Bayes?
As per my search regarding the query, that I am posting here, I have got many links which propose solution but haven't mentioned exactly how this is to be done. I have explored, for example, the following links :
Link 1
Link 2
Link 3
Link 4
etc.…

POOJA GUPTA
- 2,295
- 7
- 32
- 60