/**
* 找到抽样用户的特征,得到每个特征的概率
* 输入:属性1 属性2 属性3 属性4 类别
* 命令:hadoop jar recommend_cf.jar com.funshion.machine.bayes.Bayes2 /dw/logs/user/xincl/bayes.txt /dw/logs/recommend/result/machine/Bayes2
* 输出:
* @author clxin
*
*/
public class Bayes2 extends Configured implements Tool {
// 输出 : mac media
public static class BayesMapper extends MapReduceBase implements
Mapper<LongWritable, Text, StringSecondSortAsce, Text> {
StringSecondSortAsce tKey = new StringSecondSortAsce();
Text tValue = new Text();
@Override
public void map(LongWritable key, Text value,
OutputCollector<StringSecondSortAsce, Text> output,
Reporter report) throws IOException {
String [] strArr = value.toString().split("
* 找到抽样用户的特征,得到每个特征的概率
* 输入:属性1 属性2 属性3 属性4 类别
* 命令:hadoop jar recommend_cf.jar com.funshion.machine.bayes.Bayes2 /dw/logs/user/xincl/bayes.txt /dw/logs/recommend/result/machine/Bayes2
* 输出:
* @author clxin
*
*/
public class Bayes2 extends Configured implements Tool {
// 输出 : mac media
public static class BayesMapper extends MapReduceBase implements
Mapper<LongWritable, Text, StringSecondSortAsce, Text> {
StringSecondSortAsce tKey = new StringSecondSortAsce();
Text tValue = new Text();
@Override
public void map(LongWritable key, Text value,
OutputCollector<StringSecondSortAsce, Text> output,
Reporter report) throws IOException {
String [] strArr = value.toString().split("