Oracle Data Mining Java API Reference
10g Release 1 (10.1)

B12276-01

oracle.dmt.odm.model
Class Cluster

java.lang.Object
  |
  +--oracle.dmt.odm.MiningObject
        |
        +--oracle.dmt.odm.model.Cluster
All Implemented Interfaces:
java.io.Serializable

public class Cluster
extends MiningObject

An instance of Cluster holds the metadata about a cluster in a CluteringModel. Cluster objects are always associated with a ClusteringModel object. A cluster represents a group of records identified as homogeneous by the clustering algorithm. A cluster is characterized by its centroid, attribute histograms, and place in the clustering model hierarchical tree.

Since:
9.2.0
See Also:
Serialized Form

Method Summary
 AttributeHistogram getAttributeHistogram(Connection dmsCon, java.lang.String attrName)
          Returns the one-dimensional histogram of the attribute specified by attrName.
 java.util.Vector getChildren()
          Returns the collection of Cluster objects that are children of the cluster node.
 ClusterCentroid getClusterCentroid()
          Returns the ClusterCentroid object associated with a cluster.
 Category getClusterCentroidValue(MiningAttribute attr)
          Returns the attribute value of the cluster centroid for a given mining attribute.
 int getId()
          Returns the cluster id.
 int getLevel()
          Returns the level in the clustering tree associated with the Cluster object.
 Cluster getParent()
          Returns the parent of a Cluster.
 int getRecordCount()
          Returns the number of records in the training data assigned to the cluster during the model build.
 Predicate getSplitPredicate()
          Returns a SplitPredicate object that stores information on how records are assigned to the cluster node's children.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

getAttributeHistogram

public AttributeHistogram getAttributeHistogram(Connection dmsCon,
                                                java.lang.String attrName)
                                                        throws java.sql.SQLException,
MiningObjectException,
InvalidArgumentException,
ODMException
Returns the one-dimensional histogram of the attribute specified by attrName.
Parameters:
dmsCon - Connection to the DMS
attrName - Attribute name string
Returns:
Histogram for the mining attribute attrName
Throws:
InvalidArgumentException - when the attrName is null.
MiningObjectException - when the model cannot be opened.
java.sql.SQLException - when the attribute histogram meta data cannot be retrieved.
ODMException - attrName is empty or exceeds 30 bytes in length.

getId

public int getId()
Returns the cluster id.
Returns:
Cluster id

getRecordCount

public int getRecordCount()
Returns the number of records in the training data assigned to the cluster during the model build.
Returns:
Number of records belonging to a cluster

getClusterCentroid

public ClusterCentroid getClusterCentroid()
Returns the ClusterCentroid object associated with a cluster.
Returns:
Cluster centroid

getClusterCentroidValue

public Category getClusterCentroidValue(MiningAttribute attr)
                                                throws InvalidArgumentException
Returns the attribute value of the cluster centroid for a given mining attribute.
Parameters:
attr - Mining attribute
Returns:
Centroid value for the attribute attr
Throws:
InvalidArgumentException - when the attr is null.

getParent

public Cluster getParent()
Returns the parent of a Cluster. The method returns null if the cluster node has no parent. A parent of a cluster is its direct ancestor in the hierarchical tree. The root of the tree has no ancestor.
Returns:
Parent Cluster object

getChildren

public java.util.Vector getChildren()
Returns the collection of Cluster objects that are children of the cluster node. The method returns null if the cluster node has no children. The children of a cluster represents the direct descendents of this cluster in the clustering hierarchy. Leaf nodes have no children and a null value would be returned.
Returns:
Collection of children Cluster objects

getLevel

public int getLevel()
Returns the level in the clustering tree associated with the Cluster object. A tree level represents the distance between a cluster node and the root node within a clustering hierarchy. That is, how many splits in a tree branch were required to produce a node. The root node is at level 1. Its children are at level 2. Their children are at level 3, etc.
Returns:
Tree level

getSplitPredicate

public Predicate getSplitPredicate()
Returns a SplitPredicate object that stores information on how records are assigned to the cluster node's children. Since the clustering tree is binary, the predicate defines the conditions for one of the branches. Records not satisfying these conditions fall into the other branch. The method is relevant only in the O-Cluster algorithm. If a cluster node has no children, this method returns null.
Returns:
Split predicate associated with the cluster node

Copyright © 2003 Oracle Corporation. All Rights Reserved.