1,029 questions
0 votes
1 answer
25 views
Can't iterare Textblob classifier in a dataframe
I've been successful in training a TextBlob NaiveBayes sentiment classifier, with fairly high accuracy, and I'm trying to iterate it in a comment dataset to do a coder reliability test. The only issue ...
0 votes
1 answer
41 views
nltk.NaiveBayesClassifier.classify() input parameter
I have the following trained classifier: classifier = nltk.NaiveBayesClassifier.train(features[:train_count]) When I try to use it to classify(): result = classifier.classify(feature) and feature is ...
1 vote
0 answers
46 views
Cross-validation with nb method
I am trying to use k-fold cross-validation on a WESBROOK dataset. It uses the train function from the caret package to do this. So far this function has worked for me with methods such as svm, knn and ...
-1 votes
1 answer
66 views
Machine learning model predicts training labels themselves as result [closed]
I am trying to build a model to predict "species" based on data with features "message", "tail", and "finger", and label "species"(see the first few ...
-1 votes
1 answer
67 views
KeyError when using array as feature in language detection
I am following this tutorial for language detection using machine learning. In the dataset I am using, however, there are multiple variables as features. I tried, in the place of X = data["Text&...
-1 votes
1 answer
65 views
How to upload the result of Naive Bayes Classifier into a table?
Recently I've started a Python sentiment analysis training course, wherein I've got the first task, that is to process a dataset of IMDB reviews through 2 different models: lexical analysis with ...
0 votes
1 answer
51 views
Figure out which words a Naive Bayes classificator uses for deciding
I'm doing text classification with Naive Bayes in Python and want to figure out which words are used for deciding to what class a text belongs. I have found this answer https://stackoverflow.com/a/...
0 votes
2 answers
80 views
How to predict target variable with Naive Bayes from evidence not present in training set?
I'm working on a uni project and the deadline is coming soon. I was assigned a naive bayes classification problem using bnlearn. After reading from the dataset, I've done the usual train-test split, ...
0 votes
1 answer
21 views
Likelihoods in both linear regression model and naive Bayesian model
The model in linear regression is $y = \omega^T x + e$ , where x, y, e represent the feature, the target and the noise, respecively. p(y|x, omega) is often termed the likelihood function for the ...
0 votes
1 answer
68 views
sklearn ComplementNB: only class 0 predictions for perfectly seperable data
As shown below, the balanced, one dimensional data below can be perfectly separated by sklearn GaussianNB. Why is it that sklearn ComplementNB gives classifications that are all zeros for the same ...
0 votes
0 answers
210 views
Impossible to solve Feature name error while converting an XGBClassifier model to ONNX
I need to load a VotingClassifier model (a mix of XGBoost and NaiveBayes) that is in .sav format. The goal is to convert it to ONNX. However, I don't have access to the dataset, so I cannot retrain ...
0 votes
0 answers
44 views
How to properly prepare text data for processing it by already trained Naive Bayes multinomial model?
I trained a Naive Bayes multinomial model for binary classification of text for the presence of personal data in it. model = MultinomialNB() model.fit(X_train, y_train) I can't figure out how to use ...
1 vote
2 answers
702 views
Negative values in data passed to MultinomialNB when vectorize using Word2Vec
I am currently working on a project where I'm attempting to use Word2Vec in combination with Multinomial Naive Bayes (MultinomialNB) for accuracy calculations. import pandas as pd import numpy as np, ...
1 vote
2 answers
3k views
the parameter 'token_pattern' will not be used since 'tokenizer' is not none'
I am trying to remove punctuation and spaces (which includes newlines) and filter for tokens consisting of alphabetic characters only, and return the token text. I first define the function return [...
0 votes
2 answers
205 views
Gaussian Naive Bayes gives weird results
This is a basic implementation of Gaussian Bayes using sklearn. Can anyone tell me what I'm doing wrong here, my K-Fold CV results are a bit weird: import numpy as np import pandas as pd from sklearn....