-2

I have the following datasets... dataset

I have load the data using this

import numpy as np
import pandas as pd
input_file = "C:/Users/User/Documents/R/exp.csv"
df =  pd.read_csv(input_file, header = 0)

Now, I am trying to do this...

classifier = nltk.NaiveBayesClassifier.train(labeled_featuresets) 

How can i reach there ?

Hanson
  • 35
  • 4
  • Why do you read in the data with `header=0`? Apparently, the data *do* have a header. – lenz Sep 26 '16 at 19:48
  • I don't know. I found it searching and have no idea why it was used there. – Hanson Sep 26 '16 at 19:51
  • To me this sounds like you should be working through some tutorials on Python and probably Pandas. First you need to understand the code you pasted and try to build a bridge between the two fragments yourself. Then come back here if you have a more specific question. – lenz Sep 26 '16 at 20:31
  • http://stackoverflow.com/questions/21107075/classification-using-movie-review-corpus-in-nltk-python ? – alvas Sep 28 '16 at 01:55

1 Answers1

0

You can find information on NLTK and it's workings with their online tutorial.

Specifically, you should look into features and classifiers, both of which can be found in Chapter 6.

Features are simply functions that return some value based on an input, so you can build these functions around the data format of Pandas.

Stewart Smith
  • 1,396
  • 13
  • 28