org.apache.mahout.classifier.naivebayes.test
Class BayesTestMapper

java.lang.Object
  extended by org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.Text,VectorWritable,org.apache.hadoop.io.Text,VectorWritable>
      extended by org.apache.mahout.classifier.naivebayes.test.BayesTestMapper

public class BayesTestMapper
extends org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.Text,VectorWritable,org.apache.hadoop.io.Text,VectorWritable>

Run the input through the model and see if it matches.

The output value is the generated label, the Pair is the expected label and true if they match:


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Mapper
org.apache.hadoop.mapreduce.Mapper.Context
 
Constructor Summary
BayesTestMapper()
           
 
Method Summary
protected  void map(org.apache.hadoop.io.Text key, VectorWritable value, org.apache.hadoop.mapreduce.Mapper.Context context)
           
protected  void setup(org.apache.hadoop.mapreduce.Mapper.Context context)
           
 
Methods inherited from class org.apache.hadoop.mapreduce.Mapper
cleanup, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BayesTestMapper

public BayesTestMapper()
Method Detail

setup

protected void setup(org.apache.hadoop.mapreduce.Mapper.Context context)
              throws IOException,
                     InterruptedException
Overrides:
setup in class org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.Text,VectorWritable,org.apache.hadoop.io.Text,VectorWritable>
Throws:
IOException
InterruptedException

map

protected void map(org.apache.hadoop.io.Text key,
                   VectorWritable value,
                   org.apache.hadoop.mapreduce.Mapper.Context context)
            throws IOException,
                   InterruptedException
Overrides:
map in class org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.Text,VectorWritable,org.apache.hadoop.io.Text,VectorWritable>
Throws:
IOException
InterruptedException


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.