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
0answers
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 ...
1
vote
0answers
8 views

how convert feature_log_prob_ to exponential feature importance for BernoulliNB

I am using BernoulliNB classification for problem ...
1
vote
1answer
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 ...
1
vote
1answer
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 ...
1
vote
1answer
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 ...
0
votes
1answer
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 ...
1
vote
0answers
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 ...
1
vote
1answer
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 ...
0
votes
1answer
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: ...
1
vote
1answer
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:...
0
votes
1answer
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 ...
-1
votes
1answer
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. ...
0
votes
1answer
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 ...
0
votes
1answer
81 views
1
vote
2answers
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 ...
0
votes
1answer
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 ...
0
votes
0answers
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 (...
1
vote
1answer
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 ...
2
votes
1answer
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 ...
0
votes
0answers
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 ...
0
votes
1answer
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 ...
2
votes
1answer
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 ...
2
votes
1answer
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 ...
2
votes
1answer
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 ...
0
votes
1answer
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: <...
1
vote
1answer
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 ...
3
votes
1answer
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 ...
2
votes
0answers
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 ...
1
vote
1answer
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 ...
2
votes
0answers
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 ...
4
votes
1answer
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 ...
2
votes
1answer
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 ...
0
votes
1answer
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 ...
1
vote
1answer
55 views

Improving the performace of the Naive Bayes classifier by decorrelating the data

I was wondering if it is possible to improve the performance of the Naïve Bayes classifier by decorrelating the data. The Naïve Bayes assumes conditional independence of the features given some class $...
0
votes
0answers
21 views

How to solve a supervised learning problem with a generative model?

Is there a framework to do supervised task in generative model fashion? i.e. modelling p(x,y) rather than p(y|x) as in discriminative models. When I look at generative models, they all revolve ...
0
votes
1answer
41 views

Genetic algorithms: what connection to support vector machine / naive bayes

I found the following list of seven classifiers: Linear Classifiers: Logistic Regression, Naive Bayes Classifier Nearest Neighbor Support Vector Machines Decision Trees Boosted Trees Random ...
0
votes
0answers
39 views

How to intrepret accuracy vs alpha value and fscore vs alpha value graph for naive bayes based spam classifier?

I wrote a program for naive Bayes based spam classifier where alpha - 2^i(i ranging from -5 to 0) is the smoothening parameter. I plotted the training/test accuracy vs alpha and training/test fscore ...
0
votes
0answers
17 views

How to build a 2-d bayes classifier

I'm working on a 2-d bayes classifier and I'm a little confused on how to start exactly. My attribute space is 2-d. There are 3 classes. The data is assumed to be normally distributed. p(x | y1): P(...
2
votes
1answer
409 views

Naive Bayes for Categorical Features (Non Binary)

How do i use Naive Bayes Classifier (Using sklearn) for a Dataset considering that my feature set is categorical, ie more than 2 categories per feature are present. I've looked everywhere, some ...
0
votes
1answer
86 views
1
vote
0answers
38 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 ...
0
votes
0answers
14 views

What is to be done when PDFs are not Gaussian/Normal in Naive Bayes Classifier

While analyzing the data for a given problem set, I came across a few distributions which are not Gaussian in nature. They are not even uniform or Gamma distributions(so that I can write a function, ...
0
votes
0answers
13 views

Which distribution should I use for Naive Bayes algorithm(Gaussian or Rayleigh)? What to do with categorical data?

I am predicting whether credit card application of an individual would be approved or not given his/her credentials. I have the following dataset: The variable descriptions are as follows: I need ...
1
vote
1answer
60 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. ...
1
vote
1answer
178 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 ...
4
votes
1answer
384 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: ...
0
votes
1answer
304 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(...
1
vote
1answer
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 ...
1
vote
1answer
45 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 ...
1
vote
3answers
439 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 ...