@Deprecated public abstract class Builder extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
Builder(TreeBuilder treeBuilder,
org.apache.hadoop.fs.Path dataPath,
org.apache.hadoop.fs.Path datasetPath,
Long seed,
org.apache.hadoop.conf.Configuration conf)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
DecisionForest |
build(int nbTrees)
Deprecated.
|
protected abstract void |
configureJob(org.apache.hadoop.mapreduce.Job job)
Deprecated.
Used by the inheriting classes to configure the job
|
protected org.apache.hadoop.fs.Path |
getDataPath()
Deprecated.
|
static org.apache.hadoop.fs.Path |
getDistributedCacheFile(org.apache.hadoop.conf.Configuration conf,
int index)
Deprecated.
Helper method.
|
static int |
getNbTrees(org.apache.hadoop.conf.Configuration conf)
Deprecated.
Get the number of trees for the map-reduce job.
|
static int |
getNumMaps(org.apache.hadoop.conf.Configuration conf)
Deprecated.
Return the value of "mapred.map.tasks".
|
protected org.apache.hadoop.fs.Path |
getOutputPath(org.apache.hadoop.conf.Configuration conf)
Deprecated.
Output Directory name
|
static Long |
getRandomSeed(org.apache.hadoop.conf.Configuration conf)
Deprecated.
Returns the random seed
|
static TreeBuilder |
getTreeBuilder(org.apache.hadoop.conf.Configuration conf)
Deprecated.
|
protected static boolean |
isOutput(org.apache.hadoop.conf.Configuration conf)
Deprecated.
Used only for DEBUG purposes.
|
static Dataset |
loadDataset(org.apache.hadoop.conf.Configuration conf)
Deprecated.
Helper method.
|
protected abstract DecisionForest |
parseOutput(org.apache.hadoop.mapreduce.Job job)
Deprecated.
Parse the output files to extract the trees and pass the predictions to the callback
|
protected boolean |
runJob(org.apache.hadoop.mapreduce.Job job)
Deprecated.
Sequential implementation should override this method to simulate the job execution
|
static void |
setNbTrees(org.apache.hadoop.conf.Configuration conf,
int nbTrees)
Deprecated.
Set the number of trees to grow for the map-reduce job
|
void |
setOutputDirName(String name)
Deprecated.
Sets the Output directory name, will be creating in the working directory
|
static void |
sortSplits(org.apache.hadoop.mapreduce.InputSplit[] splits)
Deprecated.
sort the splits into order based on size, so that the biggest go first.
This is the same code used by Hadoop's JobClient. |
protected Builder(TreeBuilder treeBuilder, org.apache.hadoop.fs.Path dataPath, org.apache.hadoop.fs.Path datasetPath, Long seed, org.apache.hadoop.conf.Configuration conf)
protected org.apache.hadoop.fs.Path getDataPath()
public static int getNumMaps(org.apache.hadoop.conf.Configuration conf)
conf - configurationprotected static boolean isOutput(org.apache.hadoop.conf.Configuration conf)
conf - configurationpublic static Long getRandomSeed(org.apache.hadoop.conf.Configuration conf)
conf - configurationpublic static TreeBuilder getTreeBuilder(org.apache.hadoop.conf.Configuration conf)
public static int getNbTrees(org.apache.hadoop.conf.Configuration conf)
conf - configurationpublic static void setNbTrees(org.apache.hadoop.conf.Configuration conf,
int nbTrees)
conf - configurationnbTrees - number of trees to buildIllegalArgumentException - if (nbTrees <= 0)public void setOutputDirName(String name)
name - output dir. nameprotected org.apache.hadoop.fs.Path getOutputPath(org.apache.hadoop.conf.Configuration conf)
throws IOException
conf - configurationIOException - if we cannot get the default FileSystempublic static org.apache.hadoop.fs.Path getDistributedCacheFile(org.apache.hadoop.conf.Configuration conf,
int index)
throws IOException
conf - configurationindex - index of the path in the DistributedCache filesIOException - if no path is foundpublic static Dataset loadDataset(org.apache.hadoop.conf.Configuration conf) throws IOException
conf - configurationIOException - if we cannot retrieve the Dataset path from the DistributedCache, or the Dataset could not be
loadedprotected abstract void configureJob(org.apache.hadoop.mapreduce.Job job)
throws IOException
job - Hadoop's JobIOException - if anything goes wrong while configuring the jobprotected boolean runJob(org.apache.hadoop.mapreduce.Job job)
throws ClassNotFoundException,
IOException,
InterruptedException
job - Hadoop's jobClassNotFoundExceptionIOExceptionInterruptedExceptionprotected abstract DecisionForest parseOutput(org.apache.hadoop.mapreduce.Job job) throws IOException
job - Hadoop's jobIOException - if anything goes wrong while parsing the outputpublic DecisionForest build(int nbTrees) throws IOException, ClassNotFoundException, InterruptedException
public static void sortSplits(org.apache.hadoop.mapreduce.InputSplit[] splits)
splits - input splitsCopyright © 2008–2017 The Apache Software Foundation. All rights reserved.