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, iteration, k, maxIterations, maxMemberDistance, shapeGeneratorClass, workDirPath| Constructor and Description |
|---|
KMeansClustering() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(org.apache.hadoop.mapreduce.Job job) |
protected PointWritable[] |
getSampledPoints(org.apache.hadoop.conf.Configuration conf) |
static 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, getInClustersPath, getIteration, getK, getMaxIterations, getShapeGeneratorClass, getWorkDirPath, isDeletePreviousClusterFiles, isNextIteration, pointsToClusterInfo, processArgs, replaceEmptyOutClusters, runIteration, runIterations, setClustersPoints, setCritetionFunctionClass, setDeletePreviousClusterFiles, setInClustersPath, setIteration, setK, setMaxIterations, setOutput, setShapeGeneratorClass, setupNextIteractionClusterscreateJob, createJob, createJob, createJob, createJobConf, createJobConf, createJobConf, getInput, getInputFormatClass, getJarClass, getOutput, getRecordInfoProviderClass, getSpatialConfig, setInput, setInputFormatClass, setJarClass, setRecordInfoProviderClass, setSpatialConfig
public void configure(org.apache.hadoop.mapreduce.Job job)
throws java.lang.Exception
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.Exceptionprotected PointWritable[] getSampledPoints(org.apache.hadoop.conf.Configuration conf) throws java.io.IOException, java.lang.InterruptedException
getSampledPoints in class KMeansClustering<K,V>java.io.IOExceptionjava.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.Toolrun in class KMeansClustering<K,V>java.lang.Exception
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception