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
1
vote
1answer
12 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
20 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
10 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
81 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
56 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
22 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
29 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
25 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
39 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
15 views

GuassinaNB parital fit not working properly

I'm trying to make a partial fitting with GuassianNB here's small snippet of my code ...
1
vote
1answer
33 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 ...
0
votes
1answer
262 views

Find the top n features from feature set using absolute values of `feature_log_prob_ ` parameter of `MultinomialNB`

I am working on Donors choose dataset and have converted categorical, numerical and text features into vectors. I want to find the top 20 features from my 5095 features using absolute values of ...
2
votes
0answers
22 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
45 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
24 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
29 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
43 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
19 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
38 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
24 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(...
1
vote
1answer
247 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
61 views
1
vote
0answers
36 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
12 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
55 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
131 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 ...
0
votes
0answers
40 views

How to reduce / avoid false predictions with sklearn and MultinomialNB?

I'm using sklearn to predict product groups from product titles. That is working very well, if the titles are similar to the ones I labeled. Simplified example: ...
0
votes
0answers
25 views

Cannot explain Naive Bayes prediction on toy data

I tested Naive Bayes from sklearn on the toy data from Tom Mitchell's book Machine Learning. The results are unexpected. The very first instance should be classified as "No" according to the ...
4
votes
1answer
252 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
191 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
59 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
35 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
348 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 ...
2
votes
1answer
22 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" "...
0
votes
1answer
62 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 ...
1
vote
1answer
208 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: ...
3
votes
2answers
285 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, ...
4
votes
1answer
1k 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 ...
1
vote
3answers
187 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 ...
1
vote
2answers
57 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{...
3
votes
2answers
653 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?
3
votes
2answers
428 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 ...
1
vote
0answers
35 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 ...
1
vote
0answers
100 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 ...
5
votes
4answers
188 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: ...
1
vote
0answers
148 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 ...
0
votes
1answer
1k 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 ...