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

B12276-01

oracle.dmt.odm.model
Class ClusteringModel

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

public abstract class ClusteringModel
extends MiningModel

An instance of ClusteringModel holds the metadata of the result of a trained clustering model. This information is sufficient to describe the data clusters uncovered during model building as well as to assign new data points to clusters.

Since:
9.2.0
See Also:
Serialized Form

Method Summary
static void apply(Connection dmsConn, LocationAccessData applyData, PhysicalDataSpecification pds, java.lang.String modelName, MiningApplyOutput applyOutput, LocationAccessData outputLoc, java.lang.String applyResultName)
          Deprecated. As of ODM 9.2.0. Use MiningApplyTask to perform apply mining operation on a database table.
static RecordInstance apply(Connection dmsConn, RecordInstance record, java.lang.String modelName)
          Performs the apply mining operation on a single record represented by an instance of RecordInstance.
static RecordInstance apply(Connection dmsConn, RecordInstance record, java.lang.String modelName, MiningApplyOutput applyOutput)
          Performs the apply mining operation on a single record represented by an instance of RecordInstance.
 AttributeHistogram getAttributeHistogram(Connection dmsConn, int clusterID, java.lang.String attrName)
          Returns, for the MiningAttribute specified by attrName, the AttributeHistogram for the cluster identified by clusterID.
 MiningRuleSet getClusterRules(Connection dmsConn)
          Returns a MiningRuleSet with rules representing the ClusteringModel's clusters.
 MiningRuleSet getClusterRules(Connection dmsConn, int maxAttributeRelevanceRank)
          Returns a MiningRuleSet with rules, with at most maxAttributeRelevanceRank antecedents, representing the ClusteringModel's clusters.
 MiningRuleSet getClusterRules(Connection dmsConn, int maxNumberRuleAttribute, boolean bARFilter)
          Returns a MiningRuleSet with rules, with at most maxAttributeRelevanceRank antecedents, representing the ClusteringModel's clusters.
 java.util.Vector getClusters(Connection dmsConn)
          Returns a Vector of Cluster objects.
 int getInputDataRecordCount()
          Returns the number of input records used to train the clustering model.
 int[] getLeafClusterIDs(Connection dmsConn)
          Returns an array of leaf Cluster IDs.
 java.util.Vector getLeaves(Connection handle)
          Returns a Vector of Cluster objects.
 int getNumberOfClusters()
          Returns the number of clusters in the model.
 int getNumberOfLeaves()
          Returns the number of leaf clusters in the model.
 int getNumberOfLevels()
          Returns the number of levels in the ClusteringModel.
 int getRootID()
          Returns the ID for the ClusteringModel's root Cluster object.
static ClusteringModel restore(Connection dmsConn, java.lang.String modelName)
          Returns the specified ClusteringModel and populates the complex model object for reading by a user program.

 

Methods inherited from class oracle.dmt.odm.model.MiningModel
build, getBinCategoricalTableName, getBinNumericTableName, getMiningAlgorithm, getMiningFunction, getMiningFunctionSettings, getModelAlgorithm, getModelMiningFunction, getModelName, getSignature, listContents, listContents, listContents, listContents, remove, rename, storeLocationdata

 

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

 

Method Detail

getNumberOfClusters

public int getNumberOfClusters()
Returns the number of clusters in the model.
Returns:
Number of clusters

getRootID

public int getRootID()
Returns the ID for the ClusteringModel's root Cluster object.
Returns:
Root ID

getInputDataRecordCount

public int getInputDataRecordCount()
Returns the number of input records used to train the clustering model.
Returns:
Record count

getNumberOfLevels

public int getNumberOfLevels()
Returns the number of levels in the ClusteringModel.
Returns:
Number of levels

getClusters

public java.util.Vector getClusters(Connection dmsConn)
                             throws java.sql.SQLException,
InvalidArgumentException,
ODMException
Returns a Vector of Cluster objects. This collection of Cluster objects contains the information about the clusters discovered by the model.
Parameters:
dmsConn - The connection to the DMS
Returns:
Collection of Cluster objects
Throws:
InvalidArgumentException - when the dmsConn is null.
java.sql.SQLException - when the model meta data cannot be retrieved.
ODMException - when the model name is empty or exceeds 30 bytes in length.

getNumberOfLeaves

public int getNumberOfLeaves()
Returns the number of leaf clusters in the model.
Returns:
Number of leaves

getClusterRules

public MiningRuleSet getClusterRules(Connection dmsConn)
                                                  throws InvalidArgumentException,
                                                         java.sql.SQLException,
ODMException
Returns a MiningRuleSet with rules representing the ClusteringModel's clusters. The set of MiningRules represents the hyperboxes (bounding boxes) that envelop the clusters discovered by the clustering model. The antecedent of each rule describes the clustering bounding box. The consequent encodes the cluster ID for the cluster described by the rule.
Parameters:
dmsConn - The connection to the DMS
Returns:
Set of model rules
Throws:
InvalidArgumentException - when the dmsConn is null.
java.sql.SQLException - when the model meta data cannot be retrieved.
ODMException - when the model name is empty or exceeds 30 bytes in length.

getClusterRules

public MiningRuleSet getClusterRules(Connection dmsConn,
                                     int maxAttributeRelevanceRank)
                                                  throws InvalidArgumentException,
                                                         java.sql.SQLException,
ODMException
Returns a MiningRuleSet with rules, with at most maxAttributeRelevanceRank antecedents, representing the ClusteringModel's clusters. The set of MiningRules represents the hyperboxes (bounding boxes) that envelop the clusters discovered by the clustering model. The antecedent of each rule describes the clustering bounding box. The consequent encodes the cluster ID for the cluster described by the rule. Each rule has only attributes for which the attribute relevance rank is less or equal than maxAttributeRelevanceRank, where maxAttributeRelevanceRank is greater than 0. Attributes in the rule antecedent are selected according to how well they distinguish the records in the cluster from the overall population.
Parameters:
dmsConn - The connection to the DMS
maxAttributeRelevanceRank - Maximum number of attributes with different relevence score
Returns:
Set of model rules
Throws:
InvalidArgumentException - when the dmsConn is null or maxAttributeRelevanceRank < 1.
java.sql.SQLException - when the model meta data cannot be retrieved.
ODMException - when the model name is empty or exceeds 30 bytes in length.

getClusterRules

public MiningRuleSet getClusterRules(Connection dmsConn,
                                     int maxNumberRuleAttribute,
                                     boolean bARFilter)
                                                  throws InvalidArgumentException,
                                                         java.sql.SQLException,
ODMException
Returns a MiningRuleSet with rules, with at most maxAttributeRelevanceRank antecedents, representing the ClusteringModel's clusters. The set of MiningRules represents the hyperboxes (bounding boxes) that envelop the clusters discovered by the clustering model. The antecedent of each rule describes the clustering bounding box. The consequent encodes the cluster ID for the cluster described by the rule. Each rule has only attributes for which the attribute relevance rank is less or equal than maxAttributeRelevanceRank, where maxAttributeRelevanceRank is greater than 0. Attributes in the rule antecedent are selected according to how well they distinguish the records in the cluster from the overall population.
Parameters:
dmsConn - The connection to the DMS
bARFilter - filter attribute based on their relevance score. If it is false all attributes are included, if true only attributes with releveant score greater than 0 are included.
Returns:
Set of model rules
Throws:
InvalidArgumentException - when the dmsConn is null or maxAttributeRelevanceRank < 1.
java.sql.SQLException - when the model meta data cannot be retrieved.
ODMException - when the model name is empty or exceeds 30 bytes in length.

restore

public static ClusteringModel restore(Connection dmsConn,
                                      java.lang.String modelName)
                                                    throws java.sql.SQLException,
InvalidArgumentException,
ODMException
Returns the specified ClusteringModel and populates the complex model object for reading by a user program.
Parameters:
dmsConn - The connection to the DMS
modelName - Name of the model to retrieve
Returns:
instance of the ClusteringModel
Throws:
InvalidArgumentException - when the dmsConn/modelName is null.
java.sql.SQLException - when the model meta data cannot be retrieved.
ODMException - when the model name is empty or length exceeds the limit.

getAttributeHistogram

public AttributeHistogram getAttributeHistogram(Connection dmsConn,
                                                int clusterID,
                                                java.lang.String attrName)
                                                        throws java.sql.SQLException,
InvalidArgumentException,
ODMException
Returns, for the MiningAttribute specified by attrName, the AttributeHistogram for the cluster identified by clusterID. clusterID is an integer greater than 0.
Parameters:
dmsConn - The connection to the DMS
clusterID - Cluster ID
attrName - Attribute name
Returns:
Attribute Histogram
Throws:
InvalidArgumentException - when the dmsConn/modelName is null and clusterID < 1.
java.sql.SQLException - when the attribute histogram meta data cannot be retrieved.
ODMException

getLeaves

public java.util.Vector getLeaves(Connection handle)
                           throws java.sql.SQLException,
InvalidArgumentException,
ODMException
Returns a Vector of Cluster objects. This collection of Cluster objects are the leaves of the hierarchical ClusteringModel.
Returns:
Set of cluster model leaves
Throws:
InvalidArgumentException - when the handle is null.
java.sql.SQLException - when the model meta data cannot be retrieved.
ODMException - when the model name is empty or exceeds 30 bytes in length.

getLeafClusterIDs

public int[] getLeafClusterIDs(Connection dmsConn)
                        throws java.sql.SQLException,
MiningObjectException,
InvalidArgumentException,
ODMException
Returns an array of leaf Cluster IDs.
Parameters:
dmsConn - The connection to the DMS
Returns:
The array of leaf cluster IDs
Throws:
InvalidArgumentException - when dmsConn is null.
MiningObjectException -
  • when no Cluster exists in the model, or
  • when an error occurs during restore of clusters.
java.sql.SQLException - when an error occurs during access to DMS.
ODMException - when an error occurs during access to the model.
MiningObjectException

apply

public static void apply(Connection dmsConn,
LocationAccessData applyData,
PhysicalDataSpecification pds,
                         java.lang.String modelName,
MiningApplyOutput applyOutput,
LocationAccessData outputLoc,
                         java.lang.String applyResultName)
                  throws InvalidArgumentException,
                         java.sql.SQLException,
ODMException
Deprecated. As of ODM 9.2.0. Use MiningApplyTask to perform apply mining operation on a database table.
Performs the apply mining operation on multiple records specified in a database table. Using the applyData represented by the pds and the named modelName, this method generates an output table specified by outputLoc according to the appyOutput specification; writes the result with the name applyResultName in the data mining server represented by dmsConn.

Refer to oracle.dmt.odm.result package for more information on MiningApplyOutput and MiningApplyResult.

Parameters:
dmsConn - A connection to the data mining server
applyData - A database table to be used as input for apply
pds - A specification on the format of the input data
modelName - The name of the model to be used for apply
applyOutput - A specification on the format of apply output
outputLoc - The location an name of the output table
applyResultName - The name of the result to be persisted in the data mining server
Throws:
InvalidArgumentException -
  • when dmsConn is null,
  • when applyData is null,
  • when pds is null,
  • when modelName is null,
  • when applyOutput is null,
  • when outputLoc is null, or
  • when applyResultName is null.
ODMException -
  • when modelName is empty or exceeds 30 bytes in length, or
  • when applyResultName is empty or exceeds 30 bytes in length.
java.sql.SQLException - when an error occurs during the execution of apply operation.
See Also:
MiningApplyTask, MiningApplyResult, MiningApplyOutput

apply

public static RecordInstance apply(Connection dmsConn,
RecordInstance record,
                                   java.lang.String modelName)
                                                  throws InvalidArgumentException,
                                                         java.sql.SQLException,
ODMException
Performs the apply mining operation on a single record represented by an instance of RecordInstance. The result of this method is also returned in an instance of RecordInstance, which contains the top prediction and its probability (i.e., its probability is the highest among all predictions). The returned RecordInstance contains the default attribute instance values: score and probability. Note that no mining result is persisted for the result of this operation.
Parameters:
record - An instance of RecordInstance for input to apply
modelName - The model name to be used for apply
Returns:
An instance of RecordInstance that contains two attribute instances: score and probability of the top prediction.
Throws:
InvalidArgumentException -
  • when dmsConn is null,
  • when record is null, or
  • when modelName is null.
ODMException - when modelName is empty or exceeds 30 bytes in length.
java.sql.SQLException - when an error occurs during the execution of apply operation.
See Also:
RecordInstance, AttributeInstance

apply

public static RecordInstance apply(Connection dmsConn,
RecordInstance record,
                                   java.lang.String modelName,
MiningApplyOutput applyOutput)
                                                  throws InvalidArgumentException,
                                                         java.sql.SQLException,
ODMException
Performs the apply mining operation on a single record represented by an instance of RecordInstance. The result of this method is also returned in an instance of RecordInstance, which contains attribute instances based on the specification in applyOutput. Note that no mining result is persisted for the result of this operation.
Parameters:
record - An instance of RecordInstance for input to apply
modelName - The model name to be used for apply
applyOutput - A specification on the format of apply output
Returns:
An instance of RecordInstance that contains attribute instances based on the specification in applyOutput
Throws:
InvalidArgumentException -
  • when dmsConn is null,
  • when record is null,
  • when modelName is null, or
  • when applyOutput is null.
ODMException - when modelName is empty or exceeds 30 bytes in length.
java.sql.SQLException - when an error occurs during the execution of apply operation.
Since:
9.2.0
See Also:
RecordInstance, AttributeInstance, MiningApplyOutput

Copyright © 2003 Oracle Corporation. All Rights Reserved.