org.apache.mahout.df.mapreduce.partial
Class Step2Mapper
java.lang.Object
org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text,TreeID,MapredOutput>
org.apache.mahout.df.mapreduce.partial.Step2Mapper
public class Step2Mapper
- extends org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text,TreeID,MapredOutput>
Second step of PartialBuilder. Using the trees of the first step, computes the oob predictions for each
tree, except those of its own partition, on all instancesof the partition.
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Mapper |
org.apache.hadoop.mapreduce.Mapper.Context |
Method Summary |
protected void |
cleanup(org.apache.hadoop.mapreduce.Mapper.Context context)
|
void |
configure(int partition,
Dataset dataset,
TreeID[] keys,
Node[] trees,
int numInstances)
Useful for testing. |
protected void |
map(org.apache.hadoop.io.LongWritable key,
org.apache.hadoop.io.Text value,
org.apache.hadoop.mapreduce.Mapper.Context context)
|
static int |
nbConcerned(int numMaps,
int numTrees,
int partition)
Compute the number of trees that need to classify the instances of this mapper's partition |
protected void |
setup(org.apache.hadoop.mapreduce.Mapper.Context context)
|
Methods inherited from class org.apache.hadoop.mapreduce.Mapper |
run |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Step2Mapper
public Step2Mapper()
setup
protected void setup(org.apache.hadoop.mapreduce.Mapper.Context context)
throws java.io.IOException,
java.lang.InterruptedException
- Overrides:
setup
in class org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text,TreeID,MapredOutput>
- Throws:
java.io.IOException
java.lang.InterruptedException
nbConcerned
public static int nbConcerned(int numMaps,
int numTrees,
int partition)
- Compute the number of trees that need to classify the instances of this mapper's partition
- Parameters:
numMaps
- total number of map tasksnumTrees
- total number of trees in the forestpartition
- mapper's partition
- Returns:
configure
public void configure(int partition,
Dataset dataset,
TreeID[] keys,
Node[] trees,
int numInstances)
- Useful for testing. Configures the mapper without using a JobConf
TODO we don't need the keys partitions, the tree ids should suffice
- Parameters:
partition
- mapper's partitiondataset
- keys
- keys returned by the first steptrees
- trees returned by the first stepnumInstances
- number of instances in the mapper's partition
map
protected void map(org.apache.hadoop.io.LongWritable key,
org.apache.hadoop.io.Text value,
org.apache.hadoop.mapreduce.Mapper.Context context)
throws java.io.IOException,
java.lang.InterruptedException
- Overrides:
map
in class org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text,TreeID,MapredOutput>
- Throws:
java.io.IOException
java.lang.InterruptedException
cleanup
protected void cleanup(org.apache.hadoop.mapreduce.Mapper.Context context)
throws java.io.IOException,
java.lang.InterruptedException
- Overrides:
cleanup
in class org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text,TreeID,MapredOutput>
- Throws:
java.io.IOException
java.lang.InterruptedException
Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.