org.apache.mahout.ga.watchmaker.cd.hadoop
Class CDMapper

java.lang.Object
  extended by org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text,org.apache.hadoop.io.LongWritable,CDFitness>
      extended by org.apache.mahout.ga.watchmaker.cd.hadoop.CDMapper

public class CDMapper
extends org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text,org.apache.hadoop.io.LongWritable,CDFitness>

Hadoop Mapper. Evaluate all the rules with the input data line.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Mapper
org.apache.hadoop.mapreduce.Mapper.Context
 
Field Summary
static String CLASSDISCOVERY_DATASET
           
static String CLASSDISCOVERY_RULES
           
static String CLASSDISCOVERY_TARGET_LABEL
           
 
Constructor Summary
CDMapper()
           
 
Method Summary
static CDFitness evaluate(int target, int prediction, int label)
          Evaluate a given prediction.
protected  void map(org.apache.hadoop.io.LongWritable key, org.apache.hadoop.io.Text 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
 

Field Detail

CLASSDISCOVERY_RULES

public static final String CLASSDISCOVERY_RULES
See Also:
Constant Field Values

CLASSDISCOVERY_DATASET

public static final String CLASSDISCOVERY_DATASET
See Also:
Constant Field Values

CLASSDISCOVERY_TARGET_LABEL

public static final String CLASSDISCOVERY_TARGET_LABEL
See Also:
Constant Field Values
Constructor Detail

CDMapper

public CDMapper()
Method Detail

map

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

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.LongWritable,org.apache.hadoop.io.Text,org.apache.hadoop.io.LongWritable,CDFitness>
Throws:
IOException
InterruptedException

evaluate

public static CDFitness evaluate(int target,
                                 int prediction,
                                 int label)
Evaluate a given prediction.

Parameters:
target - expected label
prediction -
label - actual label


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