25 Creating a Model

Explains how to create data mining models and query model details.

25.1 Before Creating a Model

Explains the preparation steps before creating a model.

Models are database schema objects that perform data mining. The DBMS_DATA_MINING PL/SQL package is the API for creating, configuring, evaluating, and querying mining models (model details).

Before you create a model, you must decide what you want the model to do. You must identify the training data and determine if transformations are required. You can specify model settings to influence the behavior of the model behavior. The preparation steps are summarized in the following table.

Table 25-1 Preparation for Creating a Mining Model

Preparation Step Description

Choose the mining function

See "Choosing the Mining Function"

Choose the algorithm

See "Choosing the Algorithm"

Identify the build (training) data

See "Preparing the Data"

For classification models, identify the test data

See "Data Sets for Classification and Regression"

Determine your data transformation strategy

See " Transforming the Data"

Create and populate a settings tables (if needed)

See "Specifying Model Settings"

25.2 The CREATE_MODEL Procedure

The CREATE_MODEL procedure in the DBMS_DATA_MINING package uses the specified data to create a mining model with the specified name and mining function. The model can be created with configuration settings and user-specified transformations.

PROCEDURE CREATE_MODEL(
                  model_name            IN VARCHAR2,
                  mining_function       IN VARCHAR2,
                  data_table_name       IN VARCHAR2,
                  case_id_column_name   IN VARCHAR2,
                  target_column_name    IN VARCHAR2 DEFAULT NULL,
                  settings_table_name   IN VARCHAR2 DEFAULT NULL,
                  data_schema_name      IN VARCHAR2 DEFAULT NULL,
                  settings_schema_name  IN VARCHAR2 DEFAULT NULL,
                  xform_list            IN TRANSFORM_LIST DEFAULT NULL);

25.2.1 Choosing the Mining Function

Explains about providing mining function to CREATE_MODEL.

The mining function is a required argument to the CREATE_MODEL procedure. A data mining function specifies a class of problems that can be modeled and solved.

Data mining functions implement either supervised or unsupervised learning. Supervised learning uses a set of independent attributes to predict the value of a dependent attribute or target. Unsupervised learning does not distinguish between dependent and independent attributes. Supervised functions are predictive. Unsupervised functions are descriptive.

Note:

In data mining terminology, a function is a general type of problem to be solved by a given approach to data mining. In SQL language terminology, a function is an operator that returns a value.

In Oracle Data Mining documentation, the term function, or mining function refers to a data mining function; the term SQL function or SQL Data Mining function refers to a SQL function for scoring (applying data mining models).

You can specify any of the values in the following table for the mining_function parameter to CREATE_MODEL.

Table 25-2 Mining Model Functions

Mining_Function Value Description

ASSOCIATION

Association is a descriptive mining function. An association model identifies relationships and the probability of their occurrence within a data set. (association rules)

Association models use the Apriori algorithm.

ATTRIBUTE_IMPORTANCE

Attribute Importance is a predictive mining function. An attribute importance model identifies the relative importance of attributes in predicting a given outcome.

Attribute Importance models use the Minimum Description Length algorithm.

CLASSIFICATION

Classification is a predictive mining function. A classification model uses historical data to predict a categorical target.

Classification models can use Naive Bayes, Decision Tree, Logistic Regression, or Support Vector Machines. The default is Naive Bayes.

The classification function can also be used for anomaly detection. In this case, the SVM algorithm with a null target is used (One-Class SVM).

CLUSTERING

Clustering is a descriptive mining function. A clustering model identifies natural groupings within a data set.

Clustering models can use k-Means, O-Cluster, or Expectation Maximization. The default is k-Means.

FEATURE_EXTRACTION

Feature Extraction is a descriptive mining function. A feature extraction model creates a set of optimized attributes.

Feature extraction models can use Non-Negative Matrix Factorization, Singular Value Decomposition (which can also be used for Principal Component Analysis) or Explicit Semantic Analysis. The default is Non-Negative Matrix Factorization.

REGRESSION

Regression is a predictive mining function. A regression model uses historical data to predict a numerical target.

Regression models can use Support Vector Machines or Linear Regression. The default is Support Vector Machine.

25.2.2 Choosing the Algorithm

Learn about providing the algorithm settings for a model.

The ALGO_NAME setting specifies the algorithm for a model. If you use the default algorithm for the mining function, or if there is only one algorithm available for the mining function, you do not need to specify the ALGO_NAME setting. Instructions for specifying model settings are in "Specifying Model Settings".

Table 25-3 Data Mining Algorithms

ALGO_NAME Value Algorithm Default? Mining Model Function

ALGO_AI_MDL

Minimum Description Length

attribute importance

ALGO_APRIORI_ASSOCIATION_RULES

Apriori

association

ALGO_DECISION_TREE

Decision Tree

classification

ALGO_EXPECTATION_MAXIMIZATION

Expectation Maximization

ALGO_EXPLICIT_SEMANTIC_ANALYS

Explicit Semantic Analysis

feature extraction

ALGO_EXTENSIBLE_LANG Language used for extensible algorithm

All mining functions are supported

ALGO_GENERALIZED_LINEAR_MODEL

Generalized Linear Model

classification and regression

ALGO_KMEANS

k-Means

yes

clustering

ALGO_NAIVE_BAYES

Naive Bayes

yes

classification

ALGO_NONNEGATIVE_MATRIX_FACTOR

Non-Negative Matrix Factorization

yes

feature extraction

ALGO_O_CLUSTER

O-Cluster

clustering

ALGO_SINGULAR_VALUE_DECOMP

Singular Value Decomposition (can also be used for Principal Component Analysis)

feature extraction

ALGO_SUPPORT_VECTOR_MACHINES

Support Vector Machine

yes

default regression algorithm

regression, classification, and anomaly detection (classification with no target)

25.2.3 Supplying Transformations

You can optionally specify transformations for the build data in the xform_list parameter to CREATE_MODEL. The transformation instructions are embedded in the model and reapplied whenever the model is applied to new data.

25.2.3.1 Creating a Transformation List

The following are the ways to create a transformation list:

  • The STACK interface in DBMS_DATA_MINING_TRANSFORM.

    The STACK interface offers a set of pre-defined transformations that you can apply to an attribute or to a group of attributes. For example, you can specify supervised binning for all categorical attributes.

  • The SET_TRANSFORM procedure in DBMS_DATA_MINING_TRANSFORM.

    The SET_TRANSFORM procedure applies a specified SQL expression to a specified attribute. For example, the following statement appends a transformation instruction for country_id to a list of transformations called my_xforms. The transformation instruction divides country_id by 10 before algorithmic processing begins. The reverse transformation multiplies country_id by 10.

      dbms_data_mining_transform.SET_TRANSFORM (my_xforms,
         'country_id', NULL, 'country_id/10', 'country_id*10');
    

    The reverse transformation is applied in the model details. If country_id is the target of a supervised model, the reverse transformation is also applied to the scored target.

25.2.3.2 Transformation List and Automatic Data Preparation

Understand the interaction between transformation list and Automatic Data Preparation (ADP).

The transformation list argument to CREATE_MODEL interacts with the PREP_AUTO setting, which controls ADP:

  • When ADP is on and you specify a transformation list, your transformations are applied with the automatic transformations and embedded in the model. The transformations that you specify are executed before the automatic transformations.

  • When ADP is off and you specify a transformation list, your transformations are applied and embedded in the model, but no system-generated transformations are performed.

  • When ADP is on and you do not specify a transformation list, the system-generated transformations are applied and embedded in the model.

  • When ADP is off and you do not specify a transformation list, no transformations are embedded in the model; you must separately prepare the data sets you use for building, testing, and scoring the model.

25.2.4 About Partitioned Model

Oracle Data Mining supports building of a persistent Oracle Data Mining partitioned model. A partitioned model organizes and represents multiple models as partitions in a single model entity, enabling a user to easily build and manage models tailored to independent slices of data.

Persistent means that the partitioned model has an on-disk representation. The product manages the organization of the partitioned model and simplifies the process of scoring the partitioned model. You must include the partition columns as part of the USING clause when scoring.

The partition names, key values, and the structure of the partitioned model are visible in the ALL_MINING_MODEL_PARTITIONS view.

See Also:

25.2.4.1 Partitioned Model Build Process

To build a Partitioned Model, Oracle Data Mining requires a partitioning key. The partition key is set through a build setting in the settings table.

The partitioning key is a comma-separated list of one or more columns (up to 16) from the input data set. The partitioning key horizontally slices the input data based on discrete values of the partitioning key. That is, partitioning is performed as list values as opposed to range partitioning against a continuous value. The partitioning key supports only columns of the data type NUMBER and VARCHAR2.

During the build process the input data set is partitioned based on the distinct values of the specified key. Each data slice (unique key value) results in its own model partition. This resultant model partition is not separate and is not visible to you as a standalone model. The default value of the maximum number of partitions for partitioned models is 1000 partitions. You can also set a different maximum partitions value. If the number of partitions in the input data set exceed the defined maximum, Oracle Data Mining throws an exception.

The Partitioned Model organizes features common to all partitions and the partition specific features. The common features consist of the following metadata:

  • The model name

  • The mining function

  • The mining algorithm

  • A super set of all mining model attributes referenced by all partitions (signature)

  • A common set of user-defined column transformations

  • Any user-specified or default build settings that are interpreted as global. For example, the Auto Data Preparation (ADP) setting

25.2.4.2 DDL in Partitioned model
Partitioned models are maintained through the following DDL operations:
25.2.4.2.1 Drop Model or Drop Partition

Oracle Data Mining supports dropping a single model partition for a given partition name.

If only a single partition remains, you cannot explicitly drop that partition. Instead, you must either add additional partitions prior to dropping the partition or you may choose to drop the model itself. When dropping a partitioned model, all partitions are dropped in a single atomic operation. From a performance perspective, Oracle recommends DROP_PARTITION followed by an ADD_PARTITION instead of leveraging the REPLACE option due to the efficient behavior of the DROP_PARTITION option.

25.2.4.2.2 Add Partition

Oracle Data Mining supports adding a single partition or multiple partitions to an existing partitioned model.

The addition occurs based on the input data set and the name of the existing partitioned model. The operation takes the input data set and the existing partitioned model as parameters. The partition keys are extracted from the input data set and the model partitions are built against the input data set. These partitions are added to the partitioned model. In the case where partition keys for new partitions conflict with the existing partitions in the model, you can select from the following three approaches to resolve the conflicts:

  • ERROR: Terminates the ADD operation without adding any partitions.

  • REPLACE: Replaces the existing partition for which the conflicting keys are found.

  • IGNORE: Eliminates the rows having the conflicting keys.

If the input data set contains multiple keys, then the operation creates multiple partitions. If the total number of partitions in the model increases to more than the user-defined maximum specified when the model was created, then you get an error. The default threshold value for the number of partitions is 1000.

25.2.4.3 Partitioned Model scoring

Learn about scoring of a partitioned model.

The scoring of the partitioned model is the same as that of the non-partitioned model. The syntax of the data mining function remains the same but is extended to provide an optional hint to you. The optional hint can impact the performance of a query which involves scoring a partitioned model.

For scoring a partitioned model, the signature columns used during the build for the partitioning key must be present in the scoring data set. These columns are combined to form a unique partition key. The unique key is then mapped to a specific underlying model partition, and the identified model partition is used to score that row.

The partitioned objects that are necessary for scoring are loaded on demand during the query execution and are aged out depending on the System Global Area (SGA) memory.

25.3 Specifying Model Settings

Understand how to configure data mining models at build time.

Numerous configuration settings are available for configuring data mining models at build time. To specify settings, create a settings table with the columns shown in the following table and pass the table to CREATE_MODEL.

Table 25-4 Settings Table Required Columns

Column Name Data Type

setting_name

VARCHAR2(30)

setting_value

VARCHAR2(4000)

Example 25-1 creates a settings table for an Support Vector Machine (SVM) Classification model. Since SVM is not the default classifier, the ALGO_NAME setting is used to specify the algorithm. Setting the SVMS_KERNEL_FUNCTION to SVMS_LINEAR causes the model to be built with a linear kernel. If you do not specify the kernel function, the algorithm chooses the kernel based on the number of attributes in the data.

Some settings apply generally to the model, others are specific to an algorithm. Model settings are referenced in Table 25-5 and Table 25-6.

Table 25-5 General Model Settings

Settings Description

Mining function settings

See "Mining Function Settings" in Oracle Database PL/SQL Packages and Types Reference

Algorithm names

See "Algorithm Names" in Oracle Database PL/SQL Packages and Types Reference

Global model characteristics

See "Global Settings" in Oracle Database PL/SQL Packages and Types Reference

Automatic Data Preparation

See "Automatic Data Preparation" in Oracle Database PL/SQL Packages and Types Reference

Table 25-6 Algorithm-Specific Model Settings

Algorithm Description

Decision Tree

See "Algorithm Settings: Decision Tree" in Oracle Database PL/SQL Packages and Types Reference

Expectation Maximization

See "Algorithm Settings: Expectation Maximization" in Oracle Database PL/SQL Packages and Types Reference

Explicit Semantic Analysis

See “Algorithm Settings: Explicit Semantic Analysis” in Oracle Database PL/SQL Packages and Types Reference

Generalized Linear Models

See "Algorithm Settings: Generalized Linear Models" in Oracle Database PL/SQL Packages and Types Reference

k-Means

See "Algorithm Settings: k-Means" in Oracle Database PL/SQL Packages and Types Reference

Naive Bayes

See "Algorithm Settings: Naive Bayes" in Oracle Database PL/SQL Packages and Types Reference

Non-Negative Matrix Factorization

See "Algorithm Settings: Non-Negative Matrix Factorization" in Oracle Database PL/SQL Packages and Types Reference

O-Cluster

See "Algorithm Settings: O-Cluster" in Oracle Database PL/SQL Packages and Types Reference

Singular Value Decomposition

See "Algorithm Settings: Singular Value Decomposition" in Oracle Database PL/SQL Packages and Types Reference

Support Vector Machine

See "Algorithm Settings: Support Vector Machine" in Oracle Database PL/SQL Packages and Types Reference

Example 25-1 Creating a Settings Table for an SVM Classification Model

CREATE TABLE svmc_sh_sample_settings (
  setting_name VARCHAR2(30),
  setting_value VARCHAR2(4000));

BEGIN 
  INSERT INTO svmc_sh_sample_settings (setting_name, setting_value) VALUES
    (dbms_data_mining.algo_name, dbms_data_mining.algo_support_vector_machines);
  INSERT INTO svmc_sh_sample_settings (setting_name, setting_value) VALUES
    (dbms_data_mining.svms_kernel_function, dbms_data_mining.svms_linear);
  COMMIT;
END;
/

25.3.1 Specifying Costs

Specify a cost matrix table to build a Decision Tree model.

The CLAS_COST_TABLE_NAME setting specifies the name of a cost matrix table to be used in building a Decision Tree model. A cost matrix biases a classification model to minimize costly misclassifications. The cost matrix table must have the columns shown in the following table:

Table 25-7 Cost Matrix Table Required Columns

Column Name Data Type

actual_target_value

valid target data type

predicted_target_value

valid target data type

cost

NUMBER

Decision Tree is the only algorithm that supports a cost matrix at build time. However, you can create a cost matrix and associate it with any classification model for scoring.

If you want to use costs for scoring, create a table with the columns shown in Table 25-7, and use the DBMS_DATA_MINING.ADD_COST_MATRIX procedure to add the cost matrix table to the model. You can also specify a cost matrix inline when invoking a PREDICTION function. Table 23-1 has details for valid target data types.

25.3.2 Specifying Prior Probabilities

Prior probabilities can be used to offset differences in distribution between the build data and the actual population.

The CLAS_PRIORS_TABLE_NAME setting specifies the name of a table of prior probabilities to be used in building a Naive Bayes model. The priors table must have the columns shown in the following table.

Table 25-8 Priors Table Required Columns

Column Name Data Type

target_value

valid target data type

prior_probability

NUMBER

25.3.3 Specifying Class Weights

Specify class weights table settings in Logistic Regression or Support Vector Machine (SVM) Classification to favour higher weighted classes.

The CLAS_WEIGHTS_TABLE_NAME setting specifies the name of a table of class weights to be used to bias a logistic regression (Generalized Linear Model Classification) or SVM Classification model to favor higher weighted classes. The weights table must have the columns shown in the following table.

Table 25-9 Class Weights Table Required Columns

Column Name Data Type

target_value

valid target data type

class_weight

NUMBER

25.3.4 Model Settings in the Data Dictionary

Explains about ALL/USER/DBA_MINING_MODEL_SETTINGS in data dictionary view.

Information about mining model settings can be obtained from the data dictionary view ALL/USER/DBA_MINING_MODEL_SETTINGS. When used with the ALL prefix, this view returns information about the settings for the models accessible to the current user. When used with the USER prefix, it returns information about the settings for the models in the user's schema. The DBA prefix is only available for DBAs.

The columns of ALL_MINING_MODEL_SETTINGS are described as follows and explained in the following table.

SQL> describe all_mining_model_settings
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 OWNER                                     NOT NULL VARCHAR2(30)
 MODEL_NAME                                NOT NULL VARCHAR2(30)
 SETTING_NAME                              NOT NULL VARCHAR2(30)
 SETTING_VALUE                                      VARCHAR2(4000)
 SETTING_TYPE                                       VARCHAR2(7)

Table 25-10 ALL_MINING_MODEL_SETTINGS

Column Description

owner

Owner of the mining model.

model_name

Name of the mining model.

setting_name

Name of the setting.

setting_value

Value of the setting.

setting_type

INPUT if the value is specified by a user. DEFAULT if the value is system-generated.

The following query lists the settings for the Support Vector Machine (SVM) Classification model SVMC_SH_CLAS_SAMPLE. The ALGO_NAME, CLAS_WEIGHTS_TABLE_NAME, and SVMS_KERNEL_FUNCTION settings are user-specified. These settings have been specified in a settings table for the model.

Example 25-2 ALL_MINING_MODEL_SETTINGS

SQL> COLUMN setting_value FORMAT A35
SQL> SELECT setting_name, setting_value, setting_type
            FROM all_mining_model_settings
            WHERE model_name in 'SVMC_SH_CLAS_SAMPLE';
 
SETTING_NAME                   SETTING_VALUE                       SETTING
------------------------------ ----------------------------------- -------
SVMS_ACTIVE_LEARNING           SVMS_AL_ENABLE                      DEFAULT
PREP_AUTO                      OFF                                 DEFAULT
SVMS_COMPLEXITY_FACTOR         0.244212                            DEFAULT
SVMS_KERNEL_FUNCTION           SVMS_LINEAR                         INPUT
CLAS_WEIGHTS_TABLE_NAME        svmc_sh_sample_class_wt             INPUT
SVMS_CONV_TOLERANCE            .001                                DEFAULT
ALGO_NAME                      ALGO_SUPPORT_VECTOR_MACHINES        INPUT

25.3.5 Specifying Mining Model Settings for R Model

The mining model settings for R model determine the characteristics of the model. You can specify the mining model settings in the mining_model_table.

You can build R models with the mining model settings by combining together generic settings that do not require an algorithm, such as ODMS_PARTITION_COLUMNS and ODMS_SAMPLING. The following settings are exclusive to R mining model, and they allow you to specify the R Mining model:

Related Topics

25.3.5.1 ALGO_EXTENSIBLE_LANG

Use the ALGO_EXTENSIBLE_LANG setting to specify the Oracle Data Mining framework with extensible algorithms.

Currently, R is the only valid value for ALGO_EXTENSIBLE_LANG. When the value for ALGO_EXTENSIBLE_LANG is set to R, the mining models are built using the R language. You can use the following settings in the model_setting_table to specify the build, score, and view of the R model.

Related Topics

25.3.5.2 RALG_BUILD_FUNCTION

Use the RALG_BUILD_FUNCTION to specify the name of an existing registered R script for R algorithm mining model build.

You must specify both RALG_BUILD_FUNCTION and ALGO_EXTENSIBLE_LANG in the model_setting_table. The R script defines an R function that has the first input argument of data.frame for training data, and it returns an R model object. The first data argument is mandatory. The RALG_BUILD_FUNCTION can accept additional model build parameters.

Note:

The valid inputs for input parameters are numeric and string scalar data types.

Example 25-3 Example of RALG_BUILD_FUNCTION

This example shows how to specify the name of the R script MY_LM_BUILD_SCRIPT that is used to build the model in the model_setting_table.

Begin
insert into model_setting_table values
(dbms_data_mining.ralg_build_function,'MY_LM_BUILD_SCRIPT');
End;
/ 

The R script MY_LM_BUILD_SCRIPT defines an R function that builds the LM model. You must register the script MY_LM_BUILD_SCRIPT in the R script repository which uses the existing ORE security restrictions. You can use Oracle R Enterprise API sys.rqScriptCreate to register the script. Oracle R Enterprise requires the RQADMIN role to register R scripts.

For example:

Begin
sys.rqScriptCreate('MY_LM_BUILD_SCRIPT', 'function(data, formula, model.frame) {lm(formula = formula, data=data, model = as.logical(model.frame)}');
End;
/

For Clustering and Feature Extraction mining function model build, the R attributes dm$nclus and dm$nfeat must be set on the return R model to indicate the number of clusters and features respectively.

The R script MY_KM_BUILD_SCRIPT defines an R function that builds the k-Means model for Clustering. R attribute dm$nclus is set with the number of clusters for the return Clustering model.

'function(dat) {dat.scaled <- scale(dat)
     set.seed(6543); mod <- list()
     fit <- kmeans(dat.scaled, centers = 3L)
     mod[[1L]] <- fit
     mod[[2L]] <- attr(dat.scaled, "scaled:center")
     mod[[3L]] <- attr(dat.scaled, "scaled:scale")
     attr(mod, "dm$nclus") <- nrow(fit$centers)
     mod}'

The R script MY_PCA_BUILD_SCRIPT defines an R function that builds the PCA model. R attribute dm$nfeat is set with the number of features for the return feature extraction model.

'function(dat) {
     mod <- prcomp(dat, retx = FALSE)
     attr(mod, "dm$nfeat") <- ncol(mod$rotation)
     mod}'
25.3.5.2.1 RALG_BUILD_PARAMETER

The RALG_BUILD_FUNCTION input parameter specifies a list of numeric and string scalar values in SQL SELECT query statement format.

Example 25-4 Example of RALG_BUILD_PARAMETER

The RALG_BUILD_FUNCTION input parameters must be a list of numeric and string scalar values. The input parameters are optional.

The syntax of the parameter is:
'SELECT value parameter name ...FROM dual'
This example shows how to specify a formula for the input argument 'formula' and a numeric value zero for input argument 'model.frame' using the RALG_BUILD_PARAMETER. These input arguments must match with the function signature of the R script used in RALG_BUILD_FUNCTION Parameter.
Begin
insert into model_setting_table values
(dbms_data_mining.ralg_build_parameter, 'select ''AGE ~ .'' as "formula", 0 as "model.frame" from dual');
End;
/

Related Topics

25.3.5.3 RALG_DETAILS_FUNCTION

The RALG_DETAILS_FUNCTION specifies the R model metadata that is returned in the data.frame.

Use the RALG_DETAILS_FUNCTION to specify an existing registered R script that generates model information. The specified R script defines an R function that contains the first input argument for the R model object. The output of the R function must be a data.frame. The columns of the data.frame are defined by RALG_DETAILS_FORMAT, and can contain only numeric or string scalar types.

Example 25-5 Example of RALG_DETAILS_FUNCTION

This example shows how to specify the name of the R script MY_LM_DETAILS_SCRIPT in the model_setting_table. This script defines the R function that is used to provide the model information.
Begin
insert into model_setting_table values
(dbms_data_mining.ralg_details_function, 'MY_LM_DETAILS_SCRIPT');
End;
/
In the R script repository, the script MY_LM_DETAILS_SCRIPT is registered as:
 'function(mod) data.frame(name=names(mod$coefficients),
    coef=mod$coefficients)'
25.3.5.3.1 RALG_DETAILS_FORMAT

Use the RALG_DETAILS_FORMAT parameter to specify the names and column types in the model view. It is a string that contains a SELECT query to specify a list of numeric and string scalar data types for the name and type of the model view columns.

When RALG_DETAILS_FORMAT and RALG_DETAILS_FUNCTION are both specified, a model view by the name DM$VD <model_name> is created along with an R model in the current schema. The first column of the model view is PARTITION_NAME. It has NULL value for non-partitioned models. The other columns of the model view are defined by RALG_DETATLS_FORMAT.

Example 25-6 Example of RALG_DETAILS_FORMAT

This example shows how to specify the name and type of the columns for the generated model view. The model view contains varchar2 column attr_name and number column coef_value after the first column partition_name.
Begin
insert into model_setting_table values
(dbms_data_mining.ralg_details_format, 'select cast(''a'' as varchar2(20)) as attr_name, 0 as coef_value from dual');
End;
/

Related Topics

25.3.5.4 RALG_SCORE_FUNCTION

Use the RALG_SCORE_FUNCTION to specify an existing registered R script for R algorithm mining model score in the mining_model_table.

The specified R script defines an R function. The first input argument defines the model object. The second input argument defines the data.frame that is used for scoring data.

Example 25-7 Example of RALG_SCORE_FUNCTION

This example shows how the function takes the R model and scores the data in the data.frame. The argument object is the R Linear Model. The argument newdata contains scoring data in the data.frame.
function(object, newdata) {res <- predict.lm(object, newdata = newdata, se.fit = TRUE); data.frame(fit=res$fit, se=res$se.fit, df=summary(object)$df[1L])}

In this example,

  • object indicates the LM model

  • newdata indicates the scoring data.frame

The output of the specified R function must be a data.frame. Each row represents the prediction for the corresponding scoring data from the input data.frame. The columns of the data.frame are specific to mining functions, such as:

Regression: A single numeric column for predicted target value, with two optional columns containing standard error of model fit, and the degrees of freedom number. The optional columns are needed for query function PREDICTION_BOUNDS to work.

Example 25-8 Example of RALG_SCORE_FUNCTION for Regression

This example shows how to specify the name of the R script MY_LM_PREDICT_SCRIPT that is used to score the model in the model_setting_table.

Begin
insert into model_setting_table values
(dbms_data_mining.ralg_score_function, 'MY_LM_PREDICT_SCRIPT');
End;
/
In the R script repository, the script MY_LM_PREDICT_SCRIPT is registered as:
function(object, newdata) {data.frame(pre = predict(object, newdata = newdata))}

Classification: Each column represents the predicted probability of one target class. The column name is the target class name.

Example 25-9 Example of RALG_SCORE_FUNCTION for Classification

This example shows how to specify the name of the R script MY_LOGITGLM_PREDICT_SCRIPT that is used to score the logit Classification model in the model_setting_table.

Begin
insert into model_setting_table values
(dbms_data_mining.ralg_score_function, 'MY_LOGITGLM_PREDICT_SCRIPT');
End;
/
In the R script repository, MY_LOGITGLM_PREDICT_SCRIPT is registered as follows. It is a logit Classification with two target class "0" and "1".
'function(object, newdata) {
   pred <- predict(object, newdata = newdata, type="response");
   res <- data.frame(1-pred, pred);
   names(res) <- c("0", "1");
   res}'

Clustering: Each column represents the predicted probability of one cluster. The columns are arranged in order of cluster ID. Each cluster is assigned a cluster ID, and they are consecutive values starting from 1. To support CLUSTER_DISTANCE in the R model, the output of R score function returns extra column containing the value of the distance to each cluster in order of cluster ID after the columns for the predicted probability.

Example 25-10 Example of RALG_SCORE_FUNCTION for Clustering

This example shows how to specify the name of the R script MY_CLUSTER_PREDICT_SCRIPT that is used to score the model in the model_setting_table.

Begin
insert into model_setting_table values
(dbms_data_mining.ralg_score_function, 'MY_CLUSTER_PREDICT_SCRIPT');
End;
/
In the R script repository, the script MY_CLUSTER_PREDICT_SCRIPT is registered as:
'function(object, dat){
     mod <- object[[1L]]; ce <- object[[2L]]; sc <- object[[3L]];
     newdata = scale(dat, center = ce, scale = sc);
     centers <- mod$centers;
     ss <- sapply(as.data.frame(t(centers)),
     function(v) rowSums(scale(newdata, center=v, scale=FALSE)^2));
     if (!is.matrix(ss)) ss <- matrix(ss, ncol=length(ss));
     disp <- -1 / (2* mod$tot.withinss/length(mod$cluster));
     distr <- exp(disp*ss);
     prob <- distr / rowSums(distr);
     as.data.frame(cbind(prob, sqrt(ss)))}'
This function fetches the centers of the clusters from the R model, and computes the probabilities for belonging to each cluster based on the distance of the score data to the corresponding cluster center.

Feature Extraction: Each column represents the coefficient value of one feature. The columns are arranged in order of feature ID. Each feature is assigned a feature ID, and they are consecutive values starting from 1.

Example 25-11 Example of RALG_SCORE_FUNCTION for Feature Extraction

This example shows how to specify the name of the R script MY_FEATURE_EXTRACTION_SCRIPT that is used to score the model in the model_setting_table.

Begin
insert into model_setting_table values
(dbms_data_mining.ralg_score_function, 'MY_FEATURE_EXTRACTION_SCRIPT');
End;
/
In the R script repository, the script MY_FEATURE_EXTRACTION_SCRIPT is registered as:
 'function(object, dat) { as.data.frame(predict(object, dat)) }'

The function fetches the centers of the features from the R model, and computes the feature coefficient based on the distance of the score data to the corresponding feature center.

Related Topics

25.3.5.5 RALG_WEIGHT_FUNCTION

Use the RALG_WEIGHT_FUNCTION to specify the name of an existing registered R script that computes weight or contribution for each attribute in scoring. The specified R script is used in the query function PREDICTION_DETAILS to evaluate attribute contribution.

The specified R script defines an R function containing the first input argument for model object, and the second input argument of data.frame for scoring data. When the mining function is Classification, Clustering, or Feature Extraction, the target class name or cluster ID or feature ID is passed by the third input argument to compute the weight for that particular class or cluster or feature. The script returns a data.frame containing the contributing weight for each attribute in a row. Each row corresponds to that input scoring data.frame.

Example 25-12 Example of RALG_WEIGHT_FUNCTION

This example shows how to specify the name of the R script MY_PREDICT_WEIGHT_SCRIPT that computes weight or contribution of R model attributes in the model_setting_table.
Begin
insert into model_setting_table values
(dbms_data_mining.ralg_weight_function, 'MY_PREDICT_WEIGHT_SCRIPT');
End;
/
In the R script repository, the script MY_PREDICT_WEIGHT_SCRIPT for Regression is registered as:
'function(mod, data) { coef(mod)[-1L]*data }'
In the R script repository, the script MY_PREDICT_WEIGHT_SCRIPT for logit Classification is registered as:
'function(mod, dat, clas) {
   v <- predict(mod, newdata=dat, type = "response");
   v0 <- data.frame(v, 1-v); names(v0) <- c("0", "1");
   res <- data.frame(lapply(seq_along(dat),
   function(x, dat) {
   if(is.numeric(dat[[x]])) dat[,x] <- as.numeric(0)
   else dat[,x] <- as.factor(NA);
   vv <- predict(mod, newdata = dat, type = "response");
   vv = data.frame(vv, 1-vv); names(vv) <- c("0", "1");
   v0[[clas]] / vv[[clas]]}, dat = dat));
   names(res) <- names(dat);
   res}'

Related Topics

25.3.5.6 Registered R Scripts

The RALG_*_FUNCTION must specify R scripts that exist in the R script repository. You can register the R scripts using Oracle R Enterprise.

The RALG_*_FUNCTION includes the following functions:

  • RALG_BUILD_FUNCTION

  • RALG_DETAILS_FUNCTION

  • RALG_SCORE_FUNCTION

  • RALG_WEIGHT_FUNCTION

Note:

The R scripts must exist in the R script repository for an R model to function.

You can register the R scripts through Oracle Enterprise R (ORE). To register R scripts, you must have the RQADMIN role. After an R model is built, the names of these specified R scripts become model settings. These R scripts must exist in the R script repository for an R model to remain functional.

You can manage the R memory that is used to build, score, and view the R models through Oracle Enterprise R as well.

25.3.5.7 R Model Demonstration Scripts

You can access R model demonstration scripts under rdbms/demo

dmraidemo.sql  dmrglmdemo.sql dmrpcademo.sql
dmrardemo.sql  dmrkmdemo.sql  dmrrfdemo.sql
dmrdtdemo.sql  dmrnndemo.sql 

25.4 Model Detail Views

The GET_* interfaces are replaced by model views, and Oracle recommends that users leverage the views instead.

The following are the new model views:

Association:

Classification, Regression, and Anomaly Detection:

Clustering:

Feature Extraction:

Feature Selection:

Data Preparation and Other:

25.4.1 Model Detail Views for Association Rules

Model detail views for Association Rules describes the rule view for Association Rules. Oracle recommends that users leverage the model details views instead of the GET_ASSOCIATION_RULES function.

The rule view DM$VRmodel_name describes the generated rules for Association Rules. Depending on the settings of the model, the rule has different set of columns. The following views are displayed when different Global settings are applied without aggregates for transactional and 2–Dimensional inputs.

Transactional Input Without ASSO_AGGREGATES Setting

When ODMS_ITEM_ID_COLUMN_NAME is set and ITEM_VALUE (ODMS_ITEM_VALUE_COLUMN_NAME) is not set, the following is the transactional view:
Name                                      Type
 ----------------------------------------- ----------------------------
 PARTITION_NAME                            VARCHAR2(128)
 RULE_ID                                   NUMBER
 RULE_SUPPORT                              NUMBER
 RULE_CONFIDENCE                           NUMBER
 RULE_LIFT                                 NUMBER
 RULE_REVCONFIDENCE                        NUMBER
 ANTECEDENT_SUPPORT                        NUMBER
 NUMBER_OF_ITEMS                           NUMBER
 CONSEQUENT_SUPPORT                        NUMBER
 CONSEQUENT_NAME                           VARCHAR2(4000)
 ANTECEDENT                                SYS.XMLTYPE

Table 25-11 Rule View Columns for Transactional Inputs

Column Name Description

PARTITION_NAME

A partition in a partitioned model to retrieve details

RULE_ID

Name or identifier of the target

RULE_SUPPORT

The number of transactions that satisfy the rule.

RULE_CONFIDENCE

The likelihood of a transaction satisfying the rule.

RULE_LIFT

The degree of improvement in the prediction over random chance when the rule is satisfied.

RULE_REVCONFIDENCE

The number of transactions in which the rule occurs divided by the number of transactions in which the consequent occurs.

ANTECEDENT_SUPPORT

The ratio of the number of transactions that satisfy the antecedent to the total number of transactions.

NUMBER_OF_ITEMS

The total number of attributes referenced in the antecedent and consequent of the rule.

CONSEQUENT_SUPPORT

The ratio of the number of transactions that satisfy the consequent to the total number of transactions.

CONSEQUENT_NAME

Name of the consequent

CONSEQUENT_SUBNAME

For two-dimensional inputs, CONSEQUENT_SUBNAME is used for nested column in the input data table. See, Example: Creating a Nested Column for Market Basket Analysis. In this example, there is a nested column. The CONSEQUENT_SUBNAME is the ATTRIBUTE_NAME part of the nested column. That is, 'O/S Documentation Set - English' and CONSEQUENT_VALUE is the value part of the nested column, which is, 1.

For two-dimensional inputs, when ODMS_ITEM_ID_COLUMN_NAME is not set, each item consists of three parts: NAME, SUBNAME and VALUE.

The view uses three columns for consequent. The rule view has the following columns:

Name                                      Type
 ----------------------- --------------------- 
 PARTITION_NAME                            VARCHAR2(128)
 RULE_ID                                   NUMBER
 RULE_SUPPORT                              NUMBER
 RULE_CONFIDENCE                           NUMBER
 RULE_LIFT                                 NUMBER
 RULE_REVCONFIDENCE                        NUMBER
 ANTECEDENT_SUPPORT                        NUMBER
 NUMBER_OF_ITEMS                           NUMBER
 CONSEQUENT_SUPPORT                        NUMBER
 CONSEQUENT_NAME                           VARCHAR2(4000)
 CONSEQUENT_SUBNAME                        VARCHAR2(4000)
 CONSEQUENT_VALUE                          VARCHAR2(4000)
 ANTECEDENT                                SYS.XMLTYPE

Note:

All the types for three parts are VARCHAR2. This column is not applicable when ASSO_AGGREGATES is set.

CONSEQUENT_VALUE

Value of the consequent when ODMS_ITEM_ID_COLUMN_NAME is set and Item_value (ODMS_ITEM_VALUE_COLUMN_NAME) is set with TYPE as numerical, the view has a CONSEQUENT_VALUE column.

In the following view, the TYPE of the CONSEQUENT_VALUE is NUMBER.

Name                                      Type
 -------------------------- -----------------------
 PARTITION_NAME                            VARCHAR2(128)
 RULE_ID                                   NUMBER
 RULE_SUPPORT                              NUMBER
 RULE_CONFIDENCE                           NUMBER
 RULE_LIFT                                 NUMBER
 RULE_REVCONFIDENCE                        NUMBER
 ANTECEDENT_SUPPORT                        NUMBER
 NUMBER_OF_ITEMS                           NUMBER
 CONSEQUENT_SUPPORT                        NUMBER
 CONSEQUENT_NAME                           VARCHAR2(4000)
 CONSEQUENT_VALUE                          NUMBER
 ANTECEDENT                                SYS.XMLTYPE

When ODMS_ITEM_ID_COLUMN_NAME is set and Item_value (ODMS_ITEM_VALUE_COLUMN_NAME) is set with TYPE as categorical, the view has a CONSEQUENT_VALUE column.

In the following view, the TYPE of the CONSEQUENT_VALUE is VARCHAR.

Name                                      Type
 ------------------- ----------------------------
 PARTITION_NAME                            VARCHAR2(128)
 RULE_ID                                   NUMBER
 RULE_SUPPORT                              NUMBER
 RULE_CONFIDENCE                           NUMBER
 RULE_LIFT                                 NUMBER
 RULE_REVCONFIDENCE                        NUMBER
 ANTECEDENT_SUPPORT                        NUMBER
 NUMBER_OF_ITEMS                           NUMBER
 CONSEQUENT_SUPPORT                        NUMBER
 CONSEQUENT_NAME                           VARCHAR2(4000)
 CONSEQUENT_VALUE                          VARCHAR2(4000)
 ANTECEDENT                                SYS.XMLTYPE

ANTECEDENT

The independent condition in the rule. When this condition exists, the dependent condition in the consequent also exists. The condition is a combination of attribute values called a predicate (DM_PREDICATE). The predicate specifies a condition for each attribute. The condition can specify equality (=), inequality (<>), greater than (>), less than (<), greater than or equal to (>=), or less than or equal to (<=) a given value. Support and confidence for each attribute condition in the antecedent is returned in the predicate. Support is the number of transactions that satisfy the antecedent. Confidence is the likelihood that a transaction satisfies the antecedent.

ANTECEDENT also contains the ITEM_VALUE (type number) part for each antecedent item.

Note:

The occurrence of the attribute as a DM_PREDICATE indicates the presence of the item in the transaction. The actual value for attribute_num_value or attribute_str_value is meaningless. For example, the following predicate indicates that 'Mouse Pad' is present in the transaction even though the attribute value is NULL.

DM_PREDICATE('PROD_NAME', 'Mouse Pad', '= ', NULL, NULL, NULL, NULL))

Transactional Input With ASSO_AGGREGATES Setting

Similar to the view without aggregates setting, there are three transactional cases. The following are the cases:
  • Rule view when ODMS_ITEM_ID_COLUMN_NAME is set and Item_value (ODMS_ITEM_VALUE_COLUMN_NAME) is not set.

  • Rule view when ODMS_ITEM_ID_COLUMN_NAME is set and Item_value (ODMS_ITEM_VALUE_COLUMN_NAME) is set with TYPE as numerical, the view has a CONSEQUENT_VALUE column.

  • Rule view when ODMS_ITEM_ID_COLUMN_NAME is set and Item_value (ODMS_ITEM_VALUE_COLUMN_NAME) is set with TYPE as categorical, the view has a CONSEQUENT_VALUE column.

The view with ASSO_AGGREGATES has columns for the aggregates output (four columns per aggregate). The 2–Dimensional input does not allow aggregates setting.

Example 25-13 Examples

The following example shows profit and sales set to be aggregated:

Name                                      Type
 ----------------------------------------- ----------------------------
 PARTITION_NAME                            VARCHAR2(128)
 RULE_ID                                   NUMBER
 RULE_SUPPORT                              NUMBER
 RULE_CONFIDENCE                           NUMBER
 RULE_LIFT                                 NUMBER
 RULE_REVCONFIDENCE                        NUMBER
 ANTECEDENT_SUPPORT                        NUMBER
 NUMBER_OF_ITEMS                           NUMBER
 CONSEQUENT_SUPPORT                        NUMBER
 CONSEQUENT_NAME                           VARCHAR2(4000)
 ANTECEDENT                                SYS.XMLTYPE
 ANT_RULE_PROFIT                           BINARY_DOUBLE
 CON_RULE_PROFIT                           BINARY_DOUBLE
 ANT_PROFIT                                BINARY_DOUBLE
 CON_PROFIT                                BINARY_DOUBLE
 ANT_RULE_SALES                            BINARY_DOUBLE
 CON_RULE_SALES                            BINARY_DOUBLE
 ANT_SALES                                 BINARY_DOUBLE
 CON_SALES                                 BINARY_DOUBLE
Rule view when ODMS_ITEM_ID_COLUMN_NAME is set and Item_value (ODMS_ITEM_VALUE_COLUMN_NAME) is set with TYPE as numerical, the view has a CONSEQUENT_VALUE column.
Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 PARTITION_NAME                                     VARCHAR2(128)
 RULE_ID                                            NUMBER
 RULE_SUPPORT                                       NUMBER
 RULE_CONFIDENCE                                    NUMBER
 RULE_LIFT                                          NUMBER
 RULE_REVCONFIDENCE                                 NUMBER
 ANTECEDENT_SUPPORT                                 NUMBER
 NUMBER_OF_ITEMS                                    NUMBER
 CONSEQUENT_SUPPORT                                 NUMBER
 CONSEQUENT_NAME                                    VARCHAR2(4000)
 CONSEQUENT_VALUE                                   NUMBER
 ANTECEDENT                                         SYS.XMLTYPE
 ANT_RULE_PROFIT                                    BINARY_DOUBLE
 CON_RULE_PROFIT                                    BINARY_DOUBLE
 ANT_PROFIT                                         BINARY_DOUBLE
 CON_PROFIT                                         BINARY_DOUBLE
 ANT_RULE_SALES                                     BINARY_DOUBLE
 CON_RULE_SALES                                     BINARY_DOUBLE
 ANT_SALES                                          BINARY_DOUBLE
 CON_SALES                                          BINARY_DOUBLE

Rule view when ODMS_ITEM_ID_COLUMN_NAME is set and Item_value (ODMS_ITEM_VALUE_COLUMN_NAME) is set with TYPE as categorical, the view has a CONSEQUENT_VALUE column.

Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 PARTITION_NAME                                     VARCHAR2(128)
 RULE_ID                                            NUMBER
 RULE_SUPPORT                                       NUMBER
 RULE_CONFIDENCE                                    NUMBER
 RULE_LIFT                                          NUMBER
 RULE_REVCONFIDENCE                                 NUMBER
 ANTECEDENT_SUPPORT                                 NUMBER
 NUMBER_OF_ITEMS                                    NUMBER
 CONSEQUENT_SUPPORT                                 NUMBER
 CONSEQUENT_NAME                                    VARCHAR2(4000)
 CONSEQUENT_VALUE                                   VARCHAR2(4000)
 ANTECEDENT                                         SYS.XMLTYPE
 ANT_RULE_PROFIT                                    BINARY_DOUBLE
 CON_RULE_PROFIT                                    BINARY_DOUBLE
 ANT_PROFIT                                         BINARY_DOUBLE
 CON_PROFIT                                         BINARY_DOUBLE
 ANT_RULE_SALES                                     BINARY_DOUBLE
 CON_RULE_SALES                                     BINARY_DOUBLE
 ANT_SALES                                          BINARY_DOUBLE
 CON_SALES                                          BINARY_DOUBLE

Global Detail for Association Rules

A single global detail is produced by an Association model. The following table describes a global detail returned for Association Rules model.

Table 25-12 Global Detail for Association Rules

Name Description

ITEMSET_COUNT

The number of itemsets generated

MAX_SUPPORT

The maximum support

NUM_ROWS

The total number of rows used in the build

RULE_COUNT

The number of association rules in the model generated

TRANSACTION_COUNT

The number of the transactions in input data

25.4.2 Model Detail View for Frequent Itemsets

Model detail view for Frequent Itemsets describes the frequent itemsets view. Oracle recommends that you leverage model details view instead of the GET_FREQUENT_ITEMSETS function.

The frequent itemsets view DM$VImodel_name has the following schema:

Name		          Type
 ------------- ------------------
 PARTITION_NAME   VARCHAR2 (128)
 ITEMSET_ID       NUMBER
 SUPPORT          NUMBER
 NUMBER_OF_ITEMS  NUMBER
 ITEMSET          SYS.XMLTYPE

Table 25-13 Frequent Itemsets View

Column Name Description

PARTITION_NAME

A partition in a partitioned model

ITEMSET_ID

Itemset identifier

SUPPORT

Support of the itemset

NUMBER_OF_ITEMS

Number of items in the itemset

ITEMSET

Frequent itemset

The structure of the SYS.XMLTYPE column itemset is the same as the corresponding Antecedent column of the rule view.

25.4.3 Model Detail View for Transactional Itemsets

Model detail view for Transactional Itemsets describes the transactional itemsets view. Oracle recommends that users leverage the model details views.

For the very common case of transactional data without aggregates, DM$VTmodel_name view provides the itemsets information in transactional format. This view can help improve performance for some queries as compared to the view with the XML column. The transactional itemsets view has the following schema:

Name		            Type
 ----------------- -----------------
 PARTITION_NAME      VARCHAR2(128)
 ITEMSET_ID          NUMBER
 ITEM_ID             NUMBER
 SUPPORT             NUMBER
 NUMBER_OF_ITEMS     NUMBER
 ITEM_NAME           VARCHAR2(4000)

Table 25-14 Transactional Itemsets View

Column Name Description

PARTITION_NAME

A partition in a partitioned model

ITEMSET_ID

Itemset identifier

ITEM_ID

Item identifier

SUPPORT

Support of the itemset

NUMBER_OF_ITEMS

Number of items in the itemset

ITEM_NAME

The name of the item

25.4.4 Model Detail View for Transactional Rule

Model detail view for Transactional Rule describes the transactional rule view and transactional itemsets view. Oracle recommends that you leverage model details views.

Transactional data without aggregates also has a transactional rule view DM$VAmodel_name. This view can improve performance for some queries as compared to the view with the XML column. The transactional rule view has the following schema:

Name                                      Type
 ----------------------------------------- ----------------------------
 PARTITION_NAME                            VARCHAR2(128)
 RULE_ID                                   NUMBER
 ANTECEDENT_PREDICATE                      VARCHAR2(4000)
 CONSEQUENT_PREDICATE                      VARCHAR2(4000)
 RULE_SUPPORT                              NUMBER
 RULE_CONFIDENCE                           NUMBER
 RULE_LIFT                                 NUMBER
 RULE_REVCONFIDENCE                        NUMBER
 RULE_ITEMSET_ID                           NUMBER
 ANTECEDENT_SUPPORT                        NUMBER
 CONSEQUENT_SUPPORT                        NUMBER
 NUMBER_OF_ITEMS                           NUMBER

Table 25-15 Transactional Rule View

Column Name Description

PARTITION_NAME

A partition in a partitioned model

RULE_ID

Rule identifier

ANTECEDENT_PREDICATE

Name of the Antecedent item.

CONSEQUENT_PREDICATE

Name of the Consequent item

RULE_SUPPORT

Support of the rule

RULE_CONFIDENCE

The likelihood a transaction satisfies the rule when it contains the Antecedent.

RULE_LIFT

The degree of improvement in the prediction over random chance when the rule is satisfied

RULE_REVCONFIDENCE

The number of transactions in which the rule occurs divided by the number of transactions in which the consequent occurs

RULE_ITEMSET_ID

Itemset identifier

ANTECEDENT_SUPPORT

The ratio of the number of transactions that satisfy the antecedent to the total number of transactions

CONSEQUENT_SUPPORT

The ratio of the number of transactions that satisfy the consequent to the total number of transactions

NUMBER_OF_ITEMS

Number of items in the rule

25.4.5 Model Detail Views for Classification Algorithms

Model detail view for Classification algorithms describe target map view and scoring cost view which are applicable to all Classification algorithms. Oracle recommends that users leverage the model details views instead of the GET_* function.

The target map view DM$VTmodel_name describes the target distribution for Classification models. The view has the following schema:

Name                                      Type
 ----------------------------------------- ----------------------------
 PARTITION_NAME                            VARCHAR2(128)
 TARGET_VALUE                              NUMBER/VARCHAR2 
 TARGET_COUNT                              NUMBER
 TARGET_WEIGHT                             NUMBER

Table 25-16 Target Map View

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

TARGET_VALUE

Target value, numerical or categorical

TARGET_COUNT

Number of rows for a given TARGET_VALUE

TARGET_WEIGHT

Weight for a given TARGET_VALUE

The scoring cost view DM$VCmodel_name describes the scoring cost matrix for Classification models. The view has the following schema:

Name                                       Type
 ----------------------------------------- --------------------------------
 PARTITION_NAME                            VARCHAR2(128)
 ACTUAL_TARGET_VALUE                       NUMBER/VARCHAR2  
 PREDICTED_TARGET_VALUE                    NUMBER/VARCHAR2  
 COST                                      NUMBER

Table 25-17 Scoring Cost View

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

ACTUAL_TARGET_VALUE

A valid target value

PREDICTED_TARGET_VALUE

Predicted target value

COST

Associated cost for the actual and predicted target value pair

25.4.6 Model Detail Views for Decision Tree

Model detail view for Decision Tree describes the split information view, node statistics view, node description view, and the cost matrix view. Oracle recommends that users leverage the model details views instead of GET_MODEL_DETAILS_XML function.

The split information view DM$VPmodel_name describes the decision tree hierarchy and the split information for each level in the Decision Tree. The view has the following schema:

Name                                Type
 ---------------------------------- ---------------------------
 PARTITION_NAME                     VARCHAR2(128)
 PARENT                             NUMBER              
 SPLIT_TYPE                         VARCHAR2            
 NODE                               NUMBER              
 ATTRIBUTE_NAME                     VARCHAR2(128)       
 ATTRIBUTE_SUBNAME                  VARCHAR2(4000)      
 OPERATOR                           VARCHAR2            
 VALUE                              SYS.XMLTYPE 

Table 25-18 Split Information View

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

PARENT

Node ID of the parent

SPLIT_TYPE

The main or surrogate split

NODE

The node ID

ATTRIBUTE_NAME

The attribute used as the splitting criterion at the parent node to produce this node.

ATTRIBUTE_SUBNAME

Split attribute subname. The value is null for non-nested columns.

OPERATOR

Split operator

VALUE

Value used as the splitting criterion. This is an XML element described using the <Element> tag.

For example, <Element>Windy</Element><Element>Hot</Element>.

The node statistics view DM$VImodel_name describes the statistics associated with individual tree nodes. The statistics include a target histogram for the data in the node. The view has the following schema:

Name                                Type
 ---------------------------------- ----------------------------
 PARTITION_NAME                     VARCHAR2(128)
 NODE                               NUMBER      
 NODE_SUPPORT                       NUMBER       
 PREDICTED_TARGET_VALUE             NUMBER/VARCHAR2
 TARGET_VALUE                       NUMBER/VARCHAR2 
 TARGET_SUPPORT                     NUMBER   

Table 25-19 Node Statistics View

Parameter Description

PARTITION_NAME

Partition name in a partitioned model

NODE

The node ID

NODE_SUPPORT

Number of records in the training set that belong to the node

PREDICTED_TARGET_VALUE

Predicted Target value

TARGET_VALUE

A target value seen in the training data

TARGET_SUPPORT

The number of records that belong to the node and have the value specified in the TARGET_VALUE column

Higher level node description can be found in DM$VOmodel_name view. The DM$VOmodel_name has the following schema:

ame                                Type
 ---------------------------------- ----------------------------
 PARTITION_NAME                     VARCHAR2(128)
 NODE                               NUMBER                
 NODE_SUPPORT                       NUMBER                
 PREDICTED_TARGET_VALUE             NUMBER/VARCHAR2       
 PARENT                             NUMBER               
 ATTRIBUTE_NAME                     VARCHAR2(128)       
 ATTRIBUTE_SUBNAME                  VARCHAR2(4000)       
 OPERATOR                           VARCHAR2             
 VALUE                              SYS.XMLTYPE  

Table 25-20 Node Description View

Parameter Description

PARTITION_NAME

Partition name in a partitioned model

NODE

The node ID

NODE_SUPPORT

Number of records in the training set that belong to the node

PREDICTED_TARGET_VALUE

Predicted Target value

PARENT

The ID of the parent

ATTRIBUTE_NAME

Specifies the attribute name

ATTRIBUTE_SUBNAME

Specifies the attribute subname

OPERATOR

Attribute predicate operator - a conditional operator taking the following values:

IN, = , <>, < , >, <=, and >=

VALUE

Value used as the description criterion. This is an XML element described using the <Element> tag.

For example, <Element>Windy</Element><Element>Hot</Element>.

The DM$VMmodel_name view describes the cost matrix used by the Decision Tree build. The DM$VMmodel_name view has the following schema:

Name                                       Type
 ----------------------------------------- --------------------------------
 PARTITION_NAME                            VARCHAR2(128)
 ACTUAL_TARGET_VALUE                       NUMBER/VARCHAR2 
 PREDICTED_TARGET_VALUE                    NUMBER/VARCHAR2 
 COST                                      NUMBER

Table 25-21 Cost Matrix View

Parameter Description

PARTITION_NAME

Partition name in a partitioned model

ACTUAL_TARGET_VALUE

Valid target value

PREDICTED_TARGET_VALUE

Predicted Target value

COST

Associated cost for the actual and predicted target value pair

The following table describes the global view for Decision Tree.

Table 25-22 Decision Tree Statistics Information In Model Global View

Name Description

NUM_ROWS

The total number of rows used in the build

25.4.7 Model Detail Views for Generalized Linear Model

Model details views for Generalized Linear Model (GLM) describes the model details view and row diagnostic view for Linear and Logistic Regression. Oracle recommends that users leverage model details views than the GET_MODEL_DETAILS_GLM function.

The model details view DM$VDmodel_name describes the final model information for both Linear Regression models and Logistic Regression models.

For Linear Regression, the view DM$VDmodel_name has the following schema:

Name                                Type
 ---------------------------------- ----------------------------
 PARTITION_NAME                     VARCHAR2(128)
 ATTRIBUTE_NAME                     VARCHAR2(128)
 ATTRIBUTE_SUBNAME                  VARCHAR2(4000)
 ATTRIBUTE_VALUE                    VARCHAR2(4000)
 FEATURE_EXPRESSION                 VARCHAR2(4000)
 COEFFICIENT                        BINARY_DOUBLE
 STD_ERROR                          BINARY_DOUBLE
 TEST_STATISTIC                     BINARY_DOUBLE
 P_VALUE                            BINARY_DOUBLE
 VIF                                BINARY_DOUBLE
 STD_COEFFICIENT                    BINARY_DOUBLE
 LOWER_COEFF_LIMIT                  BINARY_DOUBLE
 UPPER_COEFF_LIMIT                  BINARY_DOUBLE

For Logistic Regression, the view DM$VDmodel_name has the following schema:

Name                                Type
 ---------------------------------- ----------------------------
 PARTITION_NAME                     VARCHAR2(128)
 TARGET_VALUE                       NUMBER/VARCHAR2
 ATTRIBUTE_NAME                     VARCHAR2(128)
 ATTRIBUTE_SUBNAME                  VARCHAR2(4000)
 ATTRIBUTE_VALUE                    VARCHAR2(4000)
 FEATURE_EXPRESSION                 VARCHAR2(4000)
 COEFFICIENT                        BINARY_DOUBLE
 STD_ERROR                          BINARY_DOUBLE
 TEST_STATISTIC                     BINARY_DOUBLE
 P_VALUE                            BINARY_DOUBLE
 STD_COEFFICIENT                    BINARY_DOUBLE
 LOWER_COEFF_LIMIT                  BINARY_DOUBLE
 UPPER_COEFF_LIMIT                  BINARY_DOUBLE
 EXP_COEFFICIENT                    BINARY_DOUBLE
 EXP_LOWER_COEFF_LIMIT              BINARY_DOUBLE
 EXP_UPPER_COEFF_LIMIT              BINARY_DOUBLE

Table 25-23 Model View for Linear and Logistic Regression Models

Column Name Description

PARTITION_NAME

The name of a feature in the model

TARGET_VALUE

Valid target value

ATTRIBUTE_NAME

The attribute name when there is no subname, or first part of the attribute name when there is a subname. ATTRIBUTE_NAME is the name of a column in the source table or view. If the column is a non-nested, numeric column, then ATTRIBUTE_NAME is the name of the mining attribute. For the intercept, ATTRIBUTE_NAME is null. Intercepts are equivalent to the bias term in SVM models.

ATTRIBUTE_SUBNAME

Nested column subname. The value is null for non-nested columns.

When the nested column is numeric, the mining attribute is identified by the combination ATTRIBUTE_NAME - ATTRIBUTE_SUBNAME. If the column is not nested, ATTRIBUTE_SUBNAME is null. If the attribute is an intercept, both the ATTRIBUTE_NAME and the ATTRIBUTE_SUBNAME are null.

ATTRIBUTE_VALUE

A unique value that can be assumed by a categorical column or nested categorical column. For categorical columns, a mining attribute is identified by a unique ATTRIBUTE_NAME.ATTRIBUTE_VALUE pair. For nested categorical columns, a mining attribute is identified by the combination: ATTRIBUTE_NAME.ATTRIBUTE_SUBNAME.ATTRIBUTE_VALUE. For numerical attributes, ATTRIBUTE_VALUE is null.

FEATURE_EXPRESSION

The feature name constructed by the algorithm when feature selection is enabled. If feature selection is not enabled, the feature name is simply the fully-qualified attribute name (attribute_name.attribute_subname if the attribute is in a nested column). For categorical attributes, the algorithm constructs a feature name that has the following form:

fully-qualified_attribute_name.attribute_value

When feature generation is enabled, a term in the model can be a single mining attribute or the product of up to 3 mining attributes. Component mining attributes can be repeated within a single term. If feature generation is not enabled or, if feature generation is enabled, but no multiple component terms are discovered by the CREATE model process, then FEATURE_EXPRESSION is null.

Note:

In Oracle Database 12c Release 2, the algorithm does not subtract the mean from numerical components.

COEFFICIENT

The estimated coefficient.

STD_ERROR

Standard error of the coefficient estimate.

TEST_STATISTIC

For Linear Regression, the t-value of the coefficient estimate.

For Logistic Regression, the Wald chi-square value of the coefficient estimate.

P_VALUE

Probability of the TEST_STATISTIC under the (NULL) hypothesis that the term in the model is not statistically significant. A low probability indicates that the term is significant, while a high probability indicates that the term can be better discarded. Used to analyze the significance of specific attributes in the model.

VIF

Variance Inflation Factor. The value is zero for the intercept. For Logistic Regression, VIF is null.

STD_COEFFICIENT

Standardized estimate of the coefficient.

LOWER_COEFF_LIMIT

Lower confidence bound of the coefficient.

UPPER_COEFF_LIMIT

Upper confidence bound of the coefficient.

EXP_COEFFICIENT

Exponentiated coefficient for Logistic Regression. For linear

regression, EXP_COEFFICIENT is null.

EXP_LOWER_COEFF_LIMIT

Exponentiated coefficient for lower confidence bound of the coefficient for Logistic Regression. For Linear Regression, EXP_LOWER_COEFF_LIMIT is null.

EXP_UPPER_COEFF_LIMIT

Exponentiated coefficient for upper confidence bound of the coefficient for Logistic Regression. For Linear Regression, EXP_UPPER_COEFF_LIMIT is null.

The row diagnostic view DM$VAmodel_name describes row level information for both Linear Regression models and Logistic Regression models. For Linear Regression, the view DM$VAmodel_name has the following schema:

Name                                Type
 ---------------------------------- ----------------------------
 PARTITION_NAME                     VARCHAR2(128)
 CASE_ID                            NUMBER/VARHCAR2
 TARGET_VALUE                       BINARY_DOUBLE
 PREDICTED_TARGET_VALUE             BINARY_DOUBLE
 Hat                                BINARY_DOUBLE
 RESIDUAL                           BINARY_DOUBLE
 STD_ERR_RESIDUAL                   BINARY_DOUBLE
 STUDENTIZED_RESIDUAL               BINARY_DOUBLE
 PRED_RES                           BINARY_DOUBLE
 COOKS_D                            BINARY_DOUBLE

Table 25-24 Row Diagnostic View for Linear Regression

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

CASE_ID

Name of the case identifier

TARGET_VALUE

The actual target value as taken from the input row

PREDICTED_TARGET_VALUE

The model predicted target value for the row

HAT

The diagonal element of the n*n (n=number of rows) that the Hat matrix identifies with a specific input row. The model predictions for the input data are the product of the Hat matrix and vector of input target values. The diagonal elements (Hat values) represent the influence of the ith row on the ith fitted value. Large Hat values are indicators that the ith row is a point of high leverage, a potential outlier.

RESIDUAL

The difference between the predicted and actual target value for a specific input row.

STD_ERR_RESIDUAL

The standard error residual, sometimes called the Studentized residual, re-scales the residual to have constant variance across all input rows in an effort to make the input row residuals comparable. The process multiplies the residual by square root of the row weight divided by the product of the model mean square error and 1 minus the Hat value.

STUDENTIZED_RESIDUAL

Studentized deletion residual adjusts the standard error residual for the influence of the current row.

PRED_RES

The predictive residual is the weighted square of the deletion residuals, computed as the row weight multiplied by the square of the residual divided by 1 minus the Hat value.

COOKS_D

Cook's distance is a measure of the combined impact of the ith case on all of the estimated regression coefficients.

For Logistic Regression, the view DM$VAmodel_name has the following schema:

Name                                Type
 ---------------------------------- ----------------------------
 PARTITION_NAME                     VARCHAR2(128)
 CASE_ID                            NUMBER/VARHCAR2
 TARGET_VALUE                       NUMBER/VARCHAR2
 TARGET_VALUE_PROB                  BINARY_DOUBLE
 Hat                                BINARY_DOUBLE
 WORKING_RESIDUAL                   BINARY_DOUBLE
 PEARSON_RESIDUAL                   BINARY_DOUBLE
 DEVIANCE_RESIDUAL                  BINARY_DOUBLE
 C                                  BINARY_DOUBLE
 CBAR                        	    BINARY_DOUBLE
 DIFDEV                             BINARY_DOUBLE
 DIFCHISQ                           BINARY_DOUBLE

Table 25-25 Row Diagnostic View for Logistic Regression

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

CASE_ID

Name of the case identifier

TARGET_VALUE

The actual target value as taken from the input row

TARGET_VALUE_PROB

Model estimate of the probability of the predicted target value.

Hat

The Hat value concept from Linear Regression is extended to Logistic Regression by multiplying the Linear Regression Hat value by the variance function for Logistic Regression, the predicted probability multiplied by 1 minus the predicted probability.

WORKING_RESIDUAL

The working residual is the residual of the working response. The working response is the response on the linearized scale. For Logistic Regression it has the form: the ith row residual divided by the variance of the ith row prediction. The variance of the prediction is the predicted probability multiplied by 1 minus the predicted probability.

WORKING_RESIDUAL is the difference between the working response and the linear predictor at convergence.

PEARSON_RESIDUAL

The Pearson residual is a re-scaled version of the working residual, accounting for the weight. For Logistic Regression, the Pearson residual multiplies the residual by a factor that is computed as square root of the weight divided by the variance of the predicted probability for the ith row.

RESIDUAL is 1 minus the predicted probability of the actual target value for the row.

DEVIANCE_RESIDUAL

The DEVIANCE_RESIDUAL is the contribution to the model deviance of the ith observation. For Logistic Regression it has the form the square root of 2 times the log(1 + e^eta) - eta for the non-reference class and -square root of 2 time the log (1 + eta) for the reference class, where eta is the linear prediction (the prediction as if the model were a Linear Regression).

C

Measures the overall change in the fitted logits due to the deletion of the ith observation for all points including the one deleted (the ith point). It is computed as the square of the Pearson residual multiplied by the Hat value divided by the square of 1 minus the Hat value.

Confidence interval displacement diagnostics that provides scalar measure of the influence of individual observations.

CBAR

C and CBAR are extensions of Cooks’ distance for Logistic Regression. CBAR measures the overall change in the fitted logits due to the deletion of the ith observation for all points excluding the one deleted (the ith point). It is computed as the square of the Pearson residual multiplied by the Hat value divided by (1 minus the Hat value)

Confidence interval displacement diagnostic which measures the influence of deleting an individual observation.

DIFDEV

A statistic that measures the change in deviance that occurs when an observation is deleted from the input. It is computed as the square of the deviance residual plus CBAR.

DIFCHISQ

A statistic that measures the change in the Pearson chi-square statistic that occurs when an observation is deleted from the input. It is computed as CBAR divided by the Hat value.

Global Details for GLM: Linear Regression

The following table describes global details returned by a Linear Regression model.

Table 25-26 Global Details for Linear Regression

Name Description

ADJUSTED_R_SQUARE

Adjusted R-Square

AIC

Akaike's information criterion

COEFF_VAR

Coefficient of variation

CONVERGED

Indicates whether the model build process has converged to specified tolerance. The following are the possible values:
  • YES

  • NO

CORRECTED_TOTAL_DF

Corrected total degrees of freedom

CORRECTED_TOT_SS

Corrected total sum of squares

DEPENDENT_MEAN

Dependent mean

ERROR_DF

Error degrees of freedom

ERROR_MEAN_SQUARE

Error mean square

ERROR_SUM_SQUARES

Error sum of squares

F_VALUE

Model F value statistic

GMSEP

Estimated mean square error of the prediction, assuming multivariate normality

HOCKING_SP

Hocking Sp statistic

ITERATIONS

Tracks the number of SGD iterations. Applicable only when the solver is SGD.

J_P

JP statistic (the final prediction error)

MODEL_DF

Model degrees of freedom

MODEL_F_P_VALUE

Model F value probability

MODEL_MEAN_SQUARE

Model mean square error

MODEL_SUM_SQUARES

Model sum of square errors

NUM_PARAMS

Number of parameters (the number of coefficients, including the intercept)

NUM_ROWS

Number of rows

R_SQ

R-Square

RANK_DEFICIENCY

The number of predictors excluded from the model due to multi-collinearity

ROOT_MEAN_SQ

Root mean square error

SBIC

Schwarz's Bayesian information criterion

Global Details for GLM: Logistic Regression

The following table returns global details returned by a Logistic Regression model.

Table 25-27 Global Details for Logistic Regression

Name Description

AIC_INTERCEPT

Akaike's criterion for the fit of the baseline, intercept-only, model

AIC_MODEL

Akaike's criterion for the fit of the intercept and the covariates (predictors) mode

CONVERGED

Indicates whether the model build process has converged to specified tolerance. The following are the possible values:
  • YES

  • NO

DEPENDENT_MEAN

Dependent mean

ITERATIONS

Tracks the number of SGD iterations (number of IRLS iterations). Applicable only when the solver is SGD.

LR_DF

Likelihood ratio degrees of freedom

LR_CHI_SQ

Likelihood ratio chi-square value

LR_CHI_SQ_P_VALUE

Likelihood ratio chi-square probability value

NEG2_LL_INTERCEPT

-2 log likelihood of the baseline, intercept-only, model

NEG2_LL_MODEL

-2 log likelihood of the model

NUM_PARAMS

Number of parameters (the number of coefficients, including the intercept)

NUM_ROWS

Number of rows

PCT_CORRECT

Percent of correct predictions

PCT_INCORRECT

Percent of incorrectly predicted rows

PCT_TIED

Percent of cases where the estimated probabilities are equal for both target classes

PSEUDO_R_SQ_CS

Pseudo R-square Cox and Snell

PSEUDO_R_SQ_N

Pseudo R-square Nagelkerke

RANK_DEFICIENCY

The number of predictors excluded from the model due to multi-collinearity

SC_INTERCEPT

Schwarz's Criterion for the fit of the baseline, intercept-only, model

SC_MODEL

Schwarz's Criterion for the fit of the intercept and the covariates (predictors) model

Note:

  • When Ridge Regression is enabled, fewer global details are returned. For information about ridge, see Oracle Data Mining Concepts.

  • When the value is NULL for a partitioned model, an exception is thrown. When the value is not null, it must contain the desired partition name.

25.4.8 Model Detail Views for Naive Bayes

Model Detail Views for Naive Bayes describes prior view and result view. Oracle recommends that users leverage the model details views instead of the GET_MODEL_DETAILS_NB function.

The prior view DM$VPmodel_name describes the priors of the targets for Naïve Bayes. The view has the following schema:

Name                                       Type
 ----------------------------------------- ----------------------------
 PARTITION_NAME                            VARCHAR2(128)
 TARGET_NAME                               VARCHAR2(128)
 TARGET_VALUE                              NUMBER/VARCHAR2
 PRIOR_PROBABILITY                         BINARY_DOUBLE
 COUNT                                     NUMBER

Table 25-28 Prior View for Naive Bayes

Column Name Description

PARTITION_NAME

The name of a feature in the model

TARGET_NAME

Name of the target column

TARGET_VALUE

Target value, numerical or categorical

PRIOR_PROBABILITY

Prior probability for a given TARGET_VALUE

COUNT

Number of rows for a given TARGET_VALUE

The Naïve Bayes result view DM$VVmodel_view describes the conditional probabilities of the Naïve Bayes model. The view has the following schema:

Name                                       Type
 ----------------------------------------- ----------------------------
 PARTITION_NAME                            VARCHAR2(128)
 TARGET_NAME                               VARCHAR2(128)
 TARGET_VALUE                              NUMBER/VARCHAR2
 ATTRIBUTE_NAME                            VARCHAR2(128)
 ATTRIBUTE_SUBNAME                         VARCHAR2(4000)
 ATTRIBUTE_VALUE                           VARCHAR2(4000)
 CONDITIONAL_PROBABILITY                   BINARY_DOUBLE
 COUNT                                     NUMBER

Table 25-29 Result View for Naive Bayes

Column Name Description

PARTITION_NAME

The name of a feature in the model

TARGET_NAME

Name of the target column

TARGET_VALUE

Target value, numerical or categorical

ATTRIBUTE_NAME

Column name

ATTRIBUTE_SUBNAME

Nested column subname. The value is null for non-nested columns.

ATTRIBUTE_VALUE

Mining attribute value for the column ATTRIBUTE_NAME or the nested column ATTRIBUTE_SUBNAME (if any).

CONDITIONAL_PROBABILITY

Conditional probability of a mining attribute for a given target

COUNT

Number of rows for a given mining attribute and a given target

The following table describes the global view for Naive Bayes.

Table 25-30 Naive Bayes Statistics Information In Model Global View

Name Description

NUM_ROWS

The total number of rows used in the build

25.4.9 Model Detail View for Support Vector Machine

Model Detail View for Support Vector Machine describes linear coefficient view. Oracle recommends that users leverage the model details views instead of the GET_MODEL_DETAILS_SVM function.

The linear coefficient view DM$VLmodel_name describes the coefficients of a linear SVM algorithm. The target_value field in the view is present only for Classification and has the type of the target. Regression models do not have a target_value field.

The reversed_coefficient field shows the value of the coefficient after reversing the automatic data preparation transformations. If data preparation is disabled, then coefficient and reversed_coefficient have the same value. The view has the following schema:

Name                                       Type
 ----------------------------------------- --------------------------------
 PARTITION_NAME                            VARCHAR2(128)
 TARGET_VALUE                              NUMBER/VARCHAR2
 ATTRIBUTE_NAME                            VARCHAR2(128)
 ATTRIBUTE_SUBNAME                         VARCHAR2(4000)
 ATTRIBUTE_VALUE                           VARCHAR2(4000)
 COEFFICIENT                               BINARY_DOUBLE
 REVERSED_COEFFICIENT                      BINARY_DOUBLE

Table 25-31 Linear Coefficient View for Support Vector Machine

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

TARGET_VALUE

Target value, numerical or categorical

ATTRIBUTE_NAME

Column name

ATTRIBUTE_SUBNAME

Nested column subname. The value is null for non-nested columns.

ATTRIBUTE_VALUE

Value of a categorical attribute

COEFFICIENT

Projection coefficient value

REVERSED_COEFFICIENT

Coefficient transformed on the original scale

The following table describes the Support Vector statistics global view.

Table 25-32 Support Vector Statistics Information In Model Global View

Name Description

CONVERGED

Indicates whether the model build process has converged to specified tolerance:
  • YES

  • NO

ITERATIONS

Number of iterations performed during build

NUM_ROWS

Number of rows used for the build

REMOVED_ROWS_ZERO_NORM

Number of rows removed due to 0 norm. This applies to one-class linear models only.

25.4.10 Model Detail Views for Clustering Algorithms

Oracle Data Mining supports these clustering algorithms: Expectation Maximization, k-Means, and Orthogonal Partitioning Clustering (O-Cluster).

All clustering algorithms share the following views:

  • Cluster description DM$VDmodel_name

  • Attribute statistics DM$VAmodel_name

  • Histogram statistics DM$VHmodel_name

  • Rule statistics DM$VRmodel_name

The cluster description view DM$VDmodel_name describes cluster level information about a clustering model. The view has the following schema:

Name                                Type
 ---------------------------------- ----------------------------
 PARTITION_NAME                     VARCHAR2(128)
 CLUSTER_ID                         NUMBER
 CLUSTER_NAME                       NUMBER/VARCHAR2  
 RECORD_COUNT                       NUMBER
 PARENT                             NUMBER           
 TREE_LEVEL                         NUMBER           
 LEFT_CHILD_ID                      NUMBER           
 RIGHT_CHILD_ID                     NUMBER 

Table 25-33 Cluster Description View for Clustering Algorithm

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

CLUSTER_ID

The ID of a cluster in the model

CLUSTER_NAME

Specifies the label of the cluster

RECORD_COUNT

Specifies the number of records

PARENT

The ID of the parent

TREE_LEVEL

Specifies the number of splits from the root

LEFT_CHILD_ID

The ID of the child cluster on the left side of the split

RIGHT_CHILD_ID

The ID of the child cluster on the right side of the split

The attribute view DM$VAmodel_name describes attribute level information about a Clustering model. The values of the mean, variance, and mode for a particular cluster can be obtained from this view. The view has the following schema:

Name                                Type
 ---------------------------------- ----------------------------
 PARTITION_NAME                     VARCHAR2(128)
 CLUSTER_ID                         NUMBER
 CLUSTER_NAME                       NUMBER/VARCHAR2
 ATTRIBUTE_NAME                     VARCHAR2(128)
 ATTRIBUTE_SUBNAME                  VARCHAR2(4000)
 MEAN                               BINARY_DOUBLE
 VARIANCE                           BINARY_DOUBLE
 MODE_VALUE                         VARCHAR2(4000)

Table 25-34 Attribute View for Clustering Algorithm

Column Name Description

PARTITION_NAME

A partition in a partitioned model

CLUSTER_ID

The ID of a cluster in the model

CLUSTER_NAME

Specifies the label of the cluster

ATTRIBUTE_NAME

Specifies the attribute name

ATTRIBUTE_SUBNAME

Specifies the attribute subname

MEAN

The field returns the average value of a numeric attribute

VARIANCE

The variance of a numeric attribute

MODE_VALUE

The mode is the most frequent value of a categorical attribute

The histogram view DM$VHmodel_name describes histogram level information about a Clustering model. The bin information as well as bin counts can be obtained from this view. The view has the following schema:

Name                                Type
 ---------------------------------- ----------------------------
 PARTITION_NAME                     VARCHAR2(128)
 CLUSTER_ID                         NUMBER
 CLUSTER_NAME                       NUMBER/VARCHAR2
 ATTRIBUTE_NAME                     VARCHAR2(128)
 ATTRIBUTE_SUBNAME                  VARCHAR2(4000)
 BIN_ID                             NUMBER
 LOWER_BIN_BOUNDARY                 BINARY_DOUBLE                
 UPPER_BIN_BOUNDARY                 BINARY_DOUBLE         
 ATTRIBUTE_VALUE                    VARCHAR2(4000)       
 COUNT                              NUMBER  

Table 25-35 Histogram View for Clustering Algorithm

Column Name Description

PARTITION_NAME

A partition in a partitioned model

CLUSTER_ID

The ID of a cluster in the model

CLUSTER_NAME

Specifies the label of the cluster

ATTRIBUTE_NAME

Specifies the attribute name

ATTRIBUTE_SUBNAME

Specifies the attribute subname

BIN_ID

Bin ID

LOWER_BIN_BOUNDARY

Numeric lower bin boundary

UPPER_BIN_BOUNDARY

Numeric upper bin boundary

ATTRIBUTE_VALUE

Categorical attribute value

COUNT

Histogram count

The rule view DM$VRmodel_name describes the rule level information about a Clustering model. The information is provided at attribute predicate level. The view has the following schema:

Name                                Type
 ---------------------------------- ----------------------------
 PARTITION_NAME                     VARCHAR2(128)
 CLUSTER_ID                         NUMBER              
 CLUSTER_NAME                       NUMBER/VARCHAR2
 ATTRIBUTE_NAME                     VARCHAR2(128)
 ATTRIBUTE_SUBNAME                  VARCHAR2(4000)
 OPERATOR                           VARCHAR2(2)         
 NUMERIC_VALUE                      NUMBER              
 ATTRIBUTE_VALUE                    VARCHAR2(4000)      
 SUPPORT                            NUMBER              
 CONFIDENCE                         BINARY_DOUBLE       
 RULE_SUPPORT                       NUMBER              
 RULE_CONFIDENCE                    BINARY_DOUBLE 

Table 25-36 Rule View for Clustering Algorithm

Column Name Description

PARTITION_NAME

A partition in a partitioned model

CLUSTER_ID

The ID of a cluster in the model

CLUSTER_NAME

Specifies the label of the cluster

ATTRIBUTE_NAME

Specifies the attribute name

ATTRIBUTE_SUBNAME

Specifies the attribute subname

OPERATOR

Attribute predicate operator - a conditional operator taking the following values: IN, = , <>, < , >, <=, and >=

NUMERIC_VALUE

Numeric lower bin boundary

ATTRIBUTE_VALUE

Categorical attribute value

SUPPORT

Attribute predicate support

CONFIDENCE

Attribute predicate confidence

RULE_SUPPORT

Rule level support

RULE_CONFIDENCE

Rule level confidence

25.4.11 Model Detail Views for Expectation Maximization

Model detail views for Expectation Maximization (EM) describes the differences in the views for EM against those of Clustering views. Oracle recommends that user leverage the model details views instead of the GET_MODEL_DETAILS_EM function.

The following views are the differences in the views for Expectation Maximization against Clustering views. For an overview of the different Clustering views, refer to "Model Detail Views for Clustering Algorithms".

The component view DM$VOmodel_name describes the EM components. The component view contains information about their prior probabilities and what cluster they map to. The view has the following schema:

Name                                Type
 ---------------------------------- ----------------------------
 PARTITION_NAME                     VARCHAR2(128)
 COMPONENT_ID                       NUMBER
 CLUSTER_ID                         NUMBER
 PRIOR_PROBABILITY                  BINARY_DOUBLE

Table 25-37 Component View

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

COMPONENT_ID

Unique identifier of a component

CLUSTER_ID

The ID of a cluster in the model

PRIOR_PROBABILITY

Component prior probability

The mean and variance component view DM$VMmodel_name provides information about the mean and variance parameters for the attributes by Gaussian distribution models. The view has the following schema:

Name                                Type
 ---------------------------------- ----------------------------
 PARTITION_NAME                     VARCHAR2(128)
 COMPONENT_ID                       NUMBER
 ATTRIBUTE_NAME                     VARCHAR2(4000)
 MEAN                               BINARY_DOUBLE
 VARIANCE                           BINARY_DOUBLE

The frequency component view DM$VFmodel_name provides information about the parameters of the multi-valued Bernoulli distributions used by the EM model. The view has the following schema:

Name                                Type
 ---------------------------------- ----------------------------
 PARTITION_NAME                     VARCHAR2(128)
 COMPONENT_ID                       NUMBER
 ATTRIBUTE_NAME                     VARCHAR2(4000)
 ATTRIBUTE_VALUE                    VARCHAR2(4000)
 FREQUENCY                          BINARY_DOUBLE

Table 25-38 Frequency Component View

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

COMPONENT_ID

Unique identifier of a component

ATTRIBUTE_NAME

Column name

ATTRIBUTE_VALUE

Categorical attribute value

FREQUENCY

The frequency of the multivalued Bernoulli distribution for the attribute/value combination specified by ATTRIBUTE_NAME and ATTRIBUTE_VALUE.

For 2-Dimensional columns, EM provides an attribute ranking similar to that of Attribute Importance. This ranking is based on a rank-weighted average over Kullback–Leibler divergence computed for pairs of columns. This unsupervised Attribute Importance is shown in the DM$VImodel_name view and has the following schema:

Name                                       Type
 ----------------------------------------- ----------------------------
 PARTITION_NAME                            VARCHAR2(128)
 ATTRIBUTE_NAME                            VARCHAR2(128)
 ATTRIBUTE_IMPORTANCE_VALUE                BINARY_DOUBLE
 ATTRIBUTE_RANK                            NUMBER

Table 25-39 2–Dimensional Attribute Ranking for Expectation Maximization

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

ATTRIBUTE_NAME

Column name

ATTRIBUTE_IMPORTANCE_VALUE

Importance value

ATTRIBUTE_RANK

An attribute rank based on the importance value

The pairwise Kullback–Leibler divergence is reported in the DM$VBmodel_name view. This metric evaluates how much the observed joint distribution of two attributes diverges from the expected distribution under the assumption of independence. That is, the higher the value, the more dependent the two attributes are. The dependency value is scaled based on the size of the grid used for each pairwise computation. That ensures that all values fall within the [0; 1] range and are comparable. The view has the following schema:

Name                                       Type
 ----------------------------------------- ----------------------------
 PARTITION_NAME                            VARCHAR2(128)
 ATTRIBUTE_NAME_1                          VARCHAR2(128)
 ATTRIBUTE_NAME_2                          VARCHAR2(128)
 DEPENDENCY                                BINARY_DOUBLE

Table 25-40 Kullback-Leibler Divergence for Expectation Maximization

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

ATTRIBUTE_NAME_1

Name of an attribute 1

ATTRIBUTE_NAME_2

Name of an attribute 2

DEPENDENCY

Scaled pairwise Kullback-Leibler divergence

The projection table DM$VPmodel_name shows the coefficients used by random projections to map nested columns to a lower dimensional space. The view has rows only when nested or text data is present in the build data. The view has the following schema:

Name                                Type
 ---------------------------------- ----------------------------
 PARTITION_NAME                     VARCHAR2(128)
 FEATURE_NAME                       VARCHAR2(4000)
 ATTRIBUTE_NAME                     VARCHAR2(128)
 ATTRIBUTE_SUBNAME                  VARCHAR2(4000)
 ATTRIBUTE_VALUE                    VARCHAR2(4000)
 COEFFICIENT                        NUMBER

Table 25-41 Projection table for Expectation Maximization

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

FEATURE_NAME

Name of feature

ATTRIBUTE_NAME

Column name

ATTRIBUTE_SUBNAME

Nested column subname. The value is null for non-nested columns.

ATTRIBUTE_VALUE

Categorical attribute value

COEFFICIENT

Projection coefficient. The representation is sparse; only the non-zero coefficients are returned.

Global Details for Expectation Maximization

The following table describes global details for Expectation Maximization.

Table 25-42 Global Details for Expectation Maximization

Name Description

CONVERGED

Indicates whether the model build process has converged to specified tolerance. The possible values are:

  • YES

  • NO

LOGLIKELIHOOD

Loglikelihood on the build data

NUM_COMPONENTS

Number of components produced by the model

NUM_CLUSTERS

Number of clusters produced by the model

NUM_ROWS

Number of rows used in the build

RANDOM_SEED

The random seed value used for the model build

REMOVED_COMPONENTS

The number of empty components excluded from the model

25.4.12 Model Detail Views for k-Means

Model detail views for k-Means (KM) describes cluster description view and scoring view. Oracle recommends that you leverage model details view instead of GET_MODEL_DETAILS_KM function.

This section describes the differences in the views for k-Means against the Clustering views. For an overview of the different views, refer to "Model Detail Views for Clustering Algorithms". For k-Means, the cluster description view DM$VDmodel_name has an additional column:

Name                                Type
 ---------------------------------- ----------------------------
 DISPERSION                         BINARY_DOUBLE

Table 25-43 Cluster Description for k-Means

Column Name Description

DISPERSION

A measure used to quantify whether a set of observed occurrences are dispersed compared to a standard statistical model.

The scoring view DM$VCmodel_name describes the centroid of each leaf clusters:

Name                                Type
 ---------------------------------- ----------------------------
 PARTITION_NAME                     VARCHAR2(128)
 CLUSTER_ID                         NUMBER
 CLUSTER_NAME                       NUMBER/VARCHAR2
 ATTRIBUTE_NAME                     VARCHAR2(128)
 ATTRIBUTE_SUBNAME                  VARCHAR2(4000)
 ATTRIBUTE_VALUE                    VARCHAR2(4000)
 VALUE                              BINARY_DOUBLE

Table 25-44 Scoring View for k-Means

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

CLUSTER_ID

The ID of a cluster in the model

CLUSTER_NAME

Specifies the label of the cluster

ATTRIBUTE_NAME

Column name

ATTRIBUTE_SUBNAME

Nested column subname. The value is null for non-nested columns.

ATTRIBUTE_VALUE

Categorical attribute value

VALUE

Specifies the centroid value

The following table describes global view for k–Means.

Table 25-45 k–Means Statistics Information In Model Global View

Name Description

CONVERGED

Indicates whether the model build process has converged to specified tolerance. The following are the possible values:

  • YES

  • NO

NUM_ROWS

Number of rows used in the build

REMOVED_ROWS_ZERO_NORM

Number of rows removed due to 0 norm. This applies only to models using cosine distance.

25.4.13 Model Detail Views for O-Cluster

Model Detail Views for O-Cluster describes the statistics views. Oracle recommends that user leverage the model details views instead of the GET_MODEL_DETAILS_OC function.

The following are the differences in the views for O-Cluster against Clustering views. For an overview of the different clustering views, refer to "Model Detail Views for Clustering Algorithms". The OC algorithm uses the same descriptive statistics views as Expectation Maximization (EM) and k-Means (KM). The following are the statistics views:

  • Cluster description DM$VDmodel_name

  • Attribute statistics DM$VAmodel_name

  • Rule statistics DM$VRmodel_name

  • Histogram statistics DM$VHmodel_name

The Cluster description view DM$VDmodel_name describes the O-Cluster components. The cluster description view has additional fields that specify the split predicate. The view has the following schema:

Name                                Type
 ---------------------------------- ----------------------------
 ATTRIBUTE_NAME                     VARCHAR2(128)
 ATTRIBUTE_SUBNAME                  VARCHAR2(4000)
 OPERATOR                           VARCHAR2(2)        
 VALUE                              SYS.XMLTYPE

Table 25-46 Description View

Column Name Description

ATTRIBUTE_NAME

Column name

ATTRIBUTE_SUBNAME

Nested column subname. The value is null for non-nested columns.

OPERATOR

Split operator

VALUE

List of split values

The structure of the SYS.XMLTYPE is as follows:
<Element>splitval1</Element>

The OC algorithm uses a histogram view DM$VHmodel_name with a different schema than EM and k-Means (KM). The view has the following schema:

Name                                Type
 ---------------------------------- ----------------------------
 PARTITON_NAME                      VARCHAR2(128)
 CLUSTER_ID                         NUMBER
 ATTRIBUTE_NAME                     VARCHAR2(128)
 ATTRIBUTE_SUBNAME                  VARCHAR2(4000)
 BIN_ID                             NUMBER
 LABEL                              VARCHAR2(4000)   
 COUNT                              NUMBER          

Table 25-47 Histogram Component View

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

CLUSTER_ID

Unique identifier of a component

ATTRIBUTE_NAME

Column name

ATTRIBUTE_SUBNAME

Nested column subname. The value is null for non-nested columns.

BIN_ID

Unique identifier

LABEL

Bin label

COUNT

Bin histogram count

The following table describes the global view for O-Cluster.

Table 25-48 O-Cluster Statistics Information In Model Global View

Name Description

NUM_ROWS

The total number of rows used in the build

25.4.14 Model Detail Views for Explicit Semantic Analysis

Model Detail Views for Explicit Semantic Analysis (ESA) describes attribute statistics view and feature view. Oracle recommends that users leverage the model details views.

ESA algorithm has the following descriptive statistics views:

  • Attribute statistics DM$VAmodel_name

  • Features DM$VFmodel_name

The view DM$VAmodel_name has the following schema:

PARTITION_NAME                      VARCHAR2(128)
 FEATURE_ID                         NUMBER/VARCHAR2 
 ATTRIBUTE_NAME                     VARCHAR2(128)
 ATTRIBUTE_SUBNAME                  VARCHAR2(4000)
 ATTRIBUTE_VALUE                    VARCHAR2(4000)
 COEFFICIENT                        BINARY_DOUBLE

Table 25-49 Attribute View for Explicit Semantic Analysis

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

FEATURE_ID

Unique identifier of a feature as it appears in the training data

ATTRIBUTE_NAME

Column name

ATTRIBUTE_SUBNAME

Nested column subname. The value is null for non-nested columns.

ATTRIBUTE_VALUE

Categorical attribute value

COEFFICIENT

A measure of the weight of the attribute with respect to the feature

The view DM$VFmodel_name has a unique row for every feature in one view. This feature is helpful if the model was pre-built and the source training data are not available. The view has the following schema:

Name                                Type
 ---------------------------------- ----------------------------
 PARTITION_NAME                     VARCHAR2(128)
 FEATURE_ID                         NUMBER/VARCHAR2

Table 25-50 Feature View for Explicit Semantic Analysis

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

FEATURE_ID

Unique identifier of a feature as it appears in the training data

The following table describes the global view for Explicit Semantic Analysis.

Table 25-51 Explicit Semantic Analysis Statistics Information In Model Global View

Name Description

NUM_ROWS

The total number of input rows

REMOVED_ROWS_BY_FILTERS

Number of rows removed by filters

25.4.15 Model Detail Views for Non-Negative Matrix Factorization

Model detail views for Non-Negative Matrix Factorization (NMF) describes encoding H matrix view and H inverse matrix view. Oracle recommends that users leverage the model details views instead of the GET_MODEL_DETAILS_NMF function.

The NMF algorithm has two matrix content views:

  • Encoding (H) matrix DM$VEmodel_name

  • H inverse matrix DM$VImodel_name

The view DM$VEmodel_name describes the encoding (H) matrix of an NMF model. The FEATURE_NAME column type may be either NUMBER or VARCHAR2. The view has the following schema definition.

 Name		     Type
 ------------------- --------------------------
 PARTITION_NAME       VARCHAR2(128)
 FEATURE_ID           NUMBER
 FEATURE_NAME         NUMBER/VARCHAR2
 ATTRIBUTE_NAME       VARCHAR2(128)
 ATTRIBUTE_SUBNAME    VARCHAR2(4000)
 ATTRIBUTE_VALUE      VARCHAR2(4000)
 COEFFICIENT          BINARY_DOUBLE

Table 25-52 Encoding H Matrix View for Non-Negative Matrix Factorization

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

FEATURE_ID

The ID of a feature in the model

FEATURE_NAME

The name of a feature in the model

ATTRIBUTE_NAME

Column name

ATTRIBUTE_SUBNAME

Nested column subname. The value is null for non-nested columns.

ATTRIBUTE_VALUE

Specifies the value of attribute

COEFFICIENT

The attribute encoding that represents its contribution to the feature

The view DM$VImodel_view describes the inverse H matrix of an NMF model. The FEATURE_NAME column type may be either NUMBER or VARCHAR2. The view has the following schema:

 Name	           Type
 ----------------- ------------------------
 PARTITION_NAME     VARCHAR2(128)
 FEATURE_ID         NUMBER
 FEATURE_NAME       NUMBER/VARCHAR2
 ATTRIBUTE_NAME     VARCHAR2(128)
 ATTRIBUTE_SUBNAME  VARCHAR2(4000)
 ATTRIBUTE_VALUE    VARCHAR2(4000)
 COEFFICIENT        BINARY_DOUBLE

Table 25-53 Inverse H Matrix View for Non-Negative Matrix Factorization

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

FEATURE_ID

The ID of a feature in the model

FEATURE_NAME

The name of a feature in the model

ATTRIBUTE_NAME

Column name

ATTRIBUTE_SUBNAME

Nested column subname. The value is null for non-nested columns.

ATTRIBUTE_VALUE

Specifies the value of attribute

COEFFICIENT

The attribute encoding that represents its contribution to the feature

The following table describes the global statistics for Non-Negative Matrix Factorization.

Table 25-54 Non-Negative Matrix Factorization Statistics Information In Model Global View

Name Description

CONV_ERROR

Convergence error

CONVERGED

Indicates whether the model build process has converged to specified tolerance. The following are the possible values:
  • YES

  • NO

ITERATIONS

Number of iterations performed during build

NUM_ROWS

Number of rows used in the build input dataset

SAMPLE_SIZE

Number of rows used by the build

25.4.16 Model Detail Views for Singular Value Decomposition

Model detail views for Singular Value Decomposition (SVD) describes S Matrix view, right-singular vectors view, and left-singular vector view. Oracle recommends that users leverage the model details views instead of the GET_MODEL_DETAILS_SVD function.

The DM$VEmodel_name view leverages the fact that each singular value in the SVD model has a corresponding principal component in the associated Principal Components Analysis (PCA) model to relate a common set of information for both classes of models. For a SVD model, it describes the content of the S matrix. When PCA scoring is selected as a build setting, the variance and percentage cumulative variance for the corresponding principal components are shown as well. The view has the following schema:

 Name                                Type
 ---------------------------------- ----------------------------
 PARTITION_NAME                     VARCHAR2(128)
 FEATURE_ID                         NUMBER
 FEATURE_NAME                       NUMBER/VARCHAR2
 VALUE                              BINARY_DOUBLE
 VARIANCE                           BINARY_DOUBLE  
 PCT_CUM_VARIANCE                   BINARY_DOUBLE 

Table 25-55 S Matrix View

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

FEATURE_ID

The ID of a feature in the model

FEATURE_NAME

The name of a feature in the model

VALUE

The matrix entry value

VARIANCE

The variance explained by a component. This column is only present for SVD models with setting dbms_data_mining.svds_scoring_mode set to dbms_data_mining.svds_scoring_pca

This column is non-null only if the build data is centered, either manually or because of the following setting:dbms_data_mining.prep_auto is set to dbms_data_mining.prep_auto_on.

PCT_CUM_VARIANCE

The percent cumulative variance explained by the components thus far. The components are ranked by the explained variance in descending order.

This column is only present for SVD models with setting dbms_data_mining.svds_scoring_mode set to dbms_data_mining.svds_scoring_pca

This column is non-null only if the build data is centered, either manually or because of the following setting:dbms_data_mining.prep_auto is set to dbms_data_mining.prep_auto_on.

The SVD DM$VVmodel_view describes the right-singular vectors of SVD model. For a PCA model it describes the principal components (eigenvectors). The view has the following schema:

Name                                Type
 ---------------------------------- ----------------------------
 PARTITION_NAME                     VARCHAR2(128)
 FEATURE_ID                         NUMBER
 FEATURE_NAME                       NUMBER/VARCHAR2
 ATTRIBUTE_NAME                     VARCHAR2(128)
 ATTRIBUTE_SUBNAME                  VARCHAR2(4000)
 ATTRIBUTE_VALUE                    VARCHAR2(4000)
 VALUE                              BINARY_DOUBLE

Table 25-56 Right-singular Vectors of Singular Value Decomposition

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

FEATURE_ID

The ID of a feature in the model

FEATURE_NAME

The name of a feature in the model

ATTRIBUTE_NAME

Column name

ATTRIBUTE_SUBNAME

Nested column subname. The value is null for non-nested columns.

ATTRIBUTE_VALUE

Categorical attribute value. For numerical attributes, ATTRIBUTE_VALUE is null.

VALUE

The matrix entry value

The view DM$VUmodel_name describes the left-singular vectors of a SVD model. For a PCA model, it describes the projection of the data in the principal components. This view does not exist unless the settings dbms_data_mining.svds_u_matrix_output is set to dbms_data_mining.svds_u_matrix_enable. The view has the following schema:
Name                                Type
 ---------------------------------- ----------------------------
 PARTITION_NAME                     VARCHAR2(128)
 CASE_ID                            NUMBER/VARHCAR2
 FEATURE_ID                         NUMBER
 FEATURE_NAME                       NUMBER/VARCHAR2
 VALUE                              BINARY_DOUBLE

Table 25-57 Left-singular Vectors of Singular Value Decomposition or Projection Data in Principal Components

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

CASE_ID

Unique identifier of the row in the build data described by the U matrix projection.

FEATURE_ID

The ID of a feature in the model

FEATURE_NAME

The name of a feature in the model

VALUE

The matrix entry value

Global Details for Singular Value Decomposition

The following table describes a global detail for Singular Value Decomposition.

Table 25-58 Global Details for Singular Value Decomposition

Name Description

NUM_COMPONENTS

Number of features (components) produced by the model

NUM_ROWS

The total number of rows used in the build

SUGGESTED_CUTOFF

Suggested cutoff that indicates how many of the top computed features capture most of the variance in the model. Using only the features below this cutoff would be a reasonable strategy for dimensionality reduction.

25.4.17 Model Detail View for Minimum Description Length

Model detail view for Minimum Description Length (for calculating Attribute Importance) describes Attribute Importance view. Oracle recommends that users leverage the model details views instead of the GET_MODEL_DETAILS_AI function.

The Attribute Importance view DM$VAmodel_name describes the Attribute Importance as well as the Attribute Importance rank. The view has the following schema:

Name                                       Type
 ----------------------------------------- ----------------------------
 PARTITION_NAME                            VARCHAR2(128)
 ATTRIBUTE_NAME                            VARCHAR2(128)
 ATTRIBUTE_SUBNAME                         VARCHAR2(4000)
 ATTRIBUTE_IMPORTANCE_VALUE                BINARY_DOUBLE
 ATTRIBUTE_RANK                            NUMBER

Table 25-59 Attribute Importance View for Minimum Description Length

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

ATTRIBUTE_NAME

Column name

ATTRIBUTE_SUBNAME

Nested column subname. The value is null for non-nested columns.

ATTRIBUTE_IMPORTANCE_VALUE

Importance value

ATTRIBUTE_RANK

Rank based on importance

The following table describes the global view for Minimum Description Length.

Table 25-60 Minimum Description Length Statistics Information In Model Global View

Name Description

NUM_ROWS

The total number of rows used in the build

25.4.18 Model Detail View for Binning

The binning view DM$VB describes the bin boundaries used in the automatic data preparation.

The view has the following schema:

Name                                Type
 --------------------       --------------------
 PARTITION_NAME                     VARCHAR2(128)
 ATTRIBUTE_NAME                     VARCHAR2(128)   
 ATTRIBUTE_SUBNAME                  VARCHAR2(4000)  
 BIN_ID                             NUMBER           
 LOWER_BIN_BOUNDARY                 BINARY_DOUBLE          
 UPPER_BIN_BOUNDARY                 BINARY_DOUBLE   
 ATTRIBUTE_VALUE                    VARCHAR2(4000) 

Table 25-61 Model Details View for Binning

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

ATTRIBUTE_NAME

Specifies the attribute name

ATTRIBUTE_SUBNAME

Specifies the attribute subname

BIN_ID

Bin ID (or bin identifier)

LOWER_BIN_BOUNDARY

Numeric lower bin boundary

UPPER_BIN_BOUNDARY

Numeric upper bin boundary

ATTRIBUTE_VALUE

Categorical value

25.4.19 Model Detail Views for Global Information

Model detail views for Global Information describes global statistics view, alert view, and computed settings view. Oracle recommends that users leverage the model details views instead of GET_MODEL_DETAILS_GLOBAL function.

The global statistics view DM$VGmodel_name describes global statistics related to the model build. Examples include the number of rows used in the build, the convergence status, and the model quality metrics. The view has the following schema:

Name                                Type
 -------------------         --------------------
 PARTITION_NAME                     VARCHAR2(128)
 NAME                               VARCHAR2(30)     
 NUMERIC_VALUE                      NUMBER           
 STRING_VALUE                       VARCHAR2(4000) 

Table 25-62 Global Statistics View

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

NAME

Name of the statistic

NUMERIC_VALUE

Numeric value of the statistic

STRING_VALUE

Categorical value of the statistic

The alert view DM$VWmodel_name lists alerts issued during the model build. The view has the following schema:

Name                                Type
 -------------------       ----------------------
 PARTITION_NAME                     VARCHAR2(128)
 ERROR_NUMBER                       BINARY_DOUBLE
 ERROR_TEXT                         VARCHAR2(4000)  

Table 25-63 Alert View

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

ERROR_NUMBER

Error number (valid when event is Error)

ERROR_TEXT

Error message

The computed settings view DM$VSmodel_name lists the algorithm computed settings. The view has the following schema:

Name                                Type
 -----------------          --------------------
 PARTITION_NAME                     VARCHAR2(128)
 SETTING_NAME                       VARCHAR2(30)
 SETTING_VALUE                      VARCHAR2(4000)

Table 25-64 Computed Settings View

Column Name Description

PARTITION_NAME

Partition name in a partitioned model

SETTING_NAME

Name of the setting

SETTING_VALUE

Value of the setting

25.4.20 Model Detail View for Normalization and Missing Value Handling

The Normalization and Missing Value Handling View DM$VN describes the normalization parameters used in Automatic Data Preparation (ADP) and the missing value replacement when a NULL value is encountered. Missing value replacement applies only to the two­dimensional columns and does not apply to the nested columns.

The view has the following schema:

Name                                Type
 ----------------------       -----------------------
 PARTITION_NAME                     VARCHAR2(128)
 ATTRIBUTE_NAME                     VARCHAR2(128)
 ATTRIBUTE_SUBNAME                  VARCHAR2(4000)
 NUMERIC_MISSING_VALUE              BINARY_DOUBLE  
 CATEGORICAL_MISSING_VALUE          VARCHAR2(4000)  
 NORMALIZATION_SHIFT                BINARY_DOUBLE   
 NORMALIZATION_SCALE                BINARY_DOUBLE 

Table 25-65 Normalization and Missing Value Handling View

Column Name Description

PARTITION_NAME

A partition in a partitioned model

ATTRIBUTE_NAME

Column name

ATTRIBUTE_SUBNAME

Nested column subname. The value is null for non-nested columns.

NUMERIC_MISSING_VALUE

Numeric missing value replacement

CATEGORICAL_MISSING_VALUE

Categorical missing value replacement

NORMALIZATION_SHIFT

Normalization shift value

NORMALIZATION_SCALE

Normalization scale value