K
- the type of the input keysV
- the type of the input valuespublic class KMeansClustering<K,V> extends KMeansClustering<K,V>
ARG_CLUSTERS_POINTS, ARG_CRIT_FUN_CLASS, ARG_DELETE_CLUSTER_FILES, ARG_K, ARG_MAX_ITERATIONS, ARG_MAX_MEMBER_DISTANCE, ARG_SHAPE_GEN_CLASS, clustersPoints, critetionFunctionClass, deletePreviousClusterFiles, dimensions, inClustersPath, initKPointsPassed, iteration, k, maxIterations, maxMemberDistance, shapeGeneratorClass, workDirPath
argsp, inputDataSet, jarClass, jobRegEntryPath, proxyIDS
Constructor and Description |
---|
KMeansClustering() |
Modifier and Type | Method and Description |
---|---|
void |
configure(org.apache.hadoop.mapreduce.Job job)
Validates and adds the current parameters to the job configuration
|
protected InputDataSetConfiguratorHandler |
getInputDataSetConfiguratorHandler(org.apache.hadoop.conf.Configuration conf)
Returns the current instance of
InputDataSetConfiguratorHandler used to configure the input data set |
protected PointWritable[] |
getSampledPoints(org.apache.hadoop.conf.Configuration conf) |
static <K,V> void |
main(java.lang.String[] args) |
int |
run(java.lang.String[] args) |
KMeans.KMeansIterationResult |
runIteration(int iteration, org.apache.hadoop.conf.Configuration baseConf)
Launches a mapreduce job to run a single iteration
|
boolean |
runIterations(int maxIterations, org.apache.hadoop.conf.Configuration baseConf)
Runs the K Means clustering algorithm using the given configuration
|
configure, deletePreviousClustersFiles, generateFinalResultClustersFile, generateInitialKClustersPoints, getClustersPoints, getCmdOptions, getCritetionFunctionClass, getCurrentCmdArgs, getInClustersPath, getInputDataSetCmdParserHandler, getIteration, getK, getMaxIterations, getShapeGeneratorClass, getWorkDirPath, isDeletePreviousClusterFiles, isNextIteration, pointsToClusterInfo, processArgs, replaceEmptyOutClusters, runIteration, runIterations, setClustersPoints, setCritetionFunctionClass, setDeletePreviousClusterFiles, setInClustersPath, setIteration, setK, setMaxIterations, setOutput, setShapeGeneratorClass, setupNextIteractionClusters
addJobRegistryEntry, addJobRegistryEntry, addJobRegistryEntry, createJob, createJob, createJob, createJob, createJobConf, createJobConf, createJobConf, getCmdOptionsWithInputDataSets, getCmdOptionsWithInputDataSets, getCurrentCmdArgsAsString, getCurrentCmdArgsAsString, getInput, getInputDataSet, getInputFormatClass, getJarClass, getOutput, getRecordInfoProviderClass, getSpatialConfig, runJob, runJob, setInput, setInputDataSet, setInputFormatClass, setJarClass, setRecordInfoProviderClass, setSpatialConfig, updateInputDataSet
protected InputDataSetConfiguratorHandler getInputDataSetConfiguratorHandler(org.apache.hadoop.conf.Configuration conf)
BaseJob
InputDataSetConfiguratorHandler
used to configure the input data setgetInputDataSetConfiguratorHandler
in class KMeansClustering<K,V>
conf
- a job configurationInputDataSetConfiguratorHandler
public void configure(org.apache.hadoop.mapreduce.Job job) throws java.lang.Exception
BaseJob
public KMeans.KMeansIterationResult runIteration(int iteration, org.apache.hadoop.conf.Configuration baseConf) throws java.lang.Exception
iteration
- the iteration numberbaseConf
- the job configurationKMeans.KMeansIterationResult
containing the results of the iterationjava.lang.Exception
protected PointWritable[] getSampledPoints(org.apache.hadoop.conf.Configuration conf) throws java.io.IOException, java.lang.InterruptedException
getSampledPoints
in class KMeansClustering<K,V>
java.io.IOException
java.lang.InterruptedException
public boolean runIterations(int maxIterations, org.apache.hadoop.conf.Configuration baseConf) throws java.lang.Exception
maxIterations
- the maximum number of iterations. If zero is passed, a default value based on the number of clusters will be usedbaseConf
- the job configurationjava.lang.Exception
public int run(java.lang.String[] args) throws java.lang.Exception
run
in interface org.apache.hadoop.util.Tool
run
in class KMeansClustering<K,V>
java.lang.Exception
public static <K,V> void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
Copyright © 2016 Oracle and/or its affiliates. All Rights Reserved.