title: Mahout Naive Bayes CSV Classification
body: <p>I have these 2 CSV files:</p>
  
  <ol>
  <li>train-set.csv</li>
  <li>test-set.csv</li>
  </ol>
  
  <p>Both of them are in the same structure (with different content) and similar to this example :</p>
  
  <p><img src="https://i.stack.imgur.com/jsckr.png" alt="enter image description here"></p>
  
  <p>Each column is a feature and the last column - <code>class</code>, is the name of the class to predict.</p>
  
  <p>.</p>
  
  <p><strong>Can anyone please provide a sample code for:</strong></p>
  
  <ol start="2">
  <li>Initializing Naive Bayes with a CSV file (model creation, training, required pre-processing, etc...) </li>
  <li>For a given CSV row - predicting a class</li>
  </ol>
  
  <p>Thanks!</p>
  
  <p>.</p>
  
  <p>.</p>
  
  <p>BTW -</p>
  
  <p>I'm using <code>Mahout 0.9</code> and <code>Hadoop 2.4</code> and iv'e already tried to follow these links:</p>
  
  <p><a href="http://web.archiveorange.com/archive/v/y0uRZw9Q4iHdjrm4Rfsu" rel="nofollow noreferrer">http://web.archiveorange.com/archive/v/y0uRZw9Q4iHdjrm4Rfsu</a>
  <a href="http://chimpler.wordpress.com/2013/03/13/using-the-mahout-naive-bayes-classifier-to-automatically-classify-twitter-messages/" rel="nofollow noreferrer">http://chimpler.wordpress.com/2013/03/13/using-the-mahout-naive-bayes-classifier-to-automatically-classify-twitter-messages/</a></p>
  
  <p>.</p>