org.apache.mahout.classifier.naivebayes.trainer
Class NaiveBayesTrainer

java.lang.Object
  extended by org.apache.mahout.classifier.naivebayes.trainer.NaiveBayesTrainer

public final class NaiveBayesTrainer
extends Object

This class trains a Naive Bayes Classifier (Parameters for both Naive Bayes and Complementary Naive Bayes)


Field Summary
static String ALPHA_I
           
static String CLASS_VECTORS
           
static String LABEL_MAP
           
static String SUM_VECTORS
           
static String THETA_SUM
           
 
Method Summary
static org.apache.hadoop.fs.Path createLabelMapFile(Iterable<String> labels, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path labelMapPathBase)
          Write the list of labels into a map file
static void trainNaiveBayes(org.apache.hadoop.fs.Path input, org.apache.hadoop.conf.Configuration conf, Iterable<String> inputLabels, org.apache.hadoop.fs.Path output, int numReducers, float alphaI, boolean trainComplementary)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THETA_SUM

public static final String THETA_SUM
See Also:
Constant Field Values

SUM_VECTORS

public static final String SUM_VECTORS
See Also:
Constant Field Values

CLASS_VECTORS

public static final String CLASS_VECTORS
See Also:
Constant Field Values

LABEL_MAP

public static final String LABEL_MAP
See Also:
Constant Field Values

ALPHA_I

public static final String ALPHA_I
See Also:
Constant Field Values
Method Detail

trainNaiveBayes

public static void trainNaiveBayes(org.apache.hadoop.fs.Path input,
                                   org.apache.hadoop.conf.Configuration conf,
                                   Iterable<String> inputLabels,
                                   org.apache.hadoop.fs.Path output,
                                   int numReducers,
                                   float alphaI,
                                   boolean trainComplementary)
                            throws IOException,
                                   InterruptedException,
                                   ClassNotFoundException
Throws:
IOException
InterruptedException
ClassNotFoundException

createLabelMapFile

public static org.apache.hadoop.fs.Path createLabelMapFile(Iterable<String> labels,
                                                           org.apache.hadoop.conf.Configuration conf,
                                                           org.apache.hadoop.fs.Path labelMapPathBase)
                                                    throws IOException
Write the list of labels into a map file

Throws:
IOException


Copyright © 2008-2011 The Apache Software Foundation. All Rights Reserved.