Question

I have these 2 CSV files:

  1. train-set.csv
  2. test-set.csv

Both of them are in the same structure (with different content) and similar to this example :

enter image description here

Each column is a feature and the last column - class, is the name of the class to predict.

.

Can anyone please provide a sample code for:

  1. Initializing Naive Bayes with a CSV file (model creation, training, required pre-processing, etc...)
  2. For a given CSV row - predicting a class

Thanks!

.

.

BTW -

I'm using Mahout 0.9 and Hadoop 2.4 and iv'e already tried to follow these links:

http://web.archiveorange.com/archive/v/y0uRZw9Q4iHdjrm4Rfsu http://chimpler.wordpress.com/2013/03/13/using-the-mahout-naive-bayes-classifier-to-automatically-classify-twitter-messages/

.

Was it helpful?

Solution

I Managed to create a working example.

if you are interested, see this gist

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top