Questions tagged [naivebayes]

Naive Bayes is a popular (baseline) method for text-classification.

1035 questions
-1
votes
1 answer

classifier where attribute is dependent on cluster id

I have a classification problem where I have a set of blocks which form my data points. One of the attributes that I can use for block classification is a tag, which essentially is a block number of another block. The blocks also have other…
-1
votes
1 answer

Naive Bayes density estimator

I am currently studying for a machine learning exam and after a lot of googling and studying slides I'm still not entirely sure how a naive bayes density estimator works. Could someone please explain this to me? This course is still pretty basic so…
Knarf
  • 137
  • 1
  • 12
-1
votes
2 answers

Query about NaiveBayes Classifier

I am building a text classifier for classifying reviews as positive or negative. I have a query on NaiveBayes classifier formula: | P(label) * P(f1|label) * ... * P(fn|label) | P(label|features) =…
Amit Agarwal
  • 37
  • 1
  • 7
-1
votes
2 answers

how to use my own file instead of using dataset in this code

i am implementing this code and this gives me the corrent output but i want to save those four lines of"dataset" in a file and then use it.how can i do this?how can i use my own file instead of manually typed dataset? from naiveBayesClassifier…
Neha
  • 9
  • 2
-1
votes
1 answer

Is it possible to use attributes of the final estimator of a pipeline object in scikit learn?

I have created a pipeline object which uses countvectorizer and MultinomialNB. MultinomialNB instances have an attributes named intercept_. If I try to access this attribute using the Pipeline object I am getting the error that 'Pipeline' object has…
Abhishek Mishra
  • 1,984
  • 1
  • 18
  • 13
-1
votes
1 answer

Accuracy increases using cross-validation and decreases without

I have a question regarding cross validation: I'm using a Naive Bayes classifier to classify blog posts by author. When I validate my dataset without k-fold cross validation I get an accuracy score of 0.6, but when I do k-fold cross validation, each…
mesllo
  • 545
  • 7
  • 29
-2
votes
0 answers

Naive Bayes Model is giving recall,precision and accuracy score values as zero with a warning

I am using Naive bayes model on sentiment analysis of airline tweet data and after writing the code it is throwing back an warning and is accuracy, precision and recall values as zero and is not able to give plot_confusion_matrix. Give below is the…
-2
votes
1 answer

TypeError: __init__() takes 2 positional arguments but 4 were given in ConfusionMatrixDisplay

I create a Model and got an error like this: Previously I changed Confusin_matrix_plot to ConfusinMatrixDisplay but instead got the error above.
-2
votes
1 answer

How to create predictive model using Naive Bayes in Python?

It's my first time using python and I have created a basic csv file. I want to know how would you create a predictive model using Naive Bayes to classify if the words are informative or uninformative ?
-2
votes
1 answer

How can I implement the naïve Bayes algorithm?

import numpy as np import matplotlib.pyplot as plt import pandas as pd cigdata = pd.read_csv ('cigs.csv') print(cigdata.head()) cigdata.shape #Changing pandas dataframe to numpy array X = cigdata.iloc[:,:8].values y =…
-2
votes
1 answer

Naive Bayes same probability

I am working on Bayes and Naive Bayes theorem. I am stuck in the condition when the probabilities are the same for both labels. How does Naive Bayes handle this scenario?
-2
votes
1 answer

Why does predict_proba function not sum up to 1 in Naive Bayes

I have couple of models that do binary classification and I use sklearn's predict_proba function to find the confidence scores. predict_proba does sum up to 1 for Decision Tree, SVM, Random forest. But when it's used with Gaussian NB it does not sum…
-2
votes
1 answer

How Check accuracy in Decision tree and naive Bayes?

Showing same accuracy in decision tree and naive bayes algorithm with different symptoms I tried to get different accuracy but all results are remaining same this project is about disease prediction #decision_tree from sklearn import tree from…
-2
votes
1 answer

ValueError: shapes (4155,1445) and (4587,7) not aligned: 1445 (dim 1) != 4587 (dim 0)

I'm trying to predict with a different dataset. But still have a problem with it I've tried to change the parameters, but still no difference. X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.2, random_state=77) X_train.shape,…
-2
votes
2 answers

How can I multiply all item in an array with laravel?

i have array in controller with output like this { "usia": 0.01761252446184, "wife_education": 0.078277886497065, "husband_education": 0.0058708414872798, "number_of_children": 0.17025440313112, "wife_religion": 0.86497064579256, …
1 2 3
68
69