# Questions tagged [naive-bayes-classifier]

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

145 questions
Filter by
Sorted by
Tagged with
8 views

### How to use a Multinomial Naive Bayes Classifier on different sets of data?

I am working on a sentiment analysis project involving tweets. I used a Kaggle dataset to train my model for sentiment analysis and want to use that trained model to predict the sentiment on an ...
8 views

### how convert feature_log_prob_ to exponential feature importance for BernoulliNB

I am using BernoulliNB classification for problem ...
16 views

### Why do we add “αd” to N in Laplace Smoothing?

I just started to learn Naive Bayes algorithm. Then I learned to use Laplace smoothing to avoid getting probability of zero. I understand the purpose of using it, but, in the expression of Laplace ...
51 views

### Naive Bayes always predicting the same label

I have been trying to write a naive bayes classifier from scratch that is supposed to predict the class label of the nominal car.arff dataset. However the classifier always predicts the most common ...
41 views

### How Calculate Effect (percentage) label of the input variables on the output variable by BernoulliNB

a description problem below. I have 10 words like X1 , X2 , X3 , ... , X10 and three Label like short , long , hold. My problem is that how calculate Effect (percentage) label of the input variables ...
27 views

### Naive Bayes vs Full Bayes model classifiers

I have a hard time to understand when Naive Bayes works better than Full Bayes. In general, i know that naive bayes does the assumption that features are independent given the class. However, if ...
22 views

### Handling multiple data types in Naive Base

I was studying about NB Classifier and it came out to me that i can use Bernoulli NB or Multinomial NB for categorical variables ...
26 views

### Probability of Gaussian Naive Bayes

How would I go about attaching a probability to the prediction outputted by a Gaussian Naive Bayes model ? I'm asking because the predict_proba function U can use with sklearn's Gaussian Naive Bayes ...
18 views

### Is my bayes classification right or meaningful?

I have this dataset and I am learning about Bayes Classifier. After data cleaning, I have tried to use bayes classifier on it. I used R with this code: ...
15 views

### How does the Naive Bayes algorithm function effectively as a classifier, despite the assumptions of conditional indpendence and bag of words?

Naive Bayes algorithm used for text classification relies on 2 assumptions to make it computationally speedy: Bag of Words assumption: the position of words is not considered Conditional Independence:...
36 views

### Suspiciously low False Positive rate with Naive Bayes Classifier?

I am performing phishing URL classification, and I am comparing several ML classifiers on a balanced 2-class data-set (legitimate URL, phishy URL). The ensemble and boosting classifiers such as ...
20 views

### How to increase a low recall value?

I am dealing with a HR Attrition Dataset which is highly unbalanced. I used Balancing technique like SMOTE to generate synthetic data and then used Gaussian Naive Bayes to Classify the Attrition. ...
23 views

### Text classification analysis based on similarity

I have been reading a lot of literature regarding text classification and different approaches/models, especially using Python language, but probably I am still missing something on how to build the ...
81 views

...
508 views

### Hyper-parameter tuning of NaiveBayes Classier

I'm fairly new to machine learning and I'm aware of the concept of hyper-parameters tuning of classifiers, and I've come across a couple of examples of this technique. However, I'm trying to use ...
36 views

### Classification - get some label value to check how close to another class (Python)

I am doing text classification in python with 3 alghoritms: kNN, Naive Bayes and SVM. I have 3 classes - easy, medium and hard. The accuracy is quite fine. Is there a way to check for new text its ...
14 views

### How to distinguish Multivariate Bernoulli Distribution from Binomial Distribution,Multinoulli distribution,Multinomial distribution?

Ok While studying naive Bayes I came across this question and from the accepted answer I reach to this blog. While reading this blog I got a clear idea of how Bernoulli distribution turns to (...
140 views

### Can you use two different datasets as train and test sets with countVectorizer and test_train_split?

So I managed to run my code on a combination of train data and validation data, but now I need to create a text file that contains the predictions for the test data and I just don't understand how. Is ...
32 views

### Kohen Kappa Coefficient of Naive Bayes with 62% overall accuracy is better than Logistic Regression with 98% accuracy?

I have been trying to evaluate my models used on fire systems dataset with a huge imbalance in the dataset. Most models failed to predict any true positives correctly however naive Bayes managed to do ...
18 views

### Is it possible to plot a ROC for a multi class naive bayes?

I'm trying to plot a ROC curve for a multilabel Bayes Naive dataset with roughly 30 different classes. In doing the confusion matrix, it is immediately clear the results, but this attempt is for ...
109 views

### How to compute denominator in Naive Bayes?

Suppose we have class C_k and input feature vector x in dataset How to calculate probability ...
16 views

### How to calculate probability of non independence using bayes theorem?

i looked into one of the post about naive bayes calulation of naive part Predit the class label for instance (A=1,B=2,C=2) using naive Bayes classifcation. Let C1 be class 1 and C2 be class 2. For ...
66 views

### why naive is needed in Naive Bayes ,what happens if naive is not included in Bayes theorem?

Im trying to understand why naive is needed in Naive Bayes and everyone says Naive Bayes assumes the input features (predictors) are not correlated hence they are not dependent on each other . i want ...
27 views

### What is the “learning” step in Gaussian Naive Bayes classification?

For conditionally independent features $f_i$, Naive Bayes Classification gives me the classifier $Classifier(f) := \arg \max_{k} P(C=k) · ∏^n_{i=1} P(f_i|C=k)$ for classes $k$. I understand that ...
38 views

### Class asks me to give self for Naive Bayes Model python

I try to use the following code but when I try to use fit function with my X_train and y_train, I get the following error: <...
29 views

### Predicting a final exam score from arbitrary set of practice exams

I posed this question to math.stackexchange without response, and feel it is better suited here. I am writing an application to predict a final exam score given at least one tuple, where the tuple ...
41 views

### What does these points mean in Naive Bayes?

I have two concept related questions related to Naïve Bayes. Naïve Bayes is robust to irrelevant features. What does this mean? Can anyone give an example how does the irrelevant features cancels out ...
19 views

### GuassianNB partial fit not working properly

I'm trying to make a partial fitting with GuassianNB here's small snippet of my code ...
37 views

### Consider ratings as sentiment labels?

Beginner here! I have a dataset, with reviews of a product as text, ratings for the product. My previous motive was to use Naive Bayes classifier for sentiment analysis. But my data doesn't have the ...
27 views

### R train(method=“naive_bayes”) and naiveBayes() very different performance

I am an R novice and having some difficulty. I was hoping R would be a good (flexible, easy) way to do machine learning of textual data. A few years ago, I wrote a naive Bayesian classifier (from ...
54 views

### Naive Bayes implementation: why Laplace smoothing is different from theory?

Let's have a Naive Bayes Bernoulli classifier with $n_C$ classes and $n_F$ features. According to the formula in here and here and almost every theory book I could see, Laplacian smoothing means that ...
30 views

### Attitude to text mining and preparing tokens, irrelevant words, low accuracy

For purpose of quite big project I am doing a text mining on some documents. My steps are quite common: All to lower case Tokenization Stop list and stop words Lemmatizaton Stemming Some other ...
31 views

### Naive Bayes / SVM classifiation - min. number of records (Python)

I am doing text classification with Python. I have around 120 records with 2 columns: text class I tokenize, stem and lematize the words, I also did some of my own text preprocessing. When I run the ...
55 views

62 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 ...