简体   繁体   中英

Mahout Naive Bayes CSV Classification

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 :

在此输入图像描述

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/

.

I Managed to create a working example.

if you are interested, see this gist

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM