|
Oracle Data Mining Java API Reference 10g Release 1 (10.1) B12276-01 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
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 NetworkFeature
s. Each NetworkFeature
consists of one or more ConditionalProbabilityExpression
s. The collection of NetworkFeature
s forms a product model that provides estimates of the target class probabilities. There can be one or more NetworkFeature
s. The number and depth of the NetworkFeature
s 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 NetworkFeature
s 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 NetworkFeature
s forms a product model (boosted mode). All three modes provide estimates of the target class probabilities. Rules can be extracted from the AdaptiveBayesNetworkModel
as CompoundPredicate
s. 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.
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 TreeNode s 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 NetworkFeature s. |
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 |
public static NetworkFeature[] getNetworkFeatures(Connection dmsConn, java.lang.String modelName) throws java.sql.SQLException, MiningObjectException, InvalidArgumentException, ODMException
NetworkFeature
s.dmsConn
- The connection to the data mining servermodelName
- Name of the model from which the network features are extractedInvalidArgumentException
-
MiningObjectException
- when the model cannot be openedjava.sql.SQLException
- when the model meta data cannot be retrievedODMException
NetworkFeature
public static TreeNode[] getDecisionTree(Connection dmsConn, java.lang.String modelName) throws java.sql.SQLException, MiningObjectException, InvalidArgumentException, ODMException
TreeNode
s 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.dmsConn
- The connection to the data mining servermodelName
- Name of the model from which the tree root node is extractedInvalidArgumentException
-
MiningObjectException
- when the model cannot be openedjava.sql.SQLException
- when the model meta data cannot be retrievedODMException
TreeNode
public static MiningRuleSet getRules(Connection dmsConn, java.lang.String modelName) throws java.sql.SQLException, MiningObjectException, InvalidArgumentException, ODMException
MiningRuleSet
. This method is applicable only when the build type is SingleFeatureBuild.dmsConn
- The connection to the data mining servermodelName
- Name of the model from which the mining rule set is extractedInvalidArgumentException
-
MiningObjectException
- when the model cannot be openedjava.sql.SQLException
- when the model meta data cannot be retrievedODMException
public static NetworkFeature getTargetPrior(Connection dmsConn, java.lang.String modelName) throws java.sql.SQLException, MiningObjectException, InvalidArgumentException, ODMException
AdaptiveBayesNetworkModel
contains a special NetworkFeature
, termed the TargetPrior. The TargetPrior is the global (unconditional) probability of the various target values.dmsConn
- The connection to the data mining servermodelName
- Name of the model from which the target prior is extractedInvalidArgumentException
-
MiningObjectException
- when the model cannot be openedjava.sql.SQLException
- when the model meta data cannot be retrievedODMException
public static ModelTimingRecord[] getModelTimingRecords(Connection dmsConn, java.lang.String modelName) throws java.sql.SQLException, MiningObjectException, InvalidArgumentException, ODMException
ModelTimingRecord
s.dmsConn
- The connection to the data mining servermodelName
- Name of the model from which the model timing records are extractedInvalidArgumentException
-
MiningObjectException
- when the model cannot be openedjava.sql.SQLException
- when the model meta data cannot be retrievedODMException
ModelTimingRecord
public static int getNumberOfFeaturesBuilt(Connection dmsConn, java.lang.String modelName) throws java.sql.SQLException, MiningObjectException, InvalidArgumentException, ODMException
dmsConn
- The connection to the data mining servermodelName
- Name of the model from which the number of built network features is extractedInvalidArgumentException
-
MiningObjectException
- when the model cannot be openedjava.sql.SQLException
- when the model meta data cannot be retrievedODMException
public static int getNumberOfFeaturesAccepted(Connection dmsConn, java.lang.String modelName) throws java.sql.SQLException, MiningObjectException, InvalidArgumentException, ODMException
dmsConn
- The connection to the data mining servermodelName
- Name of the model from which the number of accepted network features is extractedInvalidArgumentException
-
MiningObjectException
- when the model cannot be openedjava.sql.SQLException
- when the model meta data cannot be retrievedODMException
public static int getAvgFeatureConstructionTime(Connection dmsConn, java.lang.String modelName) throws java.sql.SQLException, MiningObjectException, InvalidArgumentException, ODMException
dmsConn
- The connection to the data mining servermodelName
- Name of the model from which the average time required to construct a network feature is extractedInvalidArgumentException
-
MiningObjectException
- when the model cannot be openedjava.sql.SQLException
- when the model meta data cannot be retrievedODMException
public static int getEstimateTimeToConstructAFeature(Connection dmsConn, java.lang.String modelName) throws java.sql.SQLException, MiningObjectException, InvalidArgumentException, ODMException
dmsConn
- The connection to the data mining servermodelName
- Name of the model from which the estimated time to construct a network feature is extractedInvalidArgumentException
-
MiningObjectException
- when the model cannot be openedjava.sql.SQLException
- when the model meta data cannot be retrievedODMException
public static ABNModelBuildState getModelBuildState(Connection dmsConn, java.lang.String modelName) throws java.sql.SQLException, MiningObjectException, InvalidArgumentException, ODMException
ABNModelBuildState
instance indicating the model build state.dmsConn
- The connection to the data mining servermodelName
- Name of the model from which the model build state is extractedInvalidArgumentException
-
MiningObjectException
- when the model cannot be openedjava.sql.SQLException
- when the model meta data cannot be retrievedODMException
ABNModelBuildState
public static int getNumberOfRules(Connection dmsConn, java.lang.String modelName) throws java.sql.SQLException, MiningObjectException, InvalidArgumentException, ODMException
dmsConn
- The connection to the data mining servermodelName
- Name of the model from which the number of mining rules is extractedInvalidArgumentException
-
MiningObjectException
- when the model cannot be openedjava.sql.SQLException
- when the model meta data cannot be retrievedODMException
public static MiningRuleSet getRulesByIds(Connection dmsConn, java.lang.String modelName, int[] ruleIds) throws java.sql.SQLException, MiningObjectException, InvalidArgumentException, ODMException
MiningRuleSet
associated with the array of rule ids. This method is applicable only when the build type is SingleFeatureBuild.dmsConn
- The connection to the data mining servermodelName
- Name of the model from which the mining rules are extractedruleIds
- Array of rule ids of the mining rulesInvalidArgumentException
-
MiningObjectException
- when the model cannot be openedjava.sql.SQLException
- when the model meta data cannot be retrievedODMException
public static ABNMiningRule getRuleById(Connection dmsConn, java.lang.String modelName, int ruleId) throws java.sql.SQLException, MiningObjectException, InvalidArgumentException, ODMException
ABNMiningRule
associated with the rule id. This method is applicable only when the build type is SingleFeatureBuild.dmsConn
- The connection to the data mining servermodelName
- Name of the model from which the mining rule is extractedruleId
- Rule id of the mining ruleInvalidArgumentException
-
MiningObjectException
- when the model cannot be openedjava.sql.SQLException
- when the model meta data cannot be retrievedODMException
public static RecordInstance apply(Connection dmsConn, RecordInstance record, java.lang.String modelName) throws InvalidArgumentException, java.sql.SQLException, MiningOperationException, ODMException
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.record
- An instance of RecordInstance
for input to applymodelName
- The model name to be used for applyRecordInstance
that contains two attribute instances: score
and probability
of the top prediction.InvalidArgumentException
-
dmsConn
is null,record
is null, ormodelName
is null.ODMException
- when modelName
is empty or length exceeds the limitjava.sql.SQLException
- when an error occurs during the execution of apply operationMiningOperationException
RecordInstance
, AttributeInstance
public static RecordInstance apply(Connection dmsConn, RecordInstance record, java.lang.String modelName, MiningApplyOutput applyOutput) throws InvalidArgumentException, java.sql.SQLException, MiningOperationException, ODMException
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.record
- An instance of RecordInstance
for input to applymodelName
- The model name to be used for applyapplyOutput
- A specification on the format of apply outputRecordInstance
that contains attribute instances based on the specification in applyOutput
InvalidArgumentException
-
dmsConn
is null,record
is null,modelName
is null, orapplyOutput
is null.ODMException
- when modelName
is empty or length exceeds the limitjava.sql.SQLException
- when an error occurs during the execution of apply operationMiningOperationException
RecordInstance
, AttributeInstance
, MiningApplyOutput
|
| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |