Questions tagged [naive-bayes]
A naive Bayes classifier is a simple probabilistic classifier based on applying Bayes' theorem with strong independence assumptions. A more descriptive term for the underlying probability model would be "independent feature model".
562
questions
0
votes
0answers
12 views
After I added Laplace Estimator to Naive Bayes [closed]
I'm using Navie Bayes algorithm to build a classifier as spam filter. Initially, I didn't use laplace estimator and got 98% accuracy. After I set laplace parameter to be 1, the prediction accuracy ...
1
vote
1answer
12 views
How do I quickly calculate a Bayes classifier?
With the data from this post I want to quickly answer the following exam question:
Given that it is rainy, not windy, the temperature is hot and humidity
is normal, should you play golf or not?
Show ...
0
votes
0answers
24 views
The probability is proportional to the probability that the message is normal?
I was watching this Youtube video on Naive Bayes. The creator begins by using the example of an email spam filter to illustrate how Naive Bayes works. At 5:47, the narrator says that, technically, the ...
0
votes
0answers
3 views
How to Choose Class for Naive Bayes Classifier with Same Posterior Probabilities?
For Naive Bayes classifier in multiple class, I know that we had to choose a class with the highest posterior probabilities. I'm doing project using Naive Bayes classifier method and when i calculate ...
0
votes
0answers
10 views
Why does using conditional random field avoid independence assumption
I am reading Daphne Koller's book on probabilistic graphical models under the topic of conditional random fields. One of the advantages in using CRF is that we can avoid modelling the correlations ...
2
votes
1answer
147 views
How is this a “Bayes classifier”?
I am currently studying the textbook Learning with kernels: support vector machines, regularization, optimization and beyond by Schölkopf and Smola. Chapter 1.2 A Simple Pattern Recognition Algorithm ...
0
votes
0answers
7 views
naive bayes classifier with Exponentially distributed likelihood with big parameter
Just for the practice of it, I'm trying to do a naive Bayes classifier for data which has exponential distribution for the likelihood function, i.e. $X_k=x|Y=1 \in Exp(\lambda_k)$ where $k = 1,..., p$ ...
0
votes
0answers
6 views
Should I normalize the data? [duplicate]
I have four int columns with two of them having a value in 10s, and the other two have it in 100s. Should I, for the ease of applying the following algorithms, normalise the data, or would it not have ...
4
votes
1answer
143 views
$\frac{P(x_1 \mid y, s = 1) \dots P(x_n \mid y, s = 1) P(y \mid s = 1)}{P(x \mid s = 1)}$ indicates that naive Bayes learners are global learners?
I am currently studying the paper Learning and Evaluating Classifiers under Sample Selection Bias by Bianca Zadrozny. In section 3. Learning under sample selection bias, the author says the following:
...
1
vote
1answer
24 views
Applying Bayes rule in the context of reinforcement learning [duplicate]
I was watching this video on reinforcement learning. At 1:28, it says following:
$$Pr(s'|a,z,s)=\frac{Pr(z|s',a,s)Pr(s'|a,s)}{Pr(z|a,s)}$$
I was unable to get how this was obtained. I pondered a bit ...
0
votes
0answers
15 views
In which cases GNB is worse than logistic regresion?
I am training and testing two models on the same dataset: a logistic regression and a gaussian naive bayes (sklearn's with the default parameters).
The dataset is the ...
0
votes
1answer
33 views
MLE and MAP with Naive Bayes
From what I understand, Naive Bayes classifies by doing:
$$
y \leftarrow argmax_{y_k}P(Y=y_k)\prod_{i}P(X_i|Y=y_k)
$$
There are two things there we need to know: $P(Y=y_k)$ and all the $P(X_i|Y=y_k)$
...
0
votes
0answers
13 views
Number of parameters to calculate in Naive Bayes with and without independence assumption
I am just getting started with trying to understand the theory behind Naive Bayes a bit.
$Y$ = boolean-valued rv
$X_i$ = boolean-valued rv (part of random vector $\vec{X}$).
From what I understand, we ...
1
vote
0answers
17 views
Applying Bayes for treating binary soft classification model output as marginal probabilities
Consider a soft classification model $f: x \to (0,1)$, with $Z = f(X)$.
Now say that the model evaluates in testing data yields, as shown in the figure below, the distributions conditioned on the true ...
1
vote
1answer
36 views
How can I handle null or missing values in a Naive Bayes classifer where all the predictor variables are categorical nominal
My data set has:
20 categorical nominal predictor variables, each variable has on
average 5 distinct possible values
1 dependent binary class variable to be predicted by the Naive Bayes classifier
...
0
votes
1answer
32 views
Bayes Classifier - Monte Carlo sampling
Assume a feature $x \in [0,2]$ and $3$ classes $\omega_i, \, i = 1,2,3$ with likelihood functions $p_1 = \frac12, p_2 = \frac34 x (2 - x), p_3 = \frac12 x $ and decision regions:
$$
\begin{align}
R_1 ...
1
vote
1answer
63 views
Bayes classifier expected classification error for multiclass case
Assume a feature $x \in [a,b]$ and two classes $\omega_1, \omega_2$ with prior probabilities $P(\omega_1), P(\omega_2)$ and likelihood functions $p(x | \omega_1), p(x | \omega_2)$. Then, the expected ...
0
votes
0answers
8 views
Feature engineering of closely related text
I am trying to do multi class classification of text. For many reasons I can't paste the data, atleast now in open.
The problem is there is a text of closely related subjects like Anatomy and ...
0
votes
0answers
16 views
How does sample_weights work in Naive Bayes?
I want to use the sample_weights parameter in sklearn Naive Bayes classification.
I have seen online that it can be used to balance data but I have also seen that it can be used to weight data with ...
3
votes
1answer
90 views
Naive question about Naive Bayes modeling
In Naive Bayes classifiers, one calculates a frequency table to determine a prediction. A classic example, one calculates the frequency table of words given the context of spam or ham. E.g. ...
0
votes
0answers
31 views
How does Naive Bayes treat a missing class
Fist of all, I am Naive Bayes virign so apologies if it sounds too naive but I couldnt find anything on the internet for this.
Somebody implemented Naive Bayes for us and I want to understand its ...
0
votes
0answers
16 views
How do I calculate the probability error given a conditional distribution and its prior?
Suppose you have a single feature x, with the following conditional distribution:
...
3
votes
0answers
88 views
Graphical representation of Bayes decision boundary
Here is my problem statement:
Let $X=(X_1,X_2)∈[0,1]×[0,1]$ and $Y∼Bernoulli(p=X_1⋅X_2)$. Plot the Bayes decision boundary ${(x1_,x_2):P(Y=1|X=(x_1,x_2))=0.5}$ and indicate the regions in $[0,1]×[0,1]$...
0
votes
0answers
12 views
What is the function of the denominator in the likelihood estimation equation (used in naïve bayes classifiers)?
I understand that the likelihood is calculated/estimated by looking at the number of instances where a certain feature and class occur together divided by the total instances of that class. However, I ...
2
votes
2answers
147 views
Why don't we estimate the prior in a Naive Bayes' classifier?
I'm currently studying the textbook Introduction to Machine Learning 4e (Ethem Alpaydin) the brush up on my ML basics and had a question regarding a part w.r.t. using the Naive Bayes' classifier in ...
1
vote
0answers
18 views
What are the classifiers that can be used for sequence data?
I've been going through the classifiers like Naive Bayes, Decision Tree etc. I've a sequence data like so
...
0
votes
0answers
15 views
Does Central Limit Theorem have anything to do with Bayesian Inference? [duplicate]
I am studying Central Limit Theorem and Bayesian Statistics and got a question that which or what part in Bayesian Statistics the concept of Central Limit Theorem is applied. If so, I'd like to know ...
0
votes
1answer
39 views
difference between Conditional Random Fields(CRF) and Naive Bayes
I am working through the course Probabilistic Graphical Models.
A CRF calculates the conditional probability distribution, i.e P(Y | X1, .., XN). The following picture shows an example how the CRF is ...
1
vote
1answer
25 views
is it possible to apply Glove with MultinomialNB?
When I try to do
mnb = MultinomialNB()
mnb.fit(train_glove_features, train_targ)
I get the below error:
ValueError: Input X must be non-negative
I do ...
0
votes
0answers
31 views
Do we ever take the log of a probability like we do with likelihoods?
I am trying to learn about naive Bayes by implementing a simple naive Bayes model to classify the titanic dataset (so a binary classification). To keep it simple for now I am just including the two ...
2
votes
1answer
25 views
Use different Naive Bayes classifiers to target different data
I am practicing using the Naive Bayes classifier to predict whether people get a stroke or not, but, I am confused with two classifiers. One is categorical Naive Bayes, another is Gaussian Naive Bayes....
1
vote
1answer
79 views
Does Gaussian Naive Bayes have paramter to be tuned
I am trying to implement the Gaussian Naive Bayes from a scikit-learn library. I know that the Naive Bayes is based on the Bayes' theorem which is defined in high level as:
...
0
votes
1answer
31 views
What classifier could predict spam/ham labels for SMS messages better than Naive Bayes?
I have 7000 SMS messages, 6000 ham, 1000 spam. Typical messages are:
...
1
vote
0answers
34 views
Bayes Theorem and Neural networks
For example, I have MNIST dataset and a trained neural network: input image and the output is a probability distribution over 10 classes.
I show image and prediction is: 5% for each class and 55% for ...
0
votes
0answers
12 views
What is the difference between the class v and the hypothesis h? Some dumb example needed
In this example, the labels are "no/yes" which are enough to perform a Naive Bayes.
But if i perform a Bayesian optimal classifier so P(v|x,D) = sum_h_of P(v|h,D) * P(h|D) with v the label ...
0
votes
0answers
11 views
Could someone guide me on how to obtain the general result of the percentage if the Principal components belong mostly to an open-eyed person?
Good morning.
Excuse me, I'm asking for advice on the following problem:
I generate the following Principal Components.
Principal components labeled 1 belong to the alpha waves of an open-eyed person ...
2
votes
0answers
20 views
How to prepare the training data for Support Vector Machine?
I'm currently doing some comparison of Naive Bayes Algorithm and Support Vector Machine classifying news to see each algorithm's accuracy.
I already know how to prepare the training data for Naive ...
0
votes
0answers
9 views
What goes wrong in linear regression if we assume a Naive Bayes model when features aren't necessarily independent?
In the notes I'm working through, it says that in low dimensional models, it's often the case that we cannot get away with assuming that features are uncorrelated/independent i.e. that we can't use ...
0
votes
0answers
16 views
Bayes Classifier example: is my work right? What does it mean?
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:
...
0
votes
1answer
27 views
Reduce dimensionality and classify EEG signals
Good morning, I am new to machine learning, if someone could recommend a book to reduce dimensions (PCA), and classify (Naive Bayes), the purpose is to classify EEG signals, I have already applied pre-...
0
votes
2answers
48 views
Naive Question: Naive Bayes vs Common Sense
Do you know the classical problem of sunny / rainy / overcast days and output yes / no the game will played. See the image below. Now the problem question is "Players will play if weather is sunny. Is ...
0
votes
0answers
20 views
Classification Models! How to chose? [duplicate]
I am trying to transition into the Data Science field and and very curious about getting as much practical and theoretical knowledge as possible. Is there any resources that can help with identifying ...
1
vote
0answers
59 views
How to combine Naive Bayes and Logistic Regression?
I am working on an NLP binary classification problem. I trained a model with linear regression and a naive Bayes classifier. I found out that I am getting a good recall value in linear regression but ...
1
vote
1answer
105 views
What advantages does Naive Bayes have over the “not naive” Bayes?
Repeating the question
What advantage does Naive Bayes have over "not naive" Bayes? Considering the fact that the assumption about conditional independence is often violated, why do we make it?
As ...
0
votes
0answers
35 views
Why is MLE used in Naive Bayes to estimate parameters if it's a frequentist approach?
Something that confuses me a bit.
I thought, MLE was a frequentist method. But as far as I understand, wen can estimate the parameters of Naive Bayes using MLE.
How come MLE is used in a Bayesian ...
0
votes
1answer
79 views
How can I replicate the process sklearn calculates the posterior probabilities?
I have a question pertaining to scikit-learn methods.
Can I get the same probabilities obtained with predict_log_proba() by hand calculating the likelihoods and prior obtained with feature_log_prob_ ...
0
votes
0answers
41 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
0answers
36 views
Correcting a naive Bayes classifier based on the performance on the training dataset
I'm sorry, this seems like something that's already been discussed to death, but I don't seem to be able to phrase the question right to find the answer.
Say I have a naive Bayes spam filter trained ...
2
votes
1answer
35 views
Why to use log while calculating probability of an email being spam?
I worked on a basic spam email project (Naive Bayes classifier with Laplace smoothing).
In source code, to calculate probabilities of spam or ham, log of the final result is being used.
Why is it ...
4
votes
1answer
35 views
Making naïve Bayes less naïve by accounting for mutual dependence
I'm playing with the pet example of figuring out the probability someone has the flu given certain symptoms, namely fever and nausea.
Let's define our priors, considering the "probability of x" as ...