Questions tagged [naive-bayes-classifier]
Naive Bayes classifiers makes the naive assumption that the features are independent. They make use of Bayes theorem.
204 questions
6
votes
1
answer
252
views
When the regression models outperforms naive method?
I followed from this question.
Case1:
I have the following task to do: Training by the consecutive 3 days to predict the each 4th day. Each day data represents one CSV file which has dimension 24x25. ...
0
votes
1
answer
13
views
inconsistent numbers of samples model.fit MultinomialNB
Hello guys I am practicing Naive Bayes but I got an error : ValueError: Found input variables with inconsistent numbers of samples: [1, 4179]
Also, I saw some ...
0
votes
0
answers
12
views
Maximal risk for the Bayes classifier
In these lecture notes I found this statement
This maximal risk for the Bayes classifier occurs precisely when $Y$ “contains no
information” about the feature variable $X$.
How do I prove it? If I ...
0
votes
0
answers
34
views
Robustness and Sensitivity of Naive Bayes to Irrelevant Features
I understand that one of the strengths of Naive Bayes is its robustness to irrelevant features. However, it's also important to note that it can be sensitive to the presence of irrelevant features, ...
0
votes
1
answer
23
views
How to take the $\log$ of $e$ when taken to the power of a matrix?
I'm having some troubles trying to solve the following question, I'm trying to find the $C$ which maximizes
$$\begin{align}\text{arg max}_{1\geq m\geq K}(\log p(\mathbf{x}|C_m)+log P(C_m))\end{align}$$...
0
votes
0
answers
9
views
If a set of random vectors are independent then would the join event of the random vector from the set and another random variable independent?
If all x_i from i=1 to n are independent. And y_i is dependent on x_i. Then can we always say that all (x_i, y_i) tuples are always independent of each other? x_i is a random vector of shape mx1, y_i ...
0
votes
0
answers
91
views
Prediction in multiclass classification
Context: I need to make an multiclass classification to predict what type of sentence(law) the case will have in the end.
Data: I Have several columns to predict the case:client, cause of action, ...
2
votes
1
answer
92
views
Text preprocessing decreases classifier accuracy
I try to solve a binary text classification problem using sklearn's Tfidf Vecotrizer and a naive bayes classifier. Before I pass the training/test data to the vectorizer I do some text preprocessing. ...
1
vote
1
answer
181
views
Why Naive Bayes is not written as $$P(A|B) = \frac{P(A \cap B)}{P(B)}$$
I am currently learning Naive Bayes and observed that equation is given as,
$$P(A|B) = \frac{P(A).P(B|A)}{P(B)}$$
where, B are features and A is prediction value(yes/no)
But why not write it as,
$$P(A|...
1
vote
2
answers
78
views
A classification problem
I have a set of objects, each of which can have (but doesn't always exhibit) a set of properties. Properties are shared between objects, in the sense that different objects can have common properties ...
1
vote
1
answer
64
views
Test score higher than train score
I implemented a Gaussian Naive Bayes classifier and I got a test score (99,99%) higher than the train score (96,87%)
Is this normal or does it mean that my model is underfitting ?
Thank you.
1
vote
1
answer
53
views
How to properly compute spam message score as a combination of fixed features and probability from a naive bayes classifier?
I am building a learning spam/ham email classifier as an assignment. It's not supposed to be a good general classifier, but one that can learn on a small set of labeled emails of a user (approx. 650 - ...
0
votes
2
answers
725
views
Does it make sense to build a ROC curve for Naive Bayes classification?
These past days, in college, we have been learning about NaiveBayes. Since it's a classification algorithm, I was wondering if I could evaluate NaiveBayes models the same way (using the same metrics) ...
0
votes
1
answer
238
views
Why there is no alpha parameter for GaussianNB()?
Why there is no alpha argument ( smoothing parameter in Laplace smoothing) for GaussianNB() in sklearn library? ? Although BernoulliNB() and MultinomialNB() have an alpha parameter but GaussianNB() ...
1
vote
1
answer
258
views
Naive Bayes implementation using SkLearn documentation
I am studying Naive Bayes classification method from Data Mining Concept and Technique by Han, Kamber, Pei.
There is an example of how to find out the class probability using Naive Bayes classifier.
...
0
votes
1
answer
75
views
SkLearn Categorical Naive Bayes Vs Mathematical theory of Naive Bayes
The Naive Bayes classification based on the following formula
$P(C_i|X) = {P(X|C_i)P(C_i) \over P(X)} ... i)$
$P(X|C_i)$ is the posterior probability of $X$ conditioned on $C_i$, $P(X)$ prior ...
0
votes
1
answer
80
views
Fluctuating accuracy for Naive Bayes Classifier and SVM
I am comparing the classification accuracy between Naive Bayes (NBC), SVM and a Neural Network. I am using a Dataset of ~18K and 26 Labels.
In the current state the Neural Network get always an ...
1
vote
0
answers
184
views
How are the weights defined in a (linear-chain) Conditional Random Field?
Edit: i saw that i mixed up i (in the graph) and t (in the formula), in the following i equivalent to t
I am trying to understand the theory behind linear chain Conditional Random Fields. I have now ...
1
vote
1
answer
78
views
Confused on Naive Bayes classifier
In the last part of Andrew Ng's lectures about Gaussian Discriminant Analysis and Naive Bayes Classifier, I am confused as to how Andrew Ng derived $(2^n) - 1$ features for Naive Bayes Classifier.
...
1
vote
1
answer
22
views
Naive Bayes classifiers working principal raise question
Naive Bayes classifier works on the principal of conditional independence. Take an example, a bank manager wants to know how risky it is to approve loan for a customer depending upon customers ...
1
vote
1
answer
30
views
Looking for in depth knowledge in evalution metric
I am dealing with an unbalanced dataset. The total instances in my dataset is 1273 and the Yes class is 174 and No class is 1099. So the unbalance ratio is like 1:6. Now I know ...
1
vote
2
answers
192
views
Naive Bayes as a baseline model in an NLP task
I want to use the Naive Bayes model as a baseline in an classification task that I am working. I found this really useful tutorial: https://www.geeksforgeeks.org/applying-multinomial-naive-bayes-to-...
0
votes
1
answer
233
views
Scikit learn ComplementNB is outputting NaN for scores
I have an unbalanced binary dataset with 23 features, 92000 rows are labeled 0, and 207,000 rows are labeled 1.
I trained models on this dataset such as GaussianNB, DecisionTreeClassifier, and a few ...
0
votes
1
answer
75
views
Interpret Naive Bayes output Python
I am running Python code off Kaggle on the adult dataset using Naive Bayes. How do you interpret the results below, I know that it's for each instance the likelihood they make less than 50K or more ...
2
votes
1
answer
336
views
Are there any implementations of non Naive Bayes Classifier in Python?
Naive Bayes assumes that predictors are independent. Though this assumption is quite powerful, in some scenarios it fails miserably . So are there any implementations of non Naive Bayes in Python ? ...
2
votes
0
answers
67
views
Classification Texte with naive bayes complement
Currently I am on a text classification project, the goal is to classify a set of CVs according to 13 classes. I use the bayes algorithm (ComplementNB), in my tests it is the model that gives the ...
2
votes
0
answers
632
views
Naive Bayes ValueError: Dimension Mismatch
I am attempting to make predictions of categories of text data, one of which is Naive Bayes. The training data contains 7 categories, 802 data points. After balancing with SMOTE all 7 categories now ...
1
vote
0
answers
85
views
How to classify a point using Bayes classifier?
The following 2 classes dataset is available:
$$
C_{1}=\left \{ 17,18,19,20,21 \right \},C_{2}=\left \{ 12,14 \right \}
$$
If we assume each class distribution is gaussian, To which class does x=16 ...
1
vote
1
answer
2k
views
Naive Bayes loss function
Does Naive Bayes classifier require a loss function for Bernoulli classification? If yes, what loss function does Naive Bayes classification use? And how does it work?
1
vote
2
answers
843
views
How to calculate true positive, true negative, false positive, negative and postive with Bayes Classifer from scratch
I am working on implementing a Naive Bayes Classification algorithm. I have a method def prob_continous_value which is supposed to return the probability density ...
0
votes
1
answer
52
views
How to implement Naive Bayes classifier
I am working on implementing a Naive Bayes Classification algorithm. The problem requires classifying the following datasets:
...
3
votes
1
answer
684
views
What Shape Does Naive Bayes make?
Decision Trees draw straight lines to partition the feature space.
According to the Universal Approximation Theorem, Neural Networks can draw any continuous function.
What sort of shape does the Naive ...
1
vote
1
answer
42
views
How different classifiers would perform on a particular data set
I am reading through and learning how different ML methods work on different types of data, but I have faced a data set that I am not sure how ML methods, such as decision tree, Naive Bayes, and KNN, ...
1
vote
3
answers
490
views
How do I deal with unbalance classes in a stock market prediction problem?
I am working on a prediction model to predict whether a stock should sell, hold or buy in n days. Each day (or row in the dataset), I classify whether this should ...
1
vote
1
answer
92
views
Comparison of different Naive Bayes algorithm for SMS classification
There are various types of Naive Bayes algorithms in the Sklearn library:
Can all of them be used for text classifications? And which one's perform bette
I tested out a simple text classification ...
0
votes
1
answer
73
views
Algorithms for SMS spam detection
Which among KNN, Logistic and Naive Bayes would yield best results for SMS spam
detection? Is there any other efficient approach worth exploring.
I am planning to make a python application for SMS ...
2
votes
0
answers
145
views
What type of 'Naive Bayes' algorithm is provided by Orange?
I've been using Orange for a while to rapidly prototype a few classification models. One of the ones I've been using is 'Naive Bayes'. If I understand correctly, there are a few types available based ...
2
votes
1
answer
828
views
Really confused with characteristics of Naive Bayes classifiers?
Naive Bayes classifiers have the following characteristics-:
They are robust to isolated noise points because such points are
averaged out when estimating contiditional probabilities from data.
Naive ...
1
vote
2
answers
288
views
How to choose products based on Number of good, bad and total reviews?
Let us suppose, I have few scenarios for products with good and bad reviews.
P1: 1000 Good, 1 bad
P2: 100 good, 10 bad
P3: 20 Good, 0 bad
P4: 10000 good, 500 bad
...
1
vote
0
answers
137
views
Why exactly KNN is outperforming Parzen by a huge margin in classificaton task
I'm trying to implement a Naive Bayes classifier, which uses either of hypercubic Parzen window or KNN to estimate a density function.
The data I'm using is Fashion MNIST. The steps I take are that ...
0
votes
1
answer
263
views
Naive bayes expectation maximization vs logistic regression for binary classification
Assuming I'm dealing with binary classification.
For what kind of data Naive bayes using expectation maximization would give a better solution and for what kind of data logistic regression would be ...
1
vote
0
answers
111
views
Naive Bayes model - Missing output variable for specific sample(s)
With Naive Bayes model can we discard a training sample if the value of the sample's output variable is missing?
And would that not make any difference to the parameter learning of the Naive Bayes ...
1
vote
2
answers
419
views
Independence of Features assumption in Naive Bayes
How do we know if your features in my dataset are independent before applying Naive Bayes? Basically I want to know is it possible for us to get an idea before training our model if Naive Bayes will ...
0
votes
1
answer
171
views
Bad Input Shape -- How to interpret and Diagnose; Also side ML question
I apologize I am a ML novice, but I am trying to learn. I am making a classifier based on this dataset to predict mental health disorders based on features. I wanted to run a very simple NB classifer ...
1
vote
1
answer
790
views
Naives Bayes Text Classifier Confidence Score
I am experimenting with building a text classifier using Naive Bayes which has been pretty successful on my test data. One thing i am looking to incorporate is handling text that does not fit into any ...
1
vote
2
answers
125
views
Word list as a baseline for measuring a classifier's performance?
I am working on a simple Naive Bayes classifier that categorizes text messages as either "positive" or "negative". I was told that the simplest baseline to measure the classifier's ...
0
votes
1
answer
139
views
Random Sequence Predictions
Can machine learning algorithms predict random number generators.
key
A= 1 2 3
B= 4 5 6
C= 7 8 9
Example to catch a number sequence
4 8 8
I would select B C C
That would give me 27 number combinations
...
2
votes
1
answer
5k
views
How to interpret training and testing accuracy which are almost the same?
Note - I have read this post but still don't understand
I have a Naive Bayes classifier, when I input my training data to test the accuracy, I get 63.05%. When I input my test data, the accuracy is 65....
1
vote
1
answer
154
views
What is different between R2 and mean of R2 in multiclassification probelm? Which one is correct?
I have a question. I have a big dataset (unfortunately confidential).
What I did?
I have trained my model with Naive-Bayes.
...
-1
votes
1
answer
419
views
How to calculate the "Evidence" for Naive Bayes text classification?
I'm trying to write a Naïve Bayes text classification from scratch in Python, but I can't quite grasp what I should do to write the actual classifier.
One question that popped up was: "What ...