public class ClusteringTreeNode extends AbstractMOAObject
Constructor and Description |
---|
ClusteringTreeNode(double[] center,
ClusteringFeature cf)
Creates a tree node for a ClusterFeature.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addChild(ClusteringTreeNode e)
Adds a child node.
|
Clustering |
addToClustering(Clustering clustering)
Adds all ClusterFeatures of the tree with this node as the root to a
Clustering.
|
List<double[]> |
addToClusteringCenters(List<double[]> clustering)
Adds all clustering centers of the ClusterFeatures of the tree with this
node as the root to a List of points.
|
void |
clearChildren()
Removes all children nodes.
|
int |
count()
Deprecated.
|
double[] |
getCenter()
Gets the representation of the ClusteringFeature
|
List<ClusteringTreeNode> |
getChildren()
Gets a
List of the children nodes. |
ClusteringFeature |
getClusteringFeature()
Gets the ClusteringFeature of this node.
|
void |
getDescription(StringBuilder sb,
int indent)
Returns a string representation of this object.
|
double |
getThreshold()
Gets the threshold of this node.
|
boolean |
hasNoChildren()
Returns
true if this node contains no children nodes. |
ClusteringTreeNode |
nearestChild(double[] pointA)
Searches for the nearest child node by comparing each representation.
|
void |
printClusteringCenters(Writer stream)
Writes all clustering centers of the ClusterFeatures of the tree with this
node as the root to a given stream.
|
void |
setCenter(double[] center)
Sets the representation of the ClusteringFeature
|
void |
setThreshold(double threshold)
Gets the threshold of this node.
|
copy, copy, measureByteSize, measureByteSize, toString
public ClusteringTreeNode(double[] center, ClusteringFeature cf)
center
- representation of the ClusterFeaturecf
- the ClusterFeature@Deprecated public int count()
public Clustering addToClustering(Clustering clustering)
clustering
- the Clustering to add the ClusterFeatures too.public List<double[]> addToClusteringCenters(List<double[]> clustering)
clustering
- the List to add the clustering centers too.public void printClusteringCenters(Writer stream) throws IOException
stream
- the streamIOException
- If an I/O error occurspublic double[] getCenter()
public void setCenter(double[] center)
center
- the representation of the ClusteringFeature to setpublic ClusteringFeature getClusteringFeature()
public List<ClusteringTreeNode> getChildren()
List
of the children nodes.List
of the children nodespublic void getDescription(StringBuilder sb, int indent)
MOAObject
AbstractMOAObject.toString
to give a string representation of the object.sb
- the stringbuilder to add the descriptionindent
- the number of characters to indentpublic ClusteringTreeNode nearestChild(double[] pointA)
pointA
- to find the nearest child forpublic boolean addChild(ClusteringTreeNode e)
e
- the child node to addtrue
List.add(java.lang.Object)
public void clearChildren()
List.clear()
public boolean hasNoChildren()
true
if this node contains no children nodes.true
if this node contains no children nodesList.isEmpty()
public double getThreshold()
public void setThreshold(double threshold)
threshold
- the threshold to setCopyright © 2019 University of Waikato, Hamilton, NZ. All Rights Reserved.