public class Kluster extends DistanceMeasureCluster
Parametered.ParameteredGeneralizations
CLUSTERS_DIR, FINAL_ITERATION_SUFFIX, INITIAL_CLUSTERS_DIR
log
Constructor and Description |
---|
Kluster()
For (de)serialization as a Writable
|
Kluster(Vector center,
int clusterId,
DistanceMeasure measure)
Construct a new cluster with the given point as its center
|
Modifier and Type | Method and Description |
---|---|
String |
asFormatString() |
boolean |
calculateConvergence(double convergenceDelta) |
boolean |
computeConvergence(DistanceMeasure measure,
double convergenceDelta)
Return if the cluster is converged by comparing its center and centroid.
|
static String |
formatCluster(Kluster cluster)
Format the cluster for output
|
String |
getIdentifier() |
boolean |
isConverged() |
void |
readFields(DataInput in) |
protected void |
setConverged(boolean converged) |
String |
toString() |
void |
write(DataOutput out) |
configure, getMeasure, pdf, sampleFromPosterior, setMeasure
asFormatString, asJson, computeCentroid, computeParameters, createParameters, formatVector, formatVectorAsJson, getCenter, getId, getNumObservations, getParameters, getRadius, getS0, getS1, getS2, getTotalObservations, observe, observe, observe, observe, observe, setCenter, setId, setNumObservations, setRadius, setS0, setS1, setS2, setTotalObservations
public Kluster()
public Kluster(Vector center, int clusterId, DistanceMeasure measure)
center
- the Vector centerclusterId
- the int cluster idmeasure
- a DistanceMeasurepublic static String formatCluster(Kluster cluster)
cluster
- the Clusterpublic String asFormatString()
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
write
in class DistanceMeasureCluster
IOException
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
readFields
in class DistanceMeasureCluster
IOException
public String getIdentifier()
getIdentifier
in class DistanceMeasureCluster
public boolean computeConvergence(DistanceMeasure measure, double convergenceDelta)
measure
- The distance measure to use for cluster-point comparisons.convergenceDelta
- the convergence delta to use for stopping.public boolean isConverged()
isConverged
in interface Cluster
isConverged
in class AbstractCluster
protected void setConverged(boolean converged)
public boolean calculateConvergence(double convergenceDelta)
Copyright © 2008–2017 The Apache Software Foundation. All rights reserved.