资源简介

NaiveBayesClassify朴素贝叶斯分类法-MapReduce实现 朴树贝叶斯分类算法MapReduce实现

资源截图

代码片段和文件信息

//package default;
import java.io.DataOutputStream;  
import java.io.IOException;  
import java.io.UnsupportedEncodingException;  
import org.apache.hadoop.io.NullWritable;  
import org.apache.hadoop.io.Text;  
import org.apache.hadoop.mapreduce.RecordWriter;  
import org.apache.hadoop.mapreduce.TaskAttemptContext;  
import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;  
/**摘自{@link TextOutputFormat}中的LineRecordWriter。 */  
public class LineRecordWriter extends RecordWriter {  
    private static final String utf8 = “UTF-8“;  
    private static final byte[] newline;  
    static {  
        try {  
            newline = “\n“.getBytes(utf8);  
        } catch (UnsupportedEncodingException uee) {  
            throw new IllegalArgumentException(“can‘t find “ + utf8 + 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2012-09-23 10:55  NaiveBayesClassify\
     文件        4854  2012-06-09 10:34  NaiveBayesClassify\.classpath
     文件         430  2012-06-09 10:34  NaiveBayesClassify\.project
     目录           0  2012-09-23 10:55  NaiveBayesClassify\bin\
     文件        2641  2012-06-09 11:05  NaiveBayesClassify\bin\LineRecordWriter.class
     文件        5401  2012-06-09 11:05  NaiveBayesClassify\bin\MultipleOutputFormat$MultiRecordWriter.class
     文件        2638  2012-06-09 11:05  NaiveBayesClassify\bin\MultipleOutputFormat.class
     文件        2366  2012-06-09 11:05  NaiveBayesClassify\bin\NativeBayes$CategoryCountReducer.class
     文件        2855  2012-06-09 11:05  NaiveBayesClassify\bin\NativeBayes$CategoryMapper.class
     文件        5802  2012-06-09 11:05  NaiveBayesClassify\bin\NativeBayes$ComputeMapper.class
     文件        3197  2012-06-09 11:04  NaiveBayesClassify\bin\NativeBayes$ComputeReducer.class
     文件        1139  2012-06-09 11:05  NaiveBayesClassify\bin\NativeBayes$NameTextOutputFormat.class
     文件        2476  2012-06-09 11:05  NaiveBayesClassify\bin\NativeBayes.class
     文件           0  2012-06-09 10:34  NaiveBayesClassify\SecurityAuth.audit
     目录           0  2012-09-23 10:55  NaiveBayesClassify\src\
     文件        2353  2012-06-09 10:34  NaiveBayesClassify\src\LineRecordWriter.java
     文件        4909  2012-06-09 10:34  NaiveBayesClassify\src\MultipleOutputFormat.java
     文件        8943  2012-06-09 10:34  NaiveBayesClassify\src\NativeBayes.java

评论

共有 条评论