public class ClusteringFeature extends SphereCluster
Constructor and Description |
---|
ClusteringFeature(double[] center,
double radius)
Creates a ClusteringFeature.
|
ClusteringFeature(double[] center,
int numPoints,
double[] sumPoints,
double sumSquaredPoints,
double radius)
Creates a ClusteringFeature.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int numPoints,
double[] sumPoints,
double sumSquaredPoints)
Adds a point to the ClusteringFeature.
|
double |
calcKMeansCosts(double[] center)
Calculates the k-means costs of the ClusteringFeature too a center.
|
double |
calcKMeansCosts(double[] center,
ClusteringFeature points)
Calculates the k-means costs of the ClusteringFeature and another
ClusteringFeature too a center.
|
double |
calcKMeansCosts(double[] center,
double[] point)
Calculates the k-means costs of the ClusteringFeature and a point too a
center.
|
void |
getDescription(StringBuilder sb,
int indent)
Returns a string representation of this object.
|
int |
getNumPoints()
Returns the number of points of the ClusteringFeature.
|
double[] |
getSumPoints()
Returns the sum of points of the ClusteringFeature.
|
double |
getSumSquaredLength()
Returns the sum of the squared lengths of the ClusteringFeature.
|
double |
getThreshold()
Returns the threshold of the ClusteringFeature.
|
void |
merge(ClusteringFeature x)
Merges the ClusteringFeature with an other ClusteringFeature.
|
void |
printClusterCenter(Writer stream)
Writes the cluster center to a given stream.
|
void |
setNumPoints(int numPoints)
Sets the number of points of the ClusteringFeature.
|
void |
setSumPoints(double[] sumPoints)
Sets the sum of points of the ClusteringFeature.
|
void |
setSumSquaredLength(double sumSquaredLength)
Sets the sum of the squared lengths of the ClusteringFeature.
|
void |
setThreshold(double threshold)
Sets the threshold of the ClusteringFeature.
|
Cluster |
toCluster()
Creates a Cluster of the ClusteringFeature.
|
double[] |
toClusterCenter()
Creates the cluster center of the ClusteringFeature.
|
combine, getCenter, getCenterDistance, getCenterDistance, getClusterSpecificInfo, getDistanceVector, getDistanceVector, getHullDistance, getInclusionProbability, getRadius, getWeight, merge, overlapRadiusDegree, overlapSave, sample, setCenter, setRadius, setWeight
getGroundTruth, getId, getInfo, getMeasureValue, isGroundTruth, setGroundTruth, setId, setMeasureValue, setMeasureValue
copy, copy, measureByteSize, measureByteSize, toString
public ClusteringFeature(double[] center, int numPoints, double[] sumPoints, double sumSquaredPoints, double radius)
center
- the center pointnumPoints
- the number of pointssumPoints
- the sum of all pointssumSquaredPoints
- the sum of the squared lengthsradius
- the radiuspublic ClusteringFeature(double[] center, double radius)
center
- the center pointradius
- the radiuspublic void add(int numPoints, double[] sumPoints, double sumSquaredPoints)
numPoints
- the number of points to addsumPoints
- the sum of points to addsumSquaredPoints
- the sum of the squared lengths to addpublic void merge(ClusteringFeature x)
x
- the ClusteringFeature to merge withpublic Cluster toCluster()
public double[] toClusterCenter()
public void printClusterCenter(Writer stream) throws IOException
stream
- the streamIOException
- If an I/O error occurspublic int getNumPoints()
public void setNumPoints(int numPoints)
numPoints
- the number of points of the ClusteringFeature to setpublic double[] getSumPoints()
public void setSumPoints(double[] sumPoints)
sumPoints
- the sum of points of the ClusteringFeature to setpublic double getSumSquaredLength()
public void setSumSquaredLength(double sumSquaredLength)
sumSquaredLength
- the sum of the squared lengths of the ClusteringFeature to setpublic double getThreshold()
public void setThreshold(double threshold)
threshold
- the threshold of the ClusteringFeature to setpublic void getDescription(StringBuilder sb, int indent)
MOAObject
AbstractMOAObject.toString
to give a string representation of the object.getDescription
in interface MOAObject
getDescription
in class Cluster
sb
- the stringbuilder to add the descriptionindent
- the number of characters to indentpublic double calcKMeansCosts(double[] center)
center
- the center too calculate the costspublic double calcKMeansCosts(double[] center, double[] point)
center
- the center too calculate the costspoint
- the point too calculate the costspublic double calcKMeansCosts(double[] center, ClusteringFeature points)
center
- the center too calculate the costspoints
- the points too calculate the costsCopyright © 2019 University of Waikato, Hamilton, NZ. All Rights Reserved.