Questions tagged [naivebayes]

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

1035 questions
3
votes
2 answers

How to use Timestamp Data in Building Naive Bayes model in Python

I have a Dataset, with Timestamp as one of the column with the format 09/07/2016 23:58. I'm trying to apply Naive Bayes on this Data, and i'm facing the below error. Please let me know how to use this Data in my model ValueError: invalid literal for…
Anagha
  • 3,073
  • 8
  • 25
  • 43
3
votes
1 answer

sklearn: Naive Bayes classifier gives low accuracy

I have a dataset which includes 200000 labelled training examples. For each training example I have 10 features, including both continuous and discrete. I'm trying to use sklearn package of python in order to train the model and make predictions…
Giorgos Myrianthous
  • 36,235
  • 20
  • 134
  • 156
3
votes
1 answer

sklearn NB classifier: How to get the actual probabilities of individual samples?

I am making a machine learning program which classifies words in one of the following categories: Hardware, Software, None_of_these. I make use of the Multinomial Naive Bayes classifier from sklearn. The function predict() gives me the prediction of…
user3656099
  • 155
  • 1
  • 11
3
votes
1 answer

Spark Naive Bayes model persistence : understanding pi & theta

I am working on Naive Bayes based implementation and I am using Spark 2.0 for the same, as far as model tuning is concerned I done with it, but I am stuck at persistence of the model, I am well aware of the Model persistence support in Spark 2, but…
sourabh
  • 223
  • 2
  • 13
3
votes
1 answer

Interpreting conditional probabilities returned by naiveBayes classifier in e1071:R

Working on a classification solution using the following process: a. Perform Naive Bayes classification in R using e1071. b. Get the a-priori table and conditional probabilities tables c. Use the values for prediction using a PL/SQL program within…
Siddharth
  • 45
  • 1
  • 9
3
votes
2 answers

Understanding Naive Bayes

I've been looking around, and can't seem to find an answer to this question: If I train Naive-bayes to be a classifier on some data. Then I RE-USE this training data as the TEST DATA. Shouldn't I get 100% classification success? Thanks for reading!…
OctaveParango
  • 113
  • 1
  • 14
3
votes
3 answers

Variable importance for support vector machine and naive Bayes classifiers in R

I’m working on building predictive classifiers in R on a cancer dataset. I’m using random forest, support vector machine and naive Bayes classifiers. I’m unable to calculate variable importance on SVM and NB models I end up receiving the following…
3
votes
1 answer

sklearn MultinomialNB How to find most distinguish word in Class

I am working on sklearn multinomial naive bayes classifier to classify the 20NewsGroup data. The code is as follows: import numpy as np import operator from sklearn import datasets, naive_bayes, metrics, feature_extraction data_train =…
Aloyz
  • 31
  • 3
3
votes
1 answer

Naive-bayes multinomial text classifier using Data frame in Scala Spark

I am trying to build a NaiveBayes classifier, loading the data from database as DataFrame which contains (label, text). Here's the sample of data (multinomial label): label| feature| +-----+--------------------+ | 1|combusting…
user2366149
3
votes
0 answers

Implementation of Naive Bayes for text classification in C++

I am writing a code for implementing Naive Bayes classifier for text classification. I have worked a very small example, please refer page 44, it seems to be working. But I want know whether the implementation is correct, whether it will work for…
nSv23
  • 429
  • 6
  • 19
3
votes
1 answer

Should Naive Bayes multiple all the word in the vocabulary

I am using Naive Bayes in text classification. Assume that my vocabulary is ["apple","boy","cup"] and the class label is "spam" or "ham". Each document will be covered to a 3-dimentional 0-1 vector. For example, "apple boy apple apple" will be…
3
votes
1 answer

Sparse Vectors, what are they?

I am using the Mahout API within for a Naive Bayes Classifier. One of the functions is SparseVectorsFromSequenceFiles and although I have tried the old Google search, I still do not understanf what a sparse vector is. The closest to an explanation I…
Ben Davison
  • 713
  • 7
  • 15
3
votes
2 answers

How many documents to train on for naive bayes?

I just created my own Naive Bayes model from scratch and trained it on 776 documents. I tried classifying the documents but it's classified the documents wrong on all three of the test documents. The category that it should have been even had the…
3
votes
1 answer

How to use PoS tag as a feature for training data by Naive Bayes classifier?

I'm researching how to extract keyphrases from document for my thesis. In my research, I used Naive Bayes classifier machine learning for creating a training model of the candidate term features. One of features is PoS tag, I think this feature is…
3
votes
0 answers

Naive Bayes classification... not so efficient

I have a database of 10 million products (title, description, brand, category) as a learning dataset. I want to make an algorithm to classify around 10 000 products which do not have a category. I made a little java program to train the algorithm…
Simo L.
  • 321
  • 1
  • 3
  • 20