Skip to main content

Questions tagged [naive-bayes-classifier]

Naive Bayes classifiers makes the naive assumption that the features are independent. They make use of Bayes theorem.

Filter by
Sorted by
Tagged with
0 votes
1 answer
514 views

Multinomial Naive bayes giving wrong result

...
bhanu raja's user avatar
1 vote
0 answers
51 views

Binary classifier on imbalanced dataset yields weird PR curve

I have a dataset with ~6M points, 9 features and two classes. The minority class represents just under 2% of the data. The data is first divided into 100 batches and a different classifier is trained ...
Seb's user avatar
  • 111
1 vote
1 answer
82 views

In Naive Bayes classifier how is P(sneezing,builder|flu) = P(sneezing|flu)P(builder|flu)?

Please refer to this literature: According to Naive Bayes classification algorithm: $P(sneezing,builder|flu) = P(sneezing|flu)P(builder|flu) $ where sneezing and builder are independent events. ...
Soumee's user avatar
  • 113
2 votes
1 answer
479 views

Naive Bayes and Support Vector Machine (NBSVM) Classification

I am relatively new to datascience and have a question about NBSVM. I have a two class problem and text data (headlines from the newspaper). I want to use NBSVM to predict whether a headline has the ...
OldTimeRambler's user avatar
4 votes
1 answer
1k views

Training textblob with 16k rows of labeled data won't work (only few are working)

I've got labeled data in a csv which looks like: title,type Women Jacket A,Clothes Mens Running Shoes B,Shoes Children backpack,Bags and a script: ...
Chris's user avatar
  • 183
1 vote
1 answer
651 views

naive bayes classifier for non-binary feature values

Given a training set $\{{(x^{(i)},y^{(i)});i=\{1,...,m}\}\}$ where $x^{(i)}\in\{1,2,...s\}^n$ and $y^{(i)}\in{0,1}$. We model the label as a biased coin with $\theta_0=P(y^{(i)}=0)$ and $1-\theta_0=P(...
IrCa's user avatar
  • 163
1 vote
1 answer
78 views

Train Naive Based Classifier

For (a) I have calculated $P(G)=\frac{5}{8}$, $P(O|G)=\frac{2}{5}$, $P(B|G)=\frac{1}{5}$, $P(C|G)=\frac{4}{5}$, and $P(A|G)=\frac{4}{5}$. Now how do I calculate the maximum likelihood estimate of ...
IrCa's user avatar
  • 163
1 vote
1 answer
144 views

Reversing Naive Bayes to find extreme points of data sets

I'd like to know if this is a sensible idea and if there exist any already formed methods to do this (I'm new to the data science area). Essentially, I have used Naive Bayes to accurately classify ...
Dan Savage's user avatar
1 vote
3 answers
923 views

Why did Logistic regression perform better than svm? [closed]

I have a data set of movies and their subtitles.My task is to classify them based on their ratings-[R,NR,PG,PG-13,G]. I have tried different ML algorithms and found that Logistic regression out ...
Harshita Vemula's user avatar
2 votes
1 answer
26 views

Looking for other opinions on approach to classification problem

I'm looking to implement an "opt-out" filter for my company. The input is short, text-message style messages. A few examples of opt-out messages are: "remove me from your list" "remove from list" "...
wheresmycookie's user avatar
1 vote
1 answer
323 views

Very low probability in naive Bayes classifier 1

I have some training data (TRAIN) and some test data (TEST). Each row of each table contains an observed class (X) and some columns of binary (Y). I'm using a Python script that is intended to predict ...
R. Cox's user avatar
  • 121
1 vote
1 answer
1k views

Naive Bayes Classifier - Discriminant Function

To classify my samples, I decided to use Naive Bayes classifier, but I coded it, not used built-in library functions. If I use this equality, I obtain nice classification accuracy: ...
Goktug's user avatar
  • 113
3 votes
2 answers
1k views

Avoiding the zero problem

I have a dataset and I'm trying to predict the label for my sample but I couldn't map it since that case never showed here is my sample (I'm using naïve Bayesian method) X=(Age=middle, has_job=false, ...
nix_'s user avatar
  • 31
12 votes
1 answer
7k views

How does Naive Bayes classifier work for continuous variables?

I know that for categorical features we just calculate the prior and likelihood probability assuming conditional independence between the features. How does it work for continuous variables? How can ...
Anjith's user avatar
  • 951
2 votes
3 answers
2k views

Classifier for large number of labels

I have a merchants dataset with 800,000 samples and 18,000 labels. Each sample is associated with a single label and the labels are independent. An example sample looks like ...
Oliver Searle-Barnes's user avatar
1 vote
2 answers
97 views

Naive Bayes Classifier

Could someone please explain to me how and why can we go from equation $4.3$ to equation $4.4$: $$\hat{c}= \arg\max_{c \in \mathcal{C}}P(c|d) = \arg\max_{c \in \mathcal{C}}\frac{P(d|c)P(c)}{P(d)}\tag{...
Stefan Radonjic's user avatar
6 votes
2 answers
4k views

Effect of outliers on Naive Bayes

Are Naive Bayes algorithms affected by outliers in the data? Suppose there is a data set, does one need to remove outliers before applying Naive Bayes?
James Smith's user avatar
3 votes
2 answers
817 views

How does the naive Bayes classifier handle missing data in testing?

Assume that a classier has been trained already (no missing training data), but a prediction has been requested based on an observation that does not include every feature. How can we handle this ...
Saikat Mondal's user avatar
1 vote
0 answers
53 views

Dealing with missing n-grams in Naive Bayes classifier

I am doing sentiment analysis on code-mixed text data, i.e English used interchangeably with another language. The dataset I currently have is very small in size, approx 3.5k samples. I am sure that ...
PARTH SURESH's user avatar
1 vote
0 answers
227 views

My naive (ha!) Gaussian Naive Bayes classifier is too slow

I am trying to build a film review classifier where I determine if a given review is positive or negative (w/ Python). I'm trying to avoid any other ML libraries so that I can better understand the ...
Ayumu Kasugano's user avatar
5 votes
4 answers
282 views

Is the prediction algorithm absolutely the same for all linear classifiers?

Is the prediction algorithm absolutely the same for all linear classifiers and linear regression algorithms? As known, any linear classifier can be described as: ...
Alex's user avatar
  • 649
1 vote
0 answers
319 views

One class naive bayes

I have to build one class naive Bayes method for outlier detection based on the likelihood probabilities. I tried to create it using sklearn GaussianNB but it is for multiclass classification. Is ...
shaifali Gupta's user avatar
1 vote
1 answer
5k views

How to calculate Accuracy, Precision, Recall and F1 score based on predict_proba matrix?

I found this link that defines Accuracy, Precision, Recall and ...
hyTuev's user avatar
  • 277
1 vote
1 answer
756 views

Naive bayes, all of the elements in predict_proba output matrix are less than 0.5

I've created a MultinomialNB classifier model by which I'm trying to label some test texts: ...
hyTuev's user avatar
  • 277
1 vote
1 answer
767 views

How to measure uncertainty and prediction errors for a naive Bayesian Classifier?

I have a small dataset of 30 rows and 5 columns (4 features and 1 class). The classifier is used to give the likelihood of occurrence of an incident. thus, the class variable gives the probability of ...
GYSHIDO's user avatar
  • 133
1 vote
1 answer
949 views

test accuracy of text classification is too less

I have a data set of movies and their subtitles. My task is to classify them based on their ratings - [R, NR, PG, PG-13, G]. I have 13 examples for each class. I preprocessed the subtitles in the ...
Harshita Vemula's user avatar
2 votes
0 answers
410 views

Sentiment Analysis Naive Bayes vs Logistic Regression [closed]

I am doing some sentiment analysis on Twitter data, and I wanted to compare a Naive Bayes Classifier and a Logistic Regression classifier as to if their performance is affected by spell checking the ...
Paschalis's user avatar
2 votes
1 answer
1k views

Collinearity and Outlier Removal

I am playing with a credit fraud detection dataset at Kaggle. An imbalanced dataset with about 0.1% of fraud transaction. The features are 28 PCs out from a PCA exercise done by the data publisher + ...
Harris's user avatar
  • 21
1 vote
1 answer
1k views

How can one use a validation set to reduce overfitting Naive Bayes?

What is the correct procedure for using a validation set to reduce overfitting? Say I split the data 80:10:10 (training: validation:test). I train on the training set then get 90% accuracy. I apply ...
Vykta Wakandigara's user avatar
6 votes
2 answers
3k views

How to deal with missing data for Bernoulli Naive Bayes?

I am dealing with a dataset of categorical data that looks like this: ...
Chuck's user avatar
  • 161
1 vote
0 answers
311 views

Laplacian smoothing on Class Probability (Naive bayes)

I am implementing a Naive Bayes classifier in Python from scratch. The instructions I have asks that I incorporate Laplacian Smoothing with K=1 to computing the probability that a message belongs to a ...
ProgrammingRookie's user avatar
2 votes
1 answer
803 views

Predict the corresponding value in one column using a list of values found in another column

Please have a look at this link. This was a question I asked few months back and after some suggestions and exploring I was able to successfully use TFIDF along with MultinomialNB classifier to pretty ...
Sudhi's user avatar
  • 171
2 votes
0 answers
32 views

Conditional Probabilities on store data

I have data on store level purchases, Panel-level purchases and demographic information of loyalty cards. In the store purchases information, the data consists of a product code which can be assigned ...
user113156's user avatar
7 votes
3 answers
5k views

Why does the naive bayes algorithm make the naive assumption that features are independent to each other?

Naive Bayes is called naive because it makes the naive assumption that features have zero correlation with each other. They are independent of each other. Why does ...
user781486's user avatar
  • 1,445
1 vote
1 answer
729 views

Is there an API to extract questions and labels from yahoo answers?

I want to work on a ML project which involves the family and relationship category from yahoo answers. I want to extract questions from yahoo answers (only the title) with the label as the category it ...
Rishabh Sharma's user avatar
0 votes
1 answer
57 views

Bayes Classifier as a general model

Is it correct to argue that the Bayer Classifier is an ideal classifier, which is taken as a model by every other implemented classifier?
Koinos's user avatar
  • 241
5 votes
1 answer
570 views

How are ANN's, RNN's related to logistic regression and CRF's?

This question is about placing the classes of neural networks in perspective to other models. In "An Introduction to Conditional Random Fields" by Sutton and McCallum, the following figure is ...
Simon's user avatar
  • 209
4 votes
2 answers
1k views

Naive Bayes for SA in Scikit Learn - how does it work

Okay so i scrape data from the web on movie reviews. I also have already got my own 'dictionary' or 'lexicon' with words and their labels (1-poor, 2-ok, 3-good, 4-very good, 5-excellent). SO the ...
Chakra's user avatar
  • 143
2 votes
1 answer
200 views

Doubt in interpretation of Bernoulli Naive Baeyes Algorithm

We say Bernoulli naive bayes assumes gaussian distribution of all continuous features. What happens if I have categorical features also in the dataset? What type of prior transformation in data is ...
Sahil Chaturvedi's user avatar
6 votes
4 answers
1k views

Naive Bayes Multinomial, independence assumption misunderstood

This is embarrassing but I think I miss understand something. In multinomial distribution, "while the trials are independent, their outcomes X are dependent because they must be summed to n." wiki ...
Hanan Shteingart's user avatar
3 votes
2 answers
221 views

Algorithms and tools for ranking text as a job description

We're working on a ranking texts by degree of the similarity to vacancies. We have 4-year data set (≈1M texts) of custom search feeds from social network. We also have vacancies (≈30K) manually ...
mcmimik's user avatar
  • 33
1 vote
1 answer
75 views

Optimize F-Score only for certain classes, disregard other classes

I have a labeled dataset of product reviews where the label is a rating between 1 and 5 and the review is just text. I use a simple naive Bayes classifier (sklearn) to try to predict a rating given a ...
Patric's user avatar
  • 111
1 vote
0 answers
55 views

Processed data cannot build Naive Bayes Classifier model

Having preprocessed data using weka supervised cfssubseteval forward and backward selection, the decision tree model builds and makes prediction well, but naive Bayes do not recognize the same Arff ...
user9499636's user avatar
2 votes
1 answer
4k views

How to improve Naive Bayes?

I am solving a problem that address this question "What are the Actions that lead to high or low score?" I have the following Data that consist of text and score , I want to derive the words or ...
sara's user avatar
  • 481
2 votes
1 answer
555 views

Why is spam detection a classification problem and not a class modelling problem

Trying to get my feet wet with machine learning on text. The most common dataset I've seen in this space is the sms dataset with classes ham and spam. And the most common and successful approach ...
Thalish Sajeed's user avatar
5 votes
1 answer
243 views

When to use Multinomial Naive Bayes?

I am working on a text classification problem, and plan on using Naive Bayes based model. In which cases should I consider using Multinomial Naive Bayes?
Jimmy Collins's user avatar
1 vote
1 answer
40 views

Why do classes with fewer words have higher probability?

Given that I have a word that does not occur in any of my documents: newword, and given that I have two classes: class1 and <...
almanegra's user avatar
  • 111
3 votes
1 answer
10k views

How does ,the Mutlinomial Bayes's alpha parameter, affects the text classification task?

I would like to know how the alpha parameter, in Multinomial Bayes, affects the text classification task. I know that this parameter is correlated to the algorithm'...
Simone's user avatar
  • 715
1 vote
0 answers
35 views

Find words related to high or low score

I am working on text analysis problem. Person X can log in his goals and his actions to achieve his goal. Also their score is calculated based on some formula to measure progress of the goal. For ...
sara's user avatar
  • 481
0 votes
1 answer
67 views

Should I remove features that occur very rarely to build a model?

I am trying ML techniques in language processing. I have got 3000 short texts and I extract features(words and phrases) from all of them and build a vocabulary. I end up with 6000 od features and most ...
Mateusz's user avatar
  • 123