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

B12276-01

oracle.dmt.odm.model
Class AdaptiveBayesNetworkModel

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

public abstract class AdaptiveBayesNetworkModel
extends SupervisedModel

An instance of AdaptiveBayesNetworkModel contains the metadata and rules tables from a model build. The metadata is sufficient to determine whether a model can be applied to given data. AdaptiveBayesNetworkModel is an adaptive conditional independence model that uses the minimum description length principle to construct and prune an array of conditionally independent NetworkFeatures. Each NetworkFeature consists of one or more ConditionalProbabilityExpressions. The collection of NetworkFeatures forms a product model that provides estimates of the target class probabilities. There can be one or more NetworkFeatures. The number and depth of the NetworkFeatures in the model determine the model mode. There are three model modes: 1) pruned Naive Bayes (NaiveBayesBuild), 2) simplified decision tree (SingleFeatureBuild), and 3) boosted (MultiFeatureBuild). ABN mode is user-selectable. Rules are available only for mode 2: simplified decision tree. Each NetworkFeature consist of one or more attributes included in a ConditionalProbabilityExpression. An array of single attribute NetworkFeatures is an MDL-pruned Naive Bayes model. A single multi-attribute NetworkFeature model is equivalent to a simplified C4.5 decision tree. It is simplified in the sense that numerical attributes are binned and treated as categorical. Furthermore, a single predictor is used to split all nodes at a given tree depth. As in C4.5, the splits are k-way, where k is the number of unique (binned) values of the splitting predictor. Finally, a collection of multi-attribute NetworkFeatures forms a product model (boosted mode). All three modes provide estimates of the target class probabilities. Rules can be extracted from the AdaptiveBayesNetworkModel as CompoundPredicates. Rules form a human interpretable depiction of the model and include statistics indicating the number of the relavant training data instances in support of the rule. A record apply instance specifies a pathway in a network feature taking the form of a compound predicate. For example, suppose the feature consists of two training attributes: Age {20-40, 40-60, 60-80} and Income {<=50K, >50K}. A record instance consisting of a person age 25 and income $42K is expressed as: IF AGE IN (20-40) and INCOME IN (<=50K). Suppose that the associated target (e.g., response to a promotion) probabilities are {0.8 (no), 0.2 (yes)}. Then we have a detailed rule of the form: IF AGE IN (20-40) and INCOME IN (<=50K) => Prob = {0.8, 0.2}. In addition to the probability distribution, there are the associated training data counts, e.g. {400, 100}. Suppose there is a cost matrix specifying that it is 6 times more costly to incorrectly predict a no than to incorrecly predict a yes. Then the cost of predicting yes for this instance is 0.8 * 1 = 0.8 (because I am wrong in this prediction 80% of the time) and the cost of predicting no is 0.2 * 6 = 1.2. Thus, the minimum cost (best) prediction is yes. Absent the cost matrix and the decision is reversed. Implicitly, all errors are equal and we have: 0.8 * 1 = 0.8 for yes and 0.2 * 1 = 0.2 for no.

Since:
9.2.0
See Also:
Serialized Form

Method Summary
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.
static int getAvgFeatureConstructionTime(Connection dmsConn, java.lang.String modelName)
          Returns an average time required to construct a network feature in minutes.
static TreeNode[] getDecisionTree(Connection dmsConn, java.lang.String modelName)
          Returns the array of TreeNodes forming a decision tree.
static int getEstimateTimeToConstructAFeature(Connection dmsConn, java.lang.String modelName)
          Returns an estimate of the time required to construct a network feature in minutes.
static ABNModelBuildState getModelBuildState(Connection dmsConn, java.lang.String modelName)
          Returns an ABNModelBuildState instance indicating the model build state.
static ModelTimingRecord[] getModelTimingRecords(Connection dmsConn, java.lang.String modelName)
          Deprecated. As of ODM 9.2.0.4, this method is not supported.
static NetworkFeature[] getNetworkFeatures(Connection dmsConn, java.lang.String modelName)
          Returns an array of NetworkFeatures.
static int getNumberOfFeaturesAccepted(Connection dmsConn, java.lang.String modelName)
          Returns a number of accepted network features.
static int getNumberOfFeaturesBuilt(Connection dmsConn, java.lang.String modelName)
          Returns a number of built network features.
static int getNumberOfRules(Connection dmsConn, java.lang.String modelName)
          Returns the number of mining rules.
static ABNMiningRule getRuleById(Connection dmsConn, java.lang.String modelName, int ruleId)
          Returns the ABNMiningRule associated with the rule id.
static MiningRuleSet getRules(Connection dmsConn, java.lang.String modelName)
          Returns the decision tree MiningRuleSet.
static MiningRuleSet getRulesByIds(Connection dmsConn, java.lang.String modelName, int[] ruleIds)
          Returns the MiningRuleSet associated with the array of rule ids.
static NetworkFeature getTargetPrior(Connection dmsConn, java.lang.String modelName)
          Returns the target prior.

 

Methods inherited from class oracle.dmt.odm.model.SupervisedModel
apply, computeLift, getConditionsTableName, getCostMatrixTableName, getNumberOfConditions, getNumberOfPriors, getPriorsTableName, getTargetCategorySet, getTargetValueCount, restore, restore, test

 

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

getNetworkFeatures

public static NetworkFeature[] getNetworkFeatures(Connection dmsConn,
                                                  java.lang.String modelName)
                                                                throws java.sql.SQLException,
MiningObjectException,
InvalidArgumentException,
ODMException
Returns an array of NetworkFeatures.
Parameters:
dmsConn - The connection to the data mining server
modelName - Name of the model from which the network features are extracted
Returns:
the array of network features.
Throws:
InvalidArgumentException -
  • when the dmsConn/modelName are null, or
  • when the modelName length exceeds the limit
MiningObjectException - when the model cannot be opened
java.sql.SQLException - when the model meta data cannot be retrieved
ODMException
Since:
9.2
See Also:
NetworkFeature

getDecisionTree

public static TreeNode[] getDecisionTree(Connection dmsConn,
                                         java.lang.String modelName)
                                                       throws java.sql.SQLException,
MiningObjectException,
InvalidArgumentException,
ODMException
Returns the array of TreeNodes forming a decision tree. In 9.2.0.4, this method is applicable only when the build type is SingleFeatureBuild and it will return an array of only one element, which is the root node of a decision tree.
Parameters:
dmsConn - The connection to the data mining server
modelName - Name of the model from which the tree root node is extracted
Returns:
the array of tree nodes, NULL if model type if not SingleFeatureBuild.
Throws:
InvalidArgumentException -
  • when the dmsConn/modelName are null, or
  • when the modelName length exceeds the limit.
MiningObjectException - when the model cannot be opened
java.sql.SQLException - when the model meta data cannot be retrieved
ODMException
Since:
9.2
See Also:
TreeNode

getRules

public static MiningRuleSet getRules(Connection dmsConn,
                                     java.lang.String modelName)
                                                  throws java.sql.SQLException,
MiningObjectException,
InvalidArgumentException,
ODMException
Returns the decision tree MiningRuleSet. This method is applicable only when the build type is SingleFeatureBuild.
Parameters:
dmsConn - The connection to the data mining server
modelName - Name of the model from which the mining rule set is extracted
Returns:
the mining rule set, NULL if model build type is not SingleFeatureBuild.
Throws:
InvalidArgumentException -
  • when the dmsConn/modelName are null, or
  • when the modelName length exceeds the limit.
MiningObjectException - when the model cannot be opened
java.sql.SQLException - when the model meta data cannot be retrieved
ODMException
Since:
9.2

getTargetPrior

public static NetworkFeature getTargetPrior(Connection dmsConn,
                                            java.lang.String modelName)
                                                          throws java.sql.SQLException,
MiningObjectException,
InvalidArgumentException,
ODMException
Returns the target prior. Each AdaptiveBayesNetworkModel contains a special NetworkFeature, termed the TargetPrior. The TargetPrior is the global (unconditional) probability of the various target values.
Parameters:
dmsConn - The connection to the data mining server
modelName - Name of the model from which the target prior is extracted
Returns:
the target prior.
Throws:
InvalidArgumentException -
  • when the dmsConn/modelName are null, or
  • when the modelName length length exceeds the limit.
MiningObjectException - when the model cannot be opened
java.sql.SQLException - when the model meta data cannot be retrieved
ODMException
Since:
9.2

getModelTimingRecords

public static ModelTimingRecord[] getModelTimingRecords(Connection dmsConn,
                                                        java.lang.String modelName)
                                                                      throws java.sql.SQLException,
MiningObjectException,
InvalidArgumentException,
ODMException
Deprecated. As of ODM 9.2.0.4, this method is not supported.
Returns an array of ModelTimingRecords.
Parameters:
dmsConn - The connection to the data mining server
modelName - Name of the model from which the model timing records are extracted
Returns:
the array of model timing records.
Throws:
InvalidArgumentException -
  • when the dmsConn/modelName are null, or
  • when the modelName length length exceeds the limit.
MiningObjectException - when the model cannot be opened
java.sql.SQLException - when the model meta data cannot be retrieved
ODMException
Since:
9.2
See Also:
ModelTimingRecord

getNumberOfFeaturesBuilt

public static int getNumberOfFeaturesBuilt(Connection dmsConn,
                                           java.lang.String modelName)
                                    throws java.sql.SQLException,
MiningObjectException,
InvalidArgumentException,
ODMException
Returns a number of built network features.
Parameters:
dmsConn - The connection to the data mining server
modelName - Name of the model from which the number of built network features is extracted
Returns:
the number of built network features.
Throws:
InvalidArgumentException -
  • when the dmsConn/modelName are null, or
  • when the modelName length length exceeds the limit.
MiningObjectException - when the model cannot be opened
java.sql.SQLException - when the model meta data cannot be retrieved
ODMException
Since:
9.2.0.4

getNumberOfFeaturesAccepted

public static int getNumberOfFeaturesAccepted(Connection dmsConn,
                                              java.lang.String modelName)
                                       throws java.sql.SQLException,
MiningObjectException,
InvalidArgumentException,
ODMException
Returns a number of accepted network features.
Parameters:
dmsConn - The connection to the data mining server
modelName - Name of the model from which the number of accepted network features is extracted
Returns:
the number of accepted network features.
Throws:
InvalidArgumentException -
  • when the dmsConn/modelName are null, or
  • when the modelName length exceeds the limit.
MiningObjectException - when the model cannot be opened
java.sql.SQLException - when the model meta data cannot be retrieved
ODMException
Since:
9.2.0.4

getAvgFeatureConstructionTime

public static int getAvgFeatureConstructionTime(Connection dmsConn,
                                                java.lang.String modelName)
                                         throws java.sql.SQLException,
MiningObjectException,
InvalidArgumentException,
ODMException
Returns an average time required to construct a network feature in minutes.
Parameters:
dmsConn - The connection to the data mining server
modelName - Name of the model from which the average time required to construct a network feature is extracted
Returns:
the average time required to construct a network feature.
Throws:
InvalidArgumentException -
  • when the dmsConn/modelName are null, or
  • when the modelName length exceeds the limit.
MiningObjectException - when the model cannot be opened
java.sql.SQLException - when the model meta data cannot be retrieved
ODMException
Since:
9.2.0.4

getEstimateTimeToConstructAFeature

public static int getEstimateTimeToConstructAFeature(Connection dmsConn,
                                                     java.lang.String modelName)
                                              throws java.sql.SQLException,
MiningObjectException,
InvalidArgumentException,
ODMException
Returns an estimate of the time required to construct a network feature in minutes.
Parameters:
dmsConn - The connection to the data mining server
modelName - Name of the model from which the estimated time to construct a network feature is extracted
Returns:
the estimate time to construct a network feature in minute.
Throws:
InvalidArgumentException -
  • when the dmsConn/modelName are null, or
  • when the modelName llength exceeds the limit.
MiningObjectException - when the model cannot be opened
java.sql.SQLException - when the model meta data cannot be retrieved
ODMException
Since:
9.2

getModelBuildState

public static ABNModelBuildState getModelBuildState(Connection dmsConn,
                                                    java.lang.String modelName)
                                                            throws java.sql.SQLException,
MiningObjectException,
InvalidArgumentException,
ODMException
Returns an ABNModelBuildState instance indicating the model build state.
Parameters:
dmsConn - The connection to the data mining server
modelName - Name of the model from which the model build state is extracted
Returns:
the model build state.
Throws:
InvalidArgumentException -
  • when the dmsConn/modelName are null, or
  • when the modelName length exceeds the limit.
MiningObjectException - when the model cannot be opened
java.sql.SQLException - when the model meta data cannot be retrieved
ODMException
Since:
9.2
See Also:
ABNModelBuildState

getNumberOfRules

public static int getNumberOfRules(Connection dmsConn,
                                   java.lang.String modelName)
                            throws java.sql.SQLException,
MiningObjectException,
InvalidArgumentException,
ODMException
Returns the number of mining rules. This method is applicable only when the build type is SingleFeatureBuild.
Parameters:
dmsConn - The connection to the data mining server
modelName - Name of the model from which the number of mining rules is extracted
Returns:
the number of mining rules, 0 if model build type is not SingleFeatureBuild.
Throws:
InvalidArgumentException -
  • when the dmsConn/modelName are null, or
  • when the modelName length exceeds the limit.
MiningObjectException - when the model cannot be opened
java.sql.SQLException - when the model meta data cannot be retrieved
ODMException
Since:
9.2.0.4

getRulesByIds

public static MiningRuleSet getRulesByIds(Connection dmsConn,
                                          java.lang.String modelName,
                                          int[] ruleIds)
                                                       throws java.sql.SQLException,
MiningObjectException,
InvalidArgumentException,
ODMException
Returns the MiningRuleSet associated with the array of rule ids. This method is applicable only when the build type is SingleFeatureBuild.
Parameters:
dmsConn - The connection to the data mining server
modelName - Name of the model from which the mining rules are extracted
ruleIds - Array of rule ids of the mining rules
Returns:
the mining rule set, NULL if model build type is not SingleFeatureBuild.
Throws:
InvalidArgumentException -
  • when the dmsConn/modelName are null, or
  • when the modelName length exceeds the limit.
MiningObjectException - when the model cannot be opened
java.sql.SQLException - when the model meta data cannot be retrieved
ODMException
Since:
9.2.0.4

getRuleById

public static ABNMiningRule getRuleById(Connection dmsConn,
                                        java.lang.String modelName,
                                        int ruleId)
                                                     throws java.sql.SQLException,
MiningObjectException,
InvalidArgumentException,
ODMException
Returns the ABNMiningRule associated with the rule id. This method is applicable only when the build type is SingleFeatureBuild.
Parameters:
dmsConn - The connection to the data mining server
modelName - Name of the model from which the mining rule is extracted
ruleId - Rule id of the mining rule
Returns:
the mining rule, NULL if model build type is not SingleFeatureBuild.
Throws:
InvalidArgumentException -
  • when the dmsConn/modelName are null, or
  • when the modelName length exceeds the limit.
MiningObjectException - when the model cannot be opened
java.sql.SQLException - when the model meta data cannot be retrieved
ODMException
Since:
9.2.0.4

apply

public static RecordInstance apply(Connection dmsConn,
RecordInstance record,
                                   java.lang.String modelName)
                                                  throws InvalidArgumentException,
                                                         java.sql.SQLException,
MiningOperationException,
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 -
  • dmsConn is null,
  • record is null, or
  • modelName is null.
ODMException - when modelName is empty or length exceeds the limit
java.sql.SQLException - when an error occurs during the execution of apply operation
MiningOperationException
Since:
9.2.0.2
See Also:
RecordInstance, AttributeInstance

apply

public static RecordInstance apply(Connection dmsConn,
RecordInstance record,
                                   java.lang.String modelName,
MiningApplyOutput applyOutput)
                                                  throws InvalidArgumentException,
                                                         java.sql.SQLException,
MiningOperationException,
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 -
  • dmsConn is null,
  • record is null,
  • modelName is null, or
  • applyOutput is null.
ODMException - when modelName is empty or length exceeds the limit
java.sql.SQLException - when an error occurs during the execution of apply operation
MiningOperationException
Since:
9.2.0.2, 9.2.0
See Also:
RecordInstance, AttributeInstance, MiningApplyOutput

Copyright © 2003 Oracle Corporation. All Rights Reserved.