简体   繁体   English

Mahout Naive Bayes CSV分类

[英]Mahout Naive Bayes CSV Classification

I have these 2 CSV files: 我有这2个CSV文件:

  1. train-set.csv 列车set.csv
  2. test-set.csv 测试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. 每列都是一个要素,最后一列 - class ,是要预测的类的名称。

.

Can anyone please provide a sample code for: 任何人都可以提供以下示例代码:

  1. Initializing Naive Bayes with a CSV file (model creation, training, required pre-processing, etc...) 使用CSV文件初始化朴素贝叶斯(模型创建,培训,所需的预处理等...)
  2. For a given CSV row - predicting a class 对于给定的CSV行 - 预测一个类

Thanks! 谢谢!

.

.

BTW - BTW -

I'm using Mahout 0.9 and Hadoop 2.4 and iv'e already tried to follow these links: 我正在使用Mahout 0.9Hadoop 2.4并且我们已经尝试过以下链接:

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/ 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 如果你有兴趣,请看这个要点

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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