|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.tuwien.ifs.somtoolbox.visualization.clustering.Cluster
public class Cluster
A Cluster used in KMeans clustering. Has a centroid and a number of indices of a data set assigned to it.
KMeans
Field Summary | |
---|---|
private double[] |
centroid
|
private DistanceMetric |
distanceFunction
|
private Vector<Integer> |
indices
|
private static int |
MAX_DIM_DEBUG
|
private static int |
MAX_INDICES_DEBUG
|
Constructor Summary | |
---|---|
Cluster()
|
|
Cluster(DistanceMetric distanceFunction)
|
|
Cluster(double[] centroid)
|
|
Cluster(double[] centroid,
DistanceMetric distanceFunction)
|
Method Summary | |
---|---|
void |
addIndex(int index)
Add the index of a data point to this cluster. |
double |
averageSSE(double[][] data)
SSE again, this time the average one (i.e. |
void |
calculateCentroid(double[][] data)
Calculate the centroid of this cluster. |
double[] |
getCentroid()
|
double |
getDistanceToCentroid(double[] instance)
Get the distance of a given instance to this cluster's centroid. |
Vector<Integer> |
getIndices()
|
int |
getInstanceIndexWithMaxSSE(double[][] data)
Get the instance with the maximum SSE of all instances assigned to this cluster. |
double[][] |
getInstances(double[][] data)
Returns all the instances belonging to this cluster according to the given data set. |
int[] |
getNumberOfAttributeOccurrences(double[][] data)
Get the numbers of occurrences of each attribute in this cluster. |
int |
getNumberOfInstances()
|
void |
printClusterIndices()
Tough one to guess. |
void |
printClusterIndices(double[][] data)
Tough one to guess. |
void |
removeInstanceIndex(int instanceIndex)
Removes the instance according to the given index. |
void |
setCentroid(double[] centroid)
Set the centroid of this cluster. |
double |
SSE(double[][] data)
Calculate the sum of the squared error (SSE) for this cluster. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int MAX_DIM_DEBUG
private static final int MAX_INDICES_DEBUG
private Vector<Integer> indices
private double[] centroid
private DistanceMetric distanceFunction
Constructor Detail |
---|
public Cluster()
public Cluster(double[] centroid)
public Cluster(double[] centroid, DistanceMetric distanceFunction)
public Cluster(DistanceMetric distanceFunction)
Method Detail |
---|
public void calculateCentroid(double[][] data)
data
- the data set.public void removeInstanceIndex(int instanceIndex)
public void addIndex(int index)
index
- to add.public void setCentroid(double[] centroid)
centroid
- to set.public double[] getCentroid()
public Vector<Integer> getIndices()
public int getNumberOfInstances()
public void printClusterIndices(double[][] data)
public void printClusterIndices()
public double[][] getInstances(double[][] data)
data
- instances.
public double SSE(double[][] data)
data
- matrix to compute the SSE for.
public double averageSSE(double[][] data)
public double getDistanceToCentroid(double[] instance)
instance
- some instance.
public int[] getNumberOfAttributeOccurrences(double[][] data)
public int getInstanceIndexWithMaxSSE(double[][] data)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |