Naive Bayes is a popular (baseline) method for text-classification.
Questions tagged [naivebayes]
1035 questions
16
votes
2 answers
Naive Bayes For Regression
I was wondering, if I can apply naive bayes, to a regression problem and how will it be done. I have 4096 image features and 384 text features and, it won't be very bad if I assume independence between them. Can anyone tell me how to proceed?

Deven
- 617
- 2
- 6
- 20
15
votes
7 answers
How to find out the accuracy?
I've wondered if there is a function in sklearn which corresponds to the accuracy(difference between actual and predicted data) and how to print it out?
from sklearn import datasets
iris = datasets.load_iris()
from sklearn.naive_bayes import…

Andrew 76868
- 394
- 1
- 4
- 14
13
votes
1 answer
Pseudo-code for Network-only-bayes-classifier
I am trying to implement a classification toolkit for univariate network data using igraph and python.
However, my question is actually more of an algorithms question in relational classification area instead of programming.
I am following…

Sait
- 19,045
- 18
- 72
- 99
13
votes
1 answer
Naive Bayesian for Topic detection using "Bag of Words" approach
I am trying to implement a naive bayseian approach to find the topic of a given document or stream of words. Is there are Naive Bayesian approach that i might be able to look up for this ?
Also, i am trying to improve my dictionary as i go along.…

AlgoMan
- 2,785
- 6
- 34
- 40
12
votes
3 answers
The code "df.dropna" in python erases my entire data frame, what is wrong with my code?
I want to drop all NaN variables in one of my columns but when I use df.dropna(axis=0, inplace=True) it erases my entire dataframe. Why is this happening?
I've used both df.dropna and df.dropna(axis=0, inplace=True) and it doesn't work to remove…

Piper Ramirez
- 373
- 1
- 3
- 11
11
votes
3 answers
Multinomial Naive Bayes parameter alpha setting? scikit-learn
Does any one know how to set parameter of alpha when doing naive bayes classification?
E.g. I used bag of words firstly to build the feature matrix and each cell of matrix is counts of words, and then I used tf(term frequency) to normalized the…

HAO CHEN
- 1,209
- 3
- 18
- 32
11
votes
3 answers
TextBlob NaiveBayesAnalyzer extremely slow (compared to Pattern)
I'm using TextBlob for python to do some sentiment analysis on tweets. The default analyzer in TextBlob is the PatternAnalyzer which works resonably well and is appreciably fast.
sent = TextBlob(tweet.decode('utf-8')).sentiment
I have now tried to…

Matt M.
- 529
- 5
- 16
11
votes
8 answers
Understanding Bayes' Theorem
I'm working on an implementation of a Naive Bayes Classifier. Programming Collective Intelligence introduces this subject by describing Bayes Theorem as:
Pr(A | B) = Pr(B | A) x Pr(A)/Pr(B)
As well as a specific example relevant to document…

benmcredmond
- 1,702
- 2
- 15
- 22
10
votes
3 answers
Orange vs NLTK for Content Classification in Python
We need a content classification module. Bayesian classifier seems to be what I am looking for. Should we go for Orange or NLTK ?

philgo20
- 6,337
- 6
- 34
- 43
10
votes
2 answers
Naive Bayes without Naive assumption
I'm trying to understand why the naive Bayes classifier is linearly scalable with the number of features, in comparison to the same idea without the naive assumption. I understand how the classifier works and what's so "naive" about it. I'm unclear…

dkv
- 6,602
- 10
- 34
- 54
9
votes
3 answers
Mean of empty slice and Degrees of freedom <=0
This code below is suppose to run a bayes classifier for a full covariance gaussian (http://courses.ee.sun.ac.za/Pattern_Recognition_813/lectures/lecture03/node2.html), but I get two errors when I run the code. They are:
RuntimeWarning: Mean of…

user3002936
- 119
- 1
- 1
- 5
9
votes
1 answer
What is the issue in my calculation of Multivariate Kernel Estimation?
My intention is to find its class through Bayes Classifier Algorithm.
Suppose, the following training data describes heights, weights, and feet-lengths of various sexes
SEX HEIGHT(feet) WEIGHT (lbs) FOOT-SIZE (inches)
male 6 …

user366312
- 16,949
- 65
- 235
- 452
8
votes
1 answer
Linear Discriminant Analysis vs Naive Bayes
What are the advantages and disadvantages of LDA vs Naive Bayes in
terms of machine learning classification?
I know some of the differences like Naive Bayes assumes variables to be independent, while LDA assumes Gaussian class-conditional…

jon givony
- 197
- 2
- 3
- 9
8
votes
5 answers
Naive Bayes classifier and discriminant analysis accuracy is way off
So I have two methods of classification, Discriminant analysis diaglinear classification (naive Bayes) and the pure Naive Bayes classifier implemented in matlab, there are 23 classes in the entire dataset. The first method discriminant analysis:
%%…

G Gr
- 6,030
- 20
- 91
- 184
7
votes
3 answers
Store most informative features from NLTK NaiveBayesClassifier in a list
i am trying this Naive Bayes Classifier in python:
classifier = nltk.NaiveBayesClassifier.train(train_set)
print "Naive Bayes Accuracy " + str(nltk.classify.accuracy(classifier, test_set)*100)
classifier.show_most_informative_features(5)
i have the…

Sebastian Gomes
- 775
- 9
- 12