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
4
votes
1answer
31 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
17 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
24 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
26 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
13 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
34 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
15 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
15 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
0answers
113 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
43 views
1
vote
0answers
31 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
13 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
10 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
51 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
78 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
34 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
24 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
129 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
134 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
47 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
28 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
205 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
51 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
119 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
180 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
764 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
101 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
49 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{...
2
votes
1answer
464 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
339 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
32 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
84 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
176 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
108 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
0answers
7 views

Identifying causation between content <> ad kpis

I have a bunch of content tagged with various types of content (e.g. political news, sports, opinion etc.) and a bunch of kpis related to ads placed next to this content (e.g click-throughs, purchases ...
0
votes
1answer
923 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 ...
0
votes
1answer
99 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: ...
1
vote
1answer
136 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 ...
1
vote
1answer
216 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 following ...
2
votes
0answers
255 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 ...
2
votes
1answer
666 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 + ...
0
votes
1answer
259 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 ...
2
votes
1answer
346 views

How to deal with missing data for Bernoulli Naive Bayes?

I am dealing with a dataset of categorical data that looks like this: ...
1
vote
0answers
210 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 ...
2
votes
1answer
64 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 ...
2
votes
0answers
28 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 ...
1
vote
0answers
64 views

Multiclass naive bays classification as probabilistic model

I have a model based on Naive-bays classifier (multinomial Naive bays) that i have fitted on data set with just one feature ( categorical observation) and a label : observation ; label funny ...
6
votes
3answers
953 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 ...
1
vote
1answer
211 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 ...