naivebayes

Finding training data for tweets with labels: positive, negative, neutral

Finding training data for tweets with labels: positive, negative, neutral Question: Are there any training data of tweets with labels: positive, negative, neutral as following: "tweet 1" positive "tweet 2" positive "tweet 3" neutral "tweet 4" negative Or in general are there any good site for finding training sets? Asked By: TheRi || Source Answers: …

Total answers: 2

Applying Cross validation in Naive bayes

Applying Cross validation in Naive bayes Question: My dataset is Spam and Ham Filipino Message I divided my dataset into 60% training, 20% testing and 20%validation Split data into testing, training and Validation from sklearn.model_selection import train_test_split data[‘label’] = (data[‘label’].replace({‘ham’ : 0, ‘spam’ : 1})) X_train, X_test, y_train, y_test = train_test_split(data[‘message’], data[‘label’], test_size=0.2, random_state=1) X_train, …

Total answers: 3

ValueError: bad input shape (1, 4) in sklearn.naive_bayes.GaussianNB

ValueError: bad input shape (1, 4) in sklearn.naive_bayes.GaussianNB Question: I started to learn machine learning, currently Naive Bayes/ My python script import numpy as np x = np.array([[0,0],[1,1],[0,1],[1,0]]) y = np.array([0,0,1,1]) print(x) from sklearn.naive_bayes import GaussianNB clf = GaussianNB() x = x.reshape(1,-1) y = y.reshape(1,-1) clf.fit(x,y) a = clf.predict([[1,1]]) print(a) Error The error is: [[0 …

Total answers: 1

How to tune GaussianNB?

How to tune GaussianNB? Question: Trying to fit data with GaussianNB() gives me low accuracy score. I’d like to try Grid Search, but it seems that parameters sigma and theta cannot be set. Is there anyway to tune GausssianNB? Asked By: vlad || Source Answers: Naive Bayes doesn’t have any hyperparameters to tune. Answered By: …

Total answers: 4

Save Naive Bayes Trained Classifier in NLTK

Save Naive Bayes Trained Classifier in NLTK Question: I’m slightly confused in regard to how I save a trained classifier. As in, re-training a classifier each time I want to use it is obviously really bad and slow, how do I save it and the load it again when I need it? Code is below, …

Total answers: 3

Classifying Documents into Categories

Classifying Documents into Categories Question: I’ve got about 300k documents stored in a Postgres database that are tagged with topic categories (there are about 150 categories in total). I have another 150k documents that don’t yet have categories. I’m trying to find the best way to programmaticly categorize them. I’ve been exploring NLTK and its …

Total answers: 3