IBM DB2 Intelligent Miner Modeling

Administration and Programming

Version 8.2
SH12-6736-01
Note

Before using this information and the product it supports, be sure to read the information in Appendix E. Notices.

Second Edition, August 2004

This edition applies to Version 8.2 of IBM DB2 Intelligent Miner Modeling, program number 5765-F32, and to all subsequent releases and modifications until otherwise indicated in new editions.

This edition replaces SH12-6736-00.

Copyright International Business Machines Corporation 2001, 2004. All rights reserved.
US Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

Contents

Figures
Tables
About this book
Who should use this book
Conventions and terminology used in this book
How this book is structured
How to read the syntax diagrams
How to send your comments
What is new in version 8.2
Ease of use
Platform support
Functional enhancements
Standards conformance
Shared infrastructure with IM Scoring
Consistency notices
Overview of the IM products
Introducing the Intelligent Miner products
IBM DB2 Intelligent Miner Scoring
IBM DB2 Intelligent Miner Modeling
IBM DB2 Intelligent Miner Visualization
IBM DB2 Intelligent Miner for Data
Introducing data mining with IM Modeling
The goal of data mining
Familiarizing yourself with model training
Introducing the data mining process
Specifying mining data
Defining logical data specifications
Defining mining settings
Defining mining tasks
Building and storing mining models
Testing a model and analyzing its quality
Testing Classification or Regression models
Analyzing the model quality
Working with mining models and test results
Introducing data mining functions
Associations
Business context
Concepts
Items and groups in tables
Rule body and rule head
Support in an association rule
Confidence in an association rule
Lift in an association rule
Name mappings
Taxonomies
Rule length and item constraints
Active or inactive fields
Classification
Business context
Concept
Decision tree Classification
Class label field
Maximum purity per internal node
Maximum tree depth
Minimum number of records per internal node
Tolerated levels of incorrect predictions
Cost matrix
Active or inactive fields
Clustering
Business context
Concept
Distribution-based Clustering
Similarity
Maximum number of clusters
Similarity threshold
Active or supplementary fields
Field weighting
Value weighting
Similarity scale
Similarity matrices
Outlier treatment
Desired execution time
Minimum percentage of data
Regression
Business context
Concept
Target field
Maximum tolerated systematic error (RSquared)
Desired execution time
Active or inactive fields
Introducing database objects and data mining in SQL
User-defined data types
User-defined data types describing input data
User-defined data types specific to mining functions
User-defined data types in the model-building process
User-defined data types in the model-testing process
User-defined data types in a Classification training and test run
User-defined methods
User-defined functions
Stored procedures
SQL code examples for data mining
Sample scenario
Model-building procedure
Code example
PMML: A markup language for data mining
Quick start using the sample applications
Running the sample applications
Using the Clustering mining function
Creating the sample table
Using the Clustering mining function for clustering segmentation
Defining a task and starting a Clustering training run
Extracting information from a Clustering model
Building and running a task
Specifying mining data
Defining logical data specifications and Clustering settings
Defining Clustering mining tasks
Starting training runs
Deleting entries from the sample tables
Using the Classification mining function
Creating a sample table
Creating a Classification task and building a Classification model
Extracting information from a Classification model
Testing a Classification model
Working with a Classification test result
Deleting entries from the sample tables
Using the Regression mining function
Creating a sample table
Creating a Regression task and building a Regression model
Extracting information from a Regression model
Testing a Regression model
Working with a Regression test result
Deleting entries from the sample table
Using the Associations mining function
Creating the sample tables
Creating an Associations task and building an Associations model
Extracting information from an Associations model
Deleting entries from the sample tables
Creating additional error and progress tables
Working with the sample error tables
Working with the sample progress tables
Using IM Modeling
Creating database objects
Enabling databases
Disabling databases
Checking databases
Specifying mining data
Specifying the source table for your data
Defining alias names
Filtering data
Defining logical data specifications
Deriving a logical data specification from a mining data value
Deriving a logical data specification from individual fields
Defining field types and properties
Defining name mappings
Defining a name mapping in the logical data specification
Activating a name mapping
Retrieving information about a name mapping
Removing a name mapping
Defining taxonomies
Defining a taxonomy in the logical data specification
Adding and removing category maps
Activating a taxonomy
Retrieving information about a taxonomy
Removing a taxonomy
Dealing with issues specific to mining functions
Associations
Classification
Clustering
Regression
Defining mining settings
Adding a logical data specification to a settings value
Defining settings that are specific to mining functions and algorithms
Autonomic variable selection
Features of autonomic variable selection
Specifying the usage type
Memory usage and impact
Specifying power options
Specifying settings parameters for the Associations mining function
Defining the layout of the input table
Controlling the number of association rules
Defining fields as active or inactive
Specifying settings parameters for the Classification mining function
Specifying the class label field
Specifying maximum purity
Specifying maximum tree depth
Specifying the minimum number of records per internal node
Specifying the tolerated level of incorrect predictions
Defining a cost matrix
Defining fields as active or inactive
Specifying settings parameters for the Clustering mining function
Defining fields as active and supplementary
Specifying field weighting
Specifying value weighting
Specifying similarity scale
Treating outliers
Specifying a similarity matrix
Specifying the maximum number of clusters
Defining the similarity threshold
Setting the desired execution time
Specifying the minimum percentage of data that is processed
Specifying settings parameters for the Regression mining function
Specifying the target field
Specifying the maximum tolerated systematic error (RSquared)
Setting the desired execution time
Defining fields as active and inactive
Defining mining tasks
Defining mining task values for training runs
Defining mining task values for test runs
Defining additional control parameters
Building and storing mining models
Executing a training run
Example for a Clustering training run
Testing a model and analyzing its quality
Testing Classification or Regression models
Executing a test run on the mining model
Executing a test run on the test task
Analyzing the model quality
Quality concepts
Using the confusion and cost matrix of a Classification model
Checking the overall quality
Checking gains chart information
Deviations between predicted values and actual target values
Comparing the order of data records
Systematic error in DM_RegressionModel
Capability to correctly predict unknown data
Identifying the deviation between predicted and actual target values
Working with mining models and test results
Working on mining models
Introducing field importance and field-field correlation
Identifying fields in the logical data specification
Extracting the name of a model
Identifying the mining task
Retrieving information specific to mining functions
Exporting mining models
Working with test results
Retrieving information from test results
Exporting test results
Reference
Overview of IM Modeling's database objects
Data types
Structured types
Distinct types
Mining field types
Mining data methods
Logical data specification methods
Specifying fields
Specifying categorical field properties
Specifying name mappings
Specifying taxonomies
Specifying numerical field properties
Mining settings methods
DM_RuleSettings
DM_ClasSettings
DM_ClusSettings
DM_RegSettings
Methods for all DM_*Settings types
Mining tasks methods
DM_ClasBldTask
DM_ClasTestTask
DM_RegTestTask
DM_ClusBldTask
DM_RuleBldTask
DM_RegBldTask
Methods for all DM_*Task types
Stored procedures for building mining models
Stored procedures for testing mining models
Functions for analyzing mining models and test results
Functions for analyzing model type DM_RuleModel
Functions for analyzing model type DM_ClasModel
Functions for analyzing model type DM_ClusteringModel
Functions for analyzing model type DM_RegressionModel
Functions for analyzing test results
Functions for type DM_ClasTestResult
Functions for type DM_RegTestResult
Functions for working with mining models
Functions for working with model type DM_RuleModel
Functions for working with model type DM_ClasModel
Functions for working with model type DM_ClusteringModel
Functions for working with model type DM_RegressionModel
Functions for working with test results
Functions for type DM_ClasTestResult
Functions for type DM_RegTestResult
Stored procedures used for administrative and informational tasks
Naming conventions and parameter sizes
Naming conventions
Parameter sizes
Methods reference
DM_addConItem
DM_addDataSpecFld
DM_addNmp
DM_addSimMat
DM_addTax
DM_addTaxMap
DM_defClasBldTask
DM_defClasTestTask
DM_defClusBldTask
DM_defMiningData
DM_defRegBldTask
DM_defRegTestTask
DM_defRuleBldTask
DM_expClasSettings
DM_expClasTask
DM_expClasTestTask
DM_expClusSettings
DM_expClusTask
DM_expDataSpec
DM_expMiningData
DM_expRegSettings
DM_expRegTask
DM_expRegTestTask
DM_expRuleSettings
DM_expRuleTask
DM_genDataSpec
DM_getClasCost
DM_getClasCostRate
DM_getClasDataSpec
DM_getClasMdlCol
DM_getClasMdlID
DM_getClasMdlIDCol
DM_getClasMdlTab
DM_getClasSettings
DM_getClasTarget
DM_getClasTestData
DM_getClasTrnData
DM_getClasValData
DM_getClusDataSpec
DM_getClusSettings
DM_getClusTrnData
DM_getColumnName
DM_getConItem
DM_getConType
DM_getCostMatAV
DM_getCostMatPV
DM_getCostMatTab
DM_getCostMatWGT
DM_getDClusFldPar
DM_getDClusPar
DM_getErrorTab
DM_getExecTime
DM_getFldAlias
DM_getFldName
DM_getFldNmp
DM_getFldOutlLimLo
DM_getFldOutlLimUp
DM_getFldOutlTreat
DM_getFldSimMat
DM_getFldSimScale
DM_getFldTax
DM_getFldType
DM_getFldUsageType
DM_getFldWeight
DM_getGroup
DM_getItemFld
DM_getItemFormat
DM_getMaxLen
DM_getMaxNumClus
DM_getMinConf
DM_getMinData
DM_getMinSupport
DM_getNmpMapValCol
DM_getNmpName
DM_getNmpTabName
DM_getNmpValCol
DM_getNumColumns
DM_getNumConItem
DM_getNumFields
DM_getNumNmp
DM_getNumSimMat
DM_getNumTax
DM_getNumTaxMap
DM_getPowerOptions
DM_getProgTab
DM_getRegDataSpec
DM_getRegMdlCol
DM_getRegMdlID
DM_getRegMdlIDCol
DM_getRegMdlTab
DM_getRegRSquared
DM_getRegSettings
DM_getRegTarget
DM_getRegTestData
DM_getRegTrnData
DM_getRegValData
DM_getRuleDataSpec
DM_getRuleSettings
DM_getRuleTrnData
DM_getSimMatName
DM_getSimMatSim
DM_getSimMatTab
DM_getSimMatVal1
DM_getSimMatVal2
DM_getTableName
DM_getTaxChildCol
DM_getTaxMapType
DM_getTaxName
DM_getTaxParentCol
DM_getTaxParentNmp
DM_getTaxTabName
DM_getTreeClasPar
DM_getWhereClause
DM_impClasSettings
DM_impClasTask
DM_impClasTestTask
DM_impClusSettings
DM_impClusTask
DM_impDataSpec
DM_impMiningData
DM_impRegSettings
DM_impRegTask
DM_impRegTestTask
DM_impRuleSettings
DM_impRuleTask
DM_isCompatible
DM_remConItem
DM_remDataSpecFld
DM_remNmp
DM_remSimMat
DM_remTax
DM_remTaxMap
DM_setClasCost
DM_setClasCostRate
DM_setClasTarget
DM_setColumns
DM_setConType
DM_setCostMat
DM_setDClusFldPar
DM_setDClusPar
DM_setErrorTab
DM_setExecTime
Return value for clustering
Return value for regression
DM_setFldAlias
DM_setFldNmp
DM_setFldOutlLim
DM_setFldOutlTreat
DM_setFldSimMat
DM_setFldSimScale
DM_setFldTax
DM_setFldType
DM_setFldUsageType
DM_setFldWeight
DM_setGroup
DM_setItemFld
DM_setItemFormat
DM_setMaxLen
DM_setMaxNumClus
DM_setMinConf
DM_setMinData
DM_setMinSupport
DM_setPowerOptions
DM_setProgTab
DM_setRegRSquared
DM_setRegTarget
DM_setTreeClasPar
DM_setWhereClause
DM_useClasDataSpec
DM_useClusDataSpec
DM_useRegDataSpec
DM_useRuleDataSpec
Functions reference
DM_expClasModel
DM_expClasTestRes
DM_expClusModel
DM_expRegTestRes
DM_expRegModel
DM_expRuleModel
DM_getClasCostRate
DM_getClasError
DM_getClasMdlName
DM_getClasMdlSpec
DM_getClasTarget
DM_getClasTask
DM_getClusMdlName
DM_getClusMdlSpec
DM_getClusTask
DM_getClusterName
DM_getClusters
DM_getConfMatrix
DM_getCorrelations
DM_getErrors(rowcount)
DM_getFields
DM_getFields(miningData)
DM_getGainsChart
Return value for regression
Return value for classification
DM_getMdlQuality
DM_getNumClusters
DM_getNumRules
DM_getNumTransacts
DM_getPredAccuracy
Return value for regression
Return value for classification
DM_getPredError
DM_getRankQuality
Return value for regression
Return value for classification
DM_getRegMdlName
DM_getRegMdlSpec
DM_getRegRSquared
DM_getRegTarget
DM_getRegTask
DM_getReliability
Return value for regression
Return value for classification
DM_getRMSE
DM_getRuleBodies
DM_getRuleMdlName
DM_getRules
DM_getRuleTask
DM_getTreeRules
DM_isValidated
Stored procedures reference
DM_buildClasModel,
DM_buildClasModelCmd
DM_buildClusModel,
DM_buildClusModelCmd
DM_buildRegModel,
DM_buildRegModelCmd
DM_buildRuleModel,
DM_buildRuleModelCmd
DM_cancelTask
DM_getEnv
DM_getMiningData
DM_setEnv
DM_testClasModelD (using mining data),
DM_testClasModelCmdD
DM_testClasModelT (using a test task),
DM_testClasModelCmdT
DM_testRegModelD (using mining data),
DM_testRegModelCmdD
DM_testRegModelT (using a test task),
DM_testRegModelCmdT
Command reference
The idmcheckdb command
The idmdisabledb command
The idmenabledb command
The idminstfunc command
The idmuninstfunc command
The idmlevel command
The idmlicm command
Administration
Setting environment variables (for error and trace)
Getting progress information
Getting error information
Error handling
Defining the error file and error table
Getting support
Problem identification worksheet
Getting product information
Getting trace information
Using the tracing facility on UNIX systems
Using the tracing facility on Windows systems
Getting DB2 diagnostic information
Canceling mining runs
Migrating from IM Modeling V8.1
Working with IM Modeling V8.1 and V8.2 in parallel
Migrating from DB2 Version 7
Migrating from IM Modeling Version 8.1
Migrating a DB2 instance (UNIX only)
Migrating databases (all platforms)
Database instance restart
Appendixes
Appendix A. Using interfaces
Appendix B. Comparing IM Modeling with IM for Data
Physical data specifications (DM_MiningData)
Settings parameters
Clustering
Classification
Migration from IM for Data
Appendix C. Coexistence with IM Scoring
Shared schema
Shared data types
Shared functions
Shared methods
Shared commands
Appendix D. IM Modeling conformance to PMML
Appendix E. Notices
Trademarks
Glossary
Bibliography
IBM DB2 Intelligent Miner publications
Related information
IBM Web sites
Other Web sites
Index

Figures

  1. Using IM products in your business environment
  2. SQL API in IM Modeling
  3. The model-testing phase
  4. A taxonomy with three hierarchy levels
  5. An unbalanced hierarchy
  6. User-defined types in the model-building phase
  7. User-defined types in the model-testing phase
  8. User-defined types in a Classification training and test run

Tables

  1. Formatting conventions
  2. Abbreviations
  3. PMML model types, mining functions, and mining algorithms
  4. Category map 1: Non-recursive
  5. Category map 2: Non-recursive
  6. Category map: Recursive
  7. Selected input fields for the Classification mining function
  8. Sample cost matrix table
  9. Applying field weighting
  10. Applying field weighting and value weighting with compensation switched on
  11. Contents of the table MYSCHEMA.MYTAXTABLE
  12. Contents of the table MYSCHEMA.MYNMPTABLE
  13. Table layout--Example 1
  14. Table layout--Example 2
  15. Table layout--Example 3
  16. Table layout--Example 4
  17. Resultant item names
  18. Modified table layout of example 2--Example 5
  19. Additional customer data
  20. Joined table layout
  21. Functions for exporting mining models
  22. Structured data types
  23. Distinct data types
  24. Mining field types
  25. Methods for type DM_MiningData
  26. Methods for type DM_LogicalDataSpec: Specifying fields
  27. Methods for type DM_LogicalDataSpec: Specifying categorical field properties
  28. Methods for type DM_LogicalDataSpec: Specifying name mappings
  29. Methods for type DM_LogicalDataSpec: Specifying taxonomies
  30. Methods for type DM_LogicalDataSpec: Specifying numerical field properties
  31. Methods for type DM_RuleSettings: Specifying general rule settings
  32. Methods for type DM_RuleSettings: Specifying item constraints
  33. Methods for type DM_ClasSettings: Specifying general Classification settings
  34. Methods for type DM_ClasSettings: Specifying a cost matrix
  35. Methods for type DM_ClusSettings: Specifying general Clustering settings
  36. Methods for type DM_ClusSettings: Specifying similarity matrices
  37. Methods for type DM_ClusSettings: Specifying field-specific settings
  38. Methods for type DM_RegSettings: Specifying general Regression settings
  39. Methods for type DM_RegSettings: Specifying field specific settings
  40. Methods for all DM_*Settings types
  41. Methods for type DM_ClasBldTask
  42. Methods for type DM_ClasTestTask
  43. Methods for type DM_RegTestTask
  44. Methods for type DM_ClusBldTask
  45. Methods for type DM_RuleBldTask
  46. Methods for type DM_RegBldTask
  47. Methods for all DM_*Task types
  48. Procedures for building mining models
  49. Procedures for testing mining models
  50. Functions for type DM_RuleModel
  51. Functions for type DM_ClasModel
  52. Functions for type DM_ClusteringModel
  53. Functions for type DM_RegressionModel
  54. Functions for type DM_ClasTestResult
  55. Functions for type DM_RegTestResult
  56. Functions for type DM_RuleModel
  57. Functions for type DM_ClasModel
  58. Functions for type DM_ClusteringModel
  59. Functions for type DM_RegressionModel
  60. Functions for type DM_ClasTestResult
  61. Functions for type DM_RegTestResult
  62. Stored procedures for administrative and informational tasks
  63. sqlType values contained in the return value
  64. Result values for DM_getClusters
  65. Sample table returned by DM_getClusters
  66. Result values for DM_getConfMatrix
  67. Sample table returned by DM_getConfMatrix
  68. Result values for DM_getCorrelations
  69. Sample table returned by DM_getCorrelations
  70. An example
  71. Sample table returned by DM_getCorrelations
  72. Result values for DM_getErrors
  73. Result values for DM_getFields
  74. Sample table returned by DM_getFields
  75. Result values for DM_getFields(miningData)
  76. Sample table returned by DM_getFields(miningData)
  77. Result values for DM_getGainsChart
  78. Sample table returned by DM_getGainsChart
  79. Result values for DM_getGainsChart
  80. Sample table returned by DM_getGainsChart
  81. Result values for DM_getRuleBodies
  82. Sample table returned by DM_getRuleBodies
  83. Result values for DM_getRules
  84. Sample table returned by DM_getRules
  85. Result values for DM_getTreeRules
  86. Sample table returned by DM_getTreeRules
  87. The idmcheckdb messages
  88. PIT columns
  89. EMT columns
  90. Comparing IM Modeling with IM for Data: Clustering parameters
  91. Comparing IM Modeling with IM for Data: Classification parameters

About this book

IBM(R) DB2(R) Intelligent Miner(TM) Modeling is a DB2 SQL application programming interface. It consists of a set of database objects that enable you to build data mining models from information that is held in IBM DB2 databases. The DB2 SQL interface supports the rapid creation of data mining modeling applications.

Throughout this book, the following abbreviations are used:

This book describes how to install and use IM Modeling. It also provides a comprehensive reference resource to all of the database objects that make up IM Modeling.

For more information on:

Who should use this book

This book is intended for use by the following users:

Conventions and terminology used in this book

In DB2, the names of functions, data types, tables, and table columns are created in uppercase characters, even if you used, for example, lowercase characters. In this book, these names are represented in mixed case for better readability.

Note:
Identifiers such as table or column names are translated into uppercase in DB2 SQL statements, if they are not enclosed by double quotes ("). To avoid problems, identifiers are written in uppercase and enclosed by double quotes in this book, such as:
Example of how to specify identifiers
CREATE TABLE "BANKING_SCORING" (
"CLIENT_ID" CHAR(9) NOT NULL PRIMARY KEY,
"AGE" REAL,
"GENDER" CHAR(2),
"MARITAL_STATUS" CHAR(12),
"PROFESSION" CHAR(24),
"NBR_YEARS_CLI" REAL,
"SAVINGS_ACCOUNT" CHAR(3),
"HAS_LIFE_INSURANCE" CHAR(3),
"INT_CREDITCARD" CHAR(3),
"ONLINE_ACCESS" CHAR(3),
"JOINED_ACCOUNTS" CHAR(3),
"BANKCARD" CHAR(3),
"AVERAGE_BALANCE" DECIMAL(10,2),
"NO_CRED_TRANS" REAL,
"NO_DEBIT_TRANS" REAL ) NOT LOGGED INITIALLY

Table 1 shows the formatting conventions used in this book.

Table 1. Formatting conventions
Convention used How it is used
Command syntax is shown in a monospaced font. db2 -stf idmtab.db2
The names of the following are shown in a monospaced font:
  • Files and directories
  • Database tables and columns
  • SQL methods, functions, procedures, and data types
Use the DM_defMiningData method to construct a new DM_MiningData value. The column information is automatically retrieved. For more information refer to DM_defMiningData.
Variables within syntax descriptions, which you should replace by a real value, are shown in italics. If they consist of more than one word they are placed between angle brackets. idmdisabledb <db name>
Italics are used to highlight the introduction of a new term, or for emphasis. The Classification mining function analyzes records that are already known to belong to a certain class.

Table 2 shows the abbreviations used in this book.

Table 2. Abbreviations
Abbreviation Full form
API Application programming interface
CRM Customer Relationship Management
EMT Error message table
ISV Independent software vendor
PIT Progress information table
PMML Predictive Model Markup Language
RPM Redhat Package Manager
SQL Structured Query Language
UDF User-defined function
UDM User-defined method
UDT User-defined data type
XML Extensible Markup Language

How this book is structured

This book is divided into the following parts:

Overview of the IM products
Provides a general introduction to the IM products.
Introducing data mining with IM Modeling
Provides a general introduction to IM Modeling and to data mining in general for both business analysts and technical users.
Quick start using the sample applications
Provides a quick overview of the tasks you need to do to get started to run the sample applications.
Using IM Modeling
Provides a detailed guide to building data mining models with IM Modeling and to using its model-testing capability.
Reference
Provides a complete reference resource to all of the database objects and commands that make up IM Modeling.
Administration
Provides information on how to administer, diagnose, and migrate IM Modeling.

The appendixes provide information about the interfaces provided by IM Modeling and how IM Modeling is related to other data mining products. You can also find a glossary of terms related to data mining, a bibliography, and an index.

How to read the syntax diagrams

In the reference part of this book, the syntax for IM Modeling's functionality is described using the following structure:

How to send your comments

Your feedback is important in helping us to provide you with the most accurate and high-quality information possible. If you have any comments about this book:

What is new in version 8.2

This section introduces you to the new features in IM Modeling.

Ease of use

Easy mining procedures
The Easy Mining procedures introduce new high-level task-oriented SQL procedures. With the Easy Mining procedures, you can perform data mining efficiently and successfully in a business context without the need of in-depth data mining skills. You only need to be familiar with the appropriate business area where you want to apply data mining. There are Easy Mining procedures for common mining tasks and for basic mining steps. The Easy Mining procedures are described in DB2 Intelligent Miner Scoring and DB2 Intelligent Miner Modeling: Data Mining with Easy Mining procedures.
Intelligent Miner Add-In for Microsoft(R) Excel
The Intelligent Miner CD contains a Microsoft Excel Add-In that contains Visual Basic sample code to invoke Intelligent Miner from Microsoft Excel.
WebSphere(R) Studio Plug-in for DB2 Intelligent Miner
The Intelligent Miner CD contains a preview of WebSphere Studio Plug-In for Intelligent Miner. The WebSphere Studio Plug-in for DB2 Intelligent Miner is a plug-in for WebSphere Studio development tools (WSSD, WSAD, WSED) that can be used as a graphical front-end for DB2 Intelligent Miner Scoring and Modeling to generate SQL and Java(TM) code for the Intelligent Miner API.
Self-configuration and input formats
IM Modeling improves self-configuration and self-optimization in the mining algorithms:
Autonomic variable selection
IM Modeling provides autonomic variable selection to control field importance for the mining process. The algorithms detect which fields to use for mining and perform some data conditioning (like discretization or pivoting in Associations) or internal transformations for date, time, and timestamp without manual interaction.
New samples
The IM Modeling samples have been enhanced and reworked. In addition the IM product CD contains a new set of tutorials. The tutorials are designed to guide application designers and application developers through the process of gaining insight from data mining analysis to applying it in end-user applications. Practical examples show how business problems can be addressed with mining analytics. Application developers can use the sample applications as templates to reduce the delivery time of their own business intelligence applications. You can also find these tutorials online under the Tutorial page

Platform support

IM Modeling is available as 32-bit and 64-bit version. In addition to Windows(R), Linux(R), AIX(R), and Solaris platforms, IM Modeling now supports HP/UX (Itanium). On AIX, Linux (Itanium), and Solaris, IM Modeling now natively supports 64-bit DB2 instances.

Functional enhancements

New data mining function: Regression
A Regression model predicts the value of an unknown numerical quantity from the known values of other quantities. For example, a Regression model could predict the earnings of a certain supermarket in the month of June, given its location type (city/suburb/countryside), the population and the number of competing markets in the catchment area and some other demographic data. The unknown quantity is called the target variable or target field. Together with Classification models, which predict the value of a non-numeric categorical target field, Regression models form the group of predictive data mining models. Transform Regression is a patented new algorithm from IBM Research which is superior to traditional regression techniques such as Linear Regression in its prediction quality and its ease of use: the algorithm is parameter free and can be applied to a wide range of data without any user interaction or customization.
SQL APIs to access model content and model quality
You can use the SQL APIs to:
idmenabledb
This command has been enhanced to allow you to specify the size of the result specification. It can also configure the database manager configuration parameters. For details see The idmenabledb command.
Improved error detection
During model import errors are checked and identified.
Improved performance and scalability
IM Modeling now allows for parallel modeling for numeric prediction.
New or updated methods
New or updated methods are provided:
New functions
The following user-defined functions are provided:
New stored procedures
The following stored procedures are provided:

Standards conformance

PMML 2.1 support
IM Modeling produces data mining models in PMML, a markup language for data mining. For more information refer to Appendix D. IM Modeling conformance to PMML.
SQL/MM
IM Modeling adheres to the SQL Multimedia (SQL/MM) standard, which is an International Standard for data mining. The standard is developed by ISO (the International Organization for Standardization) and IEC (the International Electrotechnical Commission), who together form a specialized system for worldwide standardization.

The standards for data mining are outlined in ISO/IEC 13249; the description appears in Part 6: Data Mining of the standards specification. This specification has the general title Information technology - Database languages - SQL Multimedia and Application Packages.

Shared infrastructure with IM Scoring

IM Scoring shares common infrastructure like XML parsing, error handling, tracing, licensing, and diagnostics with IM Modeling.

Consistency notices

You should consider the following consistency notices when using IM Modeling V8.2:

Overview of the IM products

Introducing the Intelligent Miner products
IBM DB2 Intelligent Miner Scoring
IBM DB2 Intelligent Miner Modeling
IBM DB2 Intelligent Miner Visualization
IBM DB2 Intelligent Miner for Data

Introducing the Intelligent Miner products

The IBM DB2 Intelligent Miner is a set of the following products:

These products provide rapid enablement of IM analytics that are embedded in Business Intelligence (BI), eCommerce, or traditional Online Transaction Processing (OLTP) application programs. They are available as separately priced products. They are also available in the IBM DB2 Data Warehouse Edition, except for IM for Data.

In addition to the set of IM products, the following features for Intelligent Miner are available for free on alphaWorks(R) at the alphaWorks home page:

IM Scoring and IM Modeling constitute a software development kit (SDK). They consist of Oracle cartridges (IM Scoring only) or DB2 extensions that include an SQL API. You can embed the SQL API in business applications to exploit the data mining functions from this business application.

The SQL API consists of the following layers that provide different granularity and a different degree of abstraction:

In DB2, professionals can interactively issue SQL statements from the command center or from the command line processor. They can also start Intelligent Miner functions from one of these interfaces.

Intelligent Miner V8.2 provides an add-in demo that is based on an Excel spreadsheet. This demo illustrates the functionality of the SQL API and how to use it. With this demo, you can prototype IM functions to develop a proof-of-concept without dealing with the complexity of the SQL API.

To assist application developers, Intelligent Miner V8.2 provides a WebSphere Studio Plug-in. This plug-in contains graphical wizards and editors that are integrated in the WebSphere Studio Plug-in environment. With these tools, application developers can graphically model mining tasks and generate the SQL to embed IM SQL functionality into their business applications.

Depending on the experience, the personal preferences, the mining skills, and the complexity of the problem to solve, you can choose between the following approaches to develop a mining solution:

Figure 1. Using IM products in your business environment
Using IM  products in your business environment

Figure 1 shows a typical scenario of how you can use the IM products in your business environment:

For more information refer to:

IBM DB2 Intelligent Miner Scoring

IM Scoring provides scoring technology as database extenders, DB2 extenders, and Oracle cartridges. It enables application programs to apply PMML models to large databases, subsets of databases, or single rows or cases. Application programs use the SQL API, which consists of user-defined functions (UDFs) and user-defined methods (UDMs), to perform the scoring operation. The PMML models might have been created by one of the Intelligent Miner products or by other applications and tools that support PMML models.

The following table shows the different PMML models that can be applied by different mining algorithms.

Table 3. PMML model types, mining functions, and mining algorithms
Data mining function PMML model type Mining algorithm Generated by IM for Data Generated by IM Modeling
Clustering Center-based clustering Center-based Clustering algorithm yes no
Distribution-based clustering Distribution-based Clustering algorithm yes yes
Classification Neural networks Neural Classification algorithm yes no
Decision tree Tree Classification algorithm yes yes
Regression Logistic Regression algorithm no no
Regression Regression Linear Regression algorithm yes no
composite MiningModel (see Notes) Transform Regression algorithm no yes
Proprietary XML RBF Prediction algorithm yes no
Neural networks Neural Regression algorithm yes no
Notes:
  1. IM Scoring supports models that are built by the RBF Prediction algorithm of the Intelligent Miner for Data. These models are not yet part of PMML. You can export these models in XML format from the Intelligent Miner for Data and use them with IM Scoring.
  2. Mining models that are applied by the SQL API of IM Scoring must be contained in database tables.
  3. Transform Regression models created by IM Modeling are not fully PMML 2.1 compliant models. They use existing PMML 2.1 element names with several minor additions. These additions have been submitted to be part of the next PMML 3.0 standard.

IM Scoring includes IM Scoring Java Beans, which enables you to score a single data record in a Java application given a PMML model. This can be used to integrate scoring in e-business applications, for example, for real-time scoring in customer relationship management (CRM) systems.

IBM DB2 Intelligent Miner Modeling

IM Modeling provides IM Modeling technology as DB2 extenders. It enables SQL application programs to develop analytic models based on data accessed by DB2 Universal Database(TM) Version 8.1 or Version 8.2 SQL. Using the SQL API, you can build Associations, Distribution-based Clustering, Tree Classification, and Transform Regression PMML models that are stored in DB2 tables. They can be processed by IM Scoring or IM Visualization.

IM Modeling is easy to understand for users who are familiar with the mining functions in IM for Data.

IBM DB2 Intelligent Miner Visualization

IM Visualization provides the following JAVA visualizers to present data modeling results for analysis:

You can use the Intelligent Miner Visualizers to visualize PMML-conforming mining models. Applications can call these visualizers to present model results, or you can deploy the visualizers as applets in a Web browser for ready dissemination. The models might have been developed by using IM Modeling or other applications and tools that support interoperability through the use of PMML models, or models of the Intelligent Miner for Data might have been exported as PMML models. Models are stored as flat files, or you can directly visualize mining models from the database. The models in the database have been created by IM Modeling or they have been imported into the database using the import functions of IM Scoring.

The focus of the PMML standard is interoperability for scoring. The best results with IM Visualization can be achieved if the PMML models contain IM Visualization extensions such as distribution statistics or quality information as produced by IM Modeling. For more information on IM Visualization extensions contact your IBM representative.

IM Visualization Version 8.2 provides the following enhancements:

The Intelligent Miner Visualizers Version 8.1 are also included in Intelligent Miner for Data Version 8.1.

IBM DB2 Intelligent Miner for Data

Intelligent Miner for Data Version 8.1 is an independent product that provides the following mining functions to build and apply mining models based on database or flat file data:

IM for Data Version 8.1 is a stand-alone data mining application (workbench) for end users and primarily statisticians with advanced data mining skills. It includes the Intelligent Miner Visualizers and the PMML conversion component of IM Scoring, which allows you to export mining models in PMML format.

Introducing data mining with IM Modeling

The goal of data mining
Familiarizing yourself with model training
Introducing the data mining process
Specifying mining data
Defining logical data specifications
Defining mining settings
Defining mining tasks
Building and storing mining models
Testing a model and analyzing its quality
Testing Classification or Regression models
Analyzing the model quality
Working with mining models and test results
Introducing data mining functions
Associations
Business context
Concepts
Items and groups in tables
Rule body and rule head
Support in an association rule
Confidence in an association rule
Lift in an association rule
Name mappings
Taxonomies
Category maps
Finding the best combination of category maps to describe your taxonomy
Rule length and item constraints
Active or inactive fields
Classification
Business context
Concept
Decision tree Classification
Class label field
Maximum purity per internal node
Maximum tree depth
Minimum number of records per internal node
Tolerated levels of incorrect predictions
Cost matrix
Active or inactive fields
Clustering
Business context
Concept
Distribution-based Clustering
Similarity
Maximum number of clusters
Similarity threshold
Active or supplementary fields
Field weighting
Value weighting
Similarity scale
Similarity matrices
Outlier treatment
Desired execution time
Minimum percentage of data
Regression
Business context
Concept
Target field
Maximum tolerated systematic error (RSquared)
Desired execution time
Active or inactive fields
Introducing database objects and data mining in SQL
User-defined data types
User-defined data types describing input data
User-defined data types specific to mining functions
User-defined data types in the model-building process
User-defined data types in the model-testing process
User-defined data types in a Classification training and test run
User-defined methods
User-defined functions
Stored procedures
SQL code examples for data mining
Sample scenario
Model-building procedure
Code example
PMML: A markup language for data mining

The goal of data mining

Data mining is an innovative way of gaining new and valuable business insights by analyzing the information held in your company database. These insights can enable you to identify market niches, and they support and facilitate the making of well-informed business decisions. Essentially, data mining is a ground-breaking way to leverage the information that your company already has in order to plan a business strategy for the future.

Data mining uncovers this in-depth business intelligence by using advanced analytical and modeling techniques. With data mining, you can ask far more sophisticated questions of your data than you can with conventional querying methods. The information that data mining provides can lead to an immense improvement in the quality and dependability of business decision-making.

Conventional methods can tell a bank, for example, which of the bank account types that it provides is the most profitable. However, only data mining enables the bank to create profiles of the customers who already have this type of account. The bank can then use data mining to find other customers who match that profile, so that it can accurately target a marketing campaign to them.

Data mining can identify patterns in company data, for example, in records of supermarket purchases. If, for example, customers buy product A and product B, which product C are they most likely to buy as well? Accurate answers to questions like these are invaluable aids to marketing strategies.

Data mining can identify the characteristics of a known group of customers, for example, those who have a proven record as poor credit risks. The company can then use these characteristics to screen new customers and to predict if they also will be poor credit risks.

Data mining tools ease and automate the process of discovering this kind of information from large stores of data.

Familiarizing yourself with model training

A data mining analyst wants to obtain the rules contained in historic data. A specific mining algorithm is selected, configured, and applied to a specified set of input data. The execution of the mining algorithm is called training phase. The result of the training phase is a data mining model. The model can then be used in:

In Figure 2 the Modeling buildModel function receives a BldTask object that describes the physical (MiningData) and logical (LogicalDataSpec) schema of the input table as well as the settings that configure the mining algorithm. It produces a mining model.

Figure 2. SQL API in IM Modeling
SQL API in IM Modeling

The training phase consists of the following steps:

Introducing the data mining process

Familiarizing yourself with model training summarizes how to train a model. Here you find a more detailed overview of the individual steps that are required to build, test, and work with models.

You begin a data mining project with a well-defined business intelligence project plan. The business analysts in your company define a problem that they want to solve, and a definite business intelligence goal that they want to achieve. The better this initial formulation, the clearer your guidelines about what data and which mining functions you use to achieve the desired result.

Your data mining project consists of the following major phases:

  1. Data selection and preparation.
  2. Building the data mining model (also known as the training phase).

    You build a data mining model from a specific set of input data.

    During the model-building process, after preparing your data you specify your decisions about:

    IM Modeling uses the following database objects when building a model:

    These database objects are introduced in Introducing database objects and data mining in SQL.

  3. Testing a model and analyzing its quality.

    You can test a Classification or Regression model. Then you can analyze the quality of the model.

  4. Working with a model provides information on:

For detailed instructions on how to build, test, and work with a model refer to Using IM Modeling.

Specifying mining data

Note:
To perform this step, you use user-defined methods provided by IM Modeling.

When building a mining model you must first specify the source data that will be the subject of the training run. You specify the name of the table that holds your source data, and optionally the columns that it contains. The definition also specifies an optional alias name for each column. The alias name is usually the same as the column name.

For detailed instructions refer to:

Defining logical data specifications

Note:
To perform this step, you use user-defined methods provided by IM Modeling.

Next, you define some generic settings that are necessary for mining fields. For each column in your source data, a mining field holds logical settings that are important for your training run. These settings are largely independent of the data mining function you are using; they are held together in the logical data specification.

The most important information contained in the logical data specification is the field name and field type for each mining field. If you are not sure what fields to use for mining, IM Modeling can determine whether a field should be used or not. The field name must match an alias name in the mining data definition in order to map the field name to the appropriate field in the mining data definition. The specification can also contain name mappings and taxonomies; for information about these features, see:

The easiest way to define a logical data specification is to let IM Modeling do it for you from the input data definition that you create at the beginning. This is also the recommended way. However, you can also create or modify the logical data specification separately if you want. You might do this if, for example, a logical data specification already exists, and you want to use it for a new set of source data.

For detailed instructions refer to:

Defining mining settings

Note:
To perform this step, you use user-defined methods provided by IM Modeling.

Next, you define the mining settings that contain the specific instructions necessary for the mining function you want to use. Each mining function requires its own specific settings. For example, if you are using the:

For the Classification or Regression mining function, you must specify the name of the target field.

The logical data specification, which you have already created, also becomes part of the mining settings. You can limit the fields that are used for mining by manually indicating the fields to use.

You can use autonomic preprocessing and customization to identify which fields to use or to drop, for more information refer to Autonomic variable selection. It:

For detailed instructions refer to:

Defining mining tasks

Note:
To perform this step, you use user-defined methods provided by IM Modeling.

Next, you create the mining task. A mining task brings together all the information actually needed to start a training run and to compute the mining model. This information consists of the mining settings you created in the previous step, and the input data definition that you created at the beginning.

You can define tasks for test runs also. These tasks bring together all the information actually needed to start a test run. This information consists of the mining data used to test a mining model and a location of the mining model to be tested.

For detailed instructions refer to:

Building and storing mining models

Note:
To perform this step, you use stored procedures provided by IM Modeling.

Next, you build the mining model by using a predefined stored procedure that builds the model and stores it in a database table. You specify the mining task that you built in the previous step, as well as the database location for the model. This model contains the rules and patterns found in the data.

The model-building process is often iterative. That is why this process is referred to as the training of a mining model. Usually, several passes over the input data are necessary before a model is generated; any repeated passes that are necessary are performed by the mining algorithm. After a model is complete, you usually store it as a database object.

For detailed instructions refer to:

Testing a model and analyzing its quality

Note:
To perform this step, you use stored procedures and user-defined functions provided by IM Modeling.

You can test a model (Classification or Regression models) , and you can also analyze its quality by extracting quality information from the test result or model.

For detailed instructions refer to:

Testing Classification or Regression models

Note:
To perform this step, you use stored procedures provided by IM Modeling.

Only the predictive mining functions (Classification and Regression) have a test phase in IM Modeling. You use predefined stored procedures to test the model, compute the test result, and write it into a database table.

Testing a model means that the model is applied to data which already contains the target field values that the model can predict. The test compares the predicted and the actual target field values and uses this comparison to create a test result, which contains various model quality numbers and a lift or gains chart. The gains chart shows graphically how well the model's predictions, when sorted by descending predicted values, reproduce the order of the test data records when sorted by descending actual target field values.

Figure 3 illustrates how the model-testing phase works.

Figure 3. The model-testing phase
The model-testing phase

For detailed instructions refer to Testing Classification or Regression models.

Analyzing the model quality

Note:
To perform this step, you use user-defined functions provided by IM Modeling.

When you analyze the quality of a model you extract quality information from a test result or model. Some of the functions that are available in IM Modeling provide this information in tables that you can further process with other programs. You can:

For more information refer to Quality concepts.

Working with mining models and test results

Note:
To perform this step, you use user-defined functions provided by IM Modeling.

At the end of the model-building process you must:

The following list shows where you can deploy the model and how you can prepare the model content for the corresponding application phase. You can deploy the model in:

Introducing data mining functions

This chapter introduces you to the different data mining functions that are supported by IM Modeling. These data mining functions are grouped into different PMML model types and mining algorithms (an overview is provided in Table 3). Each model type includes different algorithms to deal with the individual data mining functions.

Associations

The following sections introduce you to the Associations mining function.

Business context

The goal of the Associations mining function is to find items that are consistently associated with each other in a meaningful way. For example, you can analyze purchase transactions to discover combinations of goods that are often purchased together. The Associations mining function answers the question: If certain items are present in a transaction, what other item or items are likely to be present in the same transaction?

The relationships discovered by the Associations mining function are expressed as association rules. In a typical commercial application, the mining function finds associations and also assigns probabilities. For example, it can find that, if customers buy paint, there is a 20% chance that they will also buy a paintbrush. It also finds multiple associations, for example, if a customer buys paint and paintbrushes, there is a 40% chance they will also buy paint thinner.

You can use IM Visualization to analyze the association rules in mining models created for example by IM Modeling. When analyzing association rules, you must read the rules and decide if they are:

Association rules discovery is used in market basket analysis, item placement planning, and promotional sales planning, among many other applications.

Concepts

You use this mining function to find association rules among items that are present in a set of groups. A typical association rule finds the following:

Thus, the mining function finds associations between items, and also calculates some statistics about the rule, as in the percentage values m and n above.

Example:
The following association rule was mined from data that records supermarket shopping transactions: In this case:

When the algorithm runs, it can potentially create too many or too few association rules to suit your purposes. For example, it is usually not possible to calculate all the possible rules for a large set of groups: there would simply be too many. The converse can also occur. The default settings or the settings you chose might have returned only a few rules. In this case, you might need to increase the number of rules.

For instructions on rule reduction, see Controlling the number of association rules.

Items and groups in tables

You specify items and groups in the model-building process when you define mining settings.

Items are the units among which associations are made. For example, a typical item is an individual article bought by a customer during a visit to a supermarket.

A group is a meaningful unit that contains items. Typically, it contains the result of a single business transaction where several items are involved. For example, a typical group is the set of articles bought by a customer during a visit to a supermarket.

The Association kernel can read the groups of items out of tables with different table layouts as described in Defining the layout of the input table.

Rule body and rule head

The principal parts of an association rule are the rule body (also referred to as antecedent) and the rule head (also referred to as consequent).

For example, where [x][y]->[z] is an association rule:

The rule body contains the item or items for which the Associations mining function has found an associated item. The rule head contains the item found.

You can set a limit to the number of items found in an association rule. To do this, specify the maximum rule length. For details, see Rule length and item constraints.

Support in an association rule

The support of an association rule is the percentage of groups that contain all of the items listed in that association rule. The percentage value is calculated from among all the groups that were considered. This percentage value shows how often the joined rule body and rule head occur among all of the groups that were considered.

Thus, the support of a rule is the percentage equivalent of a/b, where the values are:

a
The number of groups containing all the items that appear in the rule
b
The total number of all the groups that are considered

You can specify that only rules that achieve a certain minimum level of support are included in your mining model. This ensures a highly meaningful result. It is also one of the ways in which you can control the number of rules that are created.

You set the minimum support when defining mining settings. For instructions, see Defining minimum support.

Confidence in an association rule

The confidence of an association rule is a percentage value that shows how frequently the rule head occurs among all the groups containing the rule body. The confidence value indicates how reliable this rule is. The higher the value, the more often this set of items is associated together.

Thus, the confidence of a rule is the percentage equivalent of m/n, where the values are:

m
The number of groups containing the joined rule head and rule body
n
The number of groups containing the rule body

As in the case of the support factor, you can specify that only rules that achieve a certain minimum level of confidence are included in your mining model. This ensures a definitive result, and it is, again, one of the ways in which you can control the number of rules that are created.

You set minimum confidence as part of defining mining settings. For instructions, see Defining minimum confidence.

Lift in an association rule

Note:
The lift value helps you to interpret the importance of a rule. It is a measure for a rule and is displayed in the visualizer. However, you cannot define a minimum lift in the settings similar to minimum support or minimum confidence.

The lift value of an association rule is the ratio of the confidence of the rule and the expected confidence of the rule. The expected confidence of a rule is defined as the product of the support values of the rule body and the rule head divided by the support of the rule body.

Note:
The confidence is defined as the ratio of the support of the joined rule body and rule head divided by the support of the rule body.

The lift of a rule is defined as: lift = confidence / expected_confidence = confidence / ( s(body) * s(head) / s(body) ) = confidence / s(head), where:

s(body)
Is the support of the rule body
s(head)
Is the support of the rule head

The expected confidence is identical to the support of the rule head. It is assumed in the definition of the expected confidence that there is no statistic relation between the rule body and the rule head. This means that the occurrence of the rule body does not influence the probability for the occurrence of the rule head and vice versa. The lift is a measure for the deviation of the rule from the model of statistic independency of the rule body and rule head. The lift is a value between 0 and infinity:

You can see the lift value of an association rule in IM Visualization or extract it from a rule model using the DM_getRules table function. For more information refer to DM_getRules.

Name mappings

The field values in your source data might be hard to read or might not be intuitively meaningful, for example, where they contain bar codes. In these cases, you can replace cryptic values with easily readable ones by using name mappings. The field value in your source data might be simply a number (for example, '138') that represents an item (for example, 'cheese'). In this case, the name mapping would map '138' to the name 'cheese'.

When you assign a name mapping to a field, you map the field value in the physical data to a different value. The mapped name is written together with the field value into the mining model. You can then see the readable mapped name later during the visualization of the mining model.

For instructions on how to apply name mappings, see Defining name mappings and Name mapping and taxonomy.

Taxonomies

You can make the associations found among items more meaningful if you group the items in categories. You can group these categories again into other categories, and so on. What you get is a hierarchy of categories with the items on the lowest level. This is called a taxonomy.

The following example illustrates a taxonomy with three hierarchy levels:

Figure 4. A taxonomy with three hierarchy levels
          Level 0                  Level 1                    Level 2

        Orange Juice   |
                       |          Beverages          |
        Beer           |                             |
                                                     |
                                                     |          Food
                                                     |
        Tomato         |                             |
                       |                             |
        Cabbage        |          Vegetables         |
                       |
        Carrot         |							

If you apply a taxonomy during an Associations mining run, the groups are expanded for the calculation of the rules. If an item of a group is a member of a category, this category is added to the group. If the added category is a member of another category, this other category is also added to the group, and so on. During the calculation of the rules, the categories in the expanded groups are handled in the same way as the items. Therefore, the rules refer not only to the items but to the categories as well. In the preceding example, a rule

might be accompanied by the rules

This means that a taxonomy enables different items (or categories) to be considered as equivalent under a new category name. Note that an item or category might be a member of one or more categories, or of none.

Category maps

In IM Modeling, you have to define a taxonomy by one or more category maps. A category map is a table that has two columns, the child column and the parent column. Each record of the table describes one relation between an item and a category or between a category and another category. The member of a category is stored in the child column and the category itself in the parent column.

There are two types of category maps:

An Example: The hierarchy given in Figure 4 can be represented by two non-recursive category maps, as follows:

Table 4. Category map 1: Non-recursive
Child Parent
Orange Juice Beverages
Beer Beverages
Tomato Vegetables
Cabbage Vegetables
Carrot Vegetables
Table 5. Category map 2: Non-recursive
Child Parent
Beverages Food
Vegetables Food

The same hierarchy can also be represented by one recursive category map, as follows:

Table 6. Category map: Recursive
Child Parent
Orange Juice Beverages
Beer Beverages
Tomato Vegetables
Cabbage Vegetables
Carrot Vegetables
Beverages Food
Vegetables Food

For more information refer to Adding and removing category maps.

Finding the best combination of category maps to describe your taxonomy

IM Modeling distinguishes between two types of hierarchies. If a hierarchy contains only relations that start and end on two consecutive levels, the hierarchy is balanced. If a hierarchy contains relations that do not start and end on two consecutive levels, the hierarchy is unbalanced. In an unbalanced hierarchy, the relation passes across a hierarchy level.

For an example of a balanced hierarchy, see Figure 4. The following is an example of an unbalanced hierarchy:

Figure 5. An unbalanced hierarchy
          Level 0                  Level 1                    Level 2

        Orange Juice   |
                       |          Beverages          |
        Beer           |                             |
                                                     |
                                                     |          Food
                                                     |
        Fish                                         |
                                                     |
        Cheese                                       |
       							

If your hierarchy is unbalanced, you have to make sure that a relation that crosses hierarchy levels is in the same subset as all other relations that end or start at the crossed hierarchy levels.

Usually, a taxonomy is defined by a number of recursive and non-recursive categories. You have to:

Consider the following when you break up the set of relations into subsets:

Creating category maps for the balanced hierarchy in Figure 4
You can divide the taxonomy in Figure 4 into two subsets, as follows: Note that you do not have to split the relations into two subsets in this example, because all the relations comply with the restrictions.
Creating category maps for the unbalanced hierarchy in Figure 5
The taxonomy in Figure 5 cannot be broken up into subsets because the relations Fish-->Food crosses hierarchy level 1. Therefore, it must reside with the relations Orange Juice --> Beverage, Beer--> Beverages and Beverages-->Food in the same subset. The same applies to the relation Cheese-->Food. Consequently, all relations of that taxonomy must reside in the same (sub)set.

The following set of examples provides a guide to the best combination of category maps in various situations.

Example 1
Your taxonomy is balanced and all item and category names are unique:

The simplest choice is one recursive category map holding all the relations. If it suits your purposes better, you can define several non-recursive category maps, one for each relation between two consecutive hierarchy levels.

Example 2
Your taxonomy is unbalanced, and all item and category names are unique:

The simplest choice is one recursive category map holding all the relations.

Example 3
Your taxonomy is balanced and the item and category names are ambiguous among all hierarchy levels:

You must use non-recursive category maps.

Example 4
Your taxonomy is unbalanced; the item and category names are unique in the unbalanced parts of the taxonomy but ambiguous in the balanced parts of the taxonomy:

You must separate the unbalanced parts of the taxonomy from the balanced parts. Describe the unbalanced parts by recursive category maps and the balanced parts by non-recursive category maps.

You can define name mappings for your taxonomy. This is particularly helpful if your taxonomy uses identical item and category names on different levels. You must define a name mapping for each category map individually. The name mapping acts on all categories of the category map except for the items and categories at the lowest hierarchy level of the category map. You must not define a name mapping for the lowest level of a category map because the name mapping of the preceding category map acts on the lowest level. The first category map that contains all relations starting from hierarchy level 0 does not have a preceding category map. In this case, the name mapping for the lowest level is defined by the name mapping of the item field.

You define taxonomies when defining the logical data specification. For instructions, see Defining taxonomies.

Note:
A taxonomy must be acyclic; that is, a category must be neither a direct member nor an indirect member of itself.

Rule length and item constraints

You can control the number of rules found by the Associations mining function by various means. These include changing the values for minimum support, for minimum confidence, or for both. You can also use the following ways to control results:

Maximum rule length
This determines the maximum number of items that occur in an association rule. For example, if you specify 3 as the maximum rule length, you receive association rules with no more than two items in the rule body and one item in the rule head.

Example: [Swimsuit][Beach towel] -> [Sunglasses]

Item constraints
This determines which rules are to be included in or excluded from the results. If you decide to include the specified items, only rules containing at least one of the specified items are generated. If you decide to exclude the specified items, rules containing any of the specified items are discarded from the results.

Item constraints also work with categories of an applied taxonomy. If you decide to include the specified categories, only rules containing at least one of the specified categories or at least one of their direct or indirect members are generated. If you decide to exclude the specified categories, rules containing any of the specified categories or any of their direct or indirect members are discarded from the result.

Note:
You must specify the mapped item names and the mapped category names for the item constraints if you apply name mappings.

You specify the maximum rule length and item constraints as part of defining mining settings. For instructions, see Specifying maximum rule length and Setting item constraints.

Active or inactive fields

You can split your input fields between active and inactive fields.

When using the Associations mining function you need not set fields as active or inactive. This task is done by the Associations mining function together with the routine for autonomic variable selection. If this routine determines a field not to be useful for the mining process, you can overrule it by setting this field to active.

For more information refer to Defining fields as active or inactive and DM_setFldUsageType.

Classification

Business context

IM Modeling enables you to create Classification models and to validate or test these models, such as:

You can use the Classification mining function to do the following, for example:

Other suitable applications are target marketing, medical diagnosis, medical treatment effectiveness, inventory replenishment, and store location planning.

Use IM Visualization to view and analyze the Classification models, or use IM Scoring to score new data records against a model.

For example, an insurance company has data about customers who allowed their insurance to lapse and those who did not. How can the company best use this information to identify such customers in the future?

The insurance customers already belong to a certain class: they are 'classified' as having allowed their insurance to lapse. The company can use the Classification mining function to create a risk group profile in the form of a data mining model. This profile, or model, contains the common attributes of the lapsed customers, compared to the other customers. The insurance company can then apply this profile to new customers (as yet 'unclassified') to ascertain if they belong to the risk group. The procedure is as follows:

  1. The insurance company uses an IM Modeling Classification training run to identify the attributes of each defined customer risk class, and to create a model.
  2. The insurer can use IM Modeling to test the accuracy of this model by applying the model to test data with known customer risk classes.
  3. The insurer can use IM Scoring to apply the tested model to new data. This will predict which customers are likely to let their insurance lapse in the future.

Concept

Use the Classification mining function to gain a deeper understanding of your database structure or to structure unclassified databases.

Classification is the process of automatically creating a model of classes from a set of records that contain class labels. The classification technique analyzes records that are already known to belong to a certain class, and creates a profile for a member of that class from the common characteristics of the records. You can then use a data mining scoring tool to apply this Classification model to new records, that is, records that have not yet been classified. This enables you to predict if the new records belong to that particular class.

The Classification mining function is widely used in CRM. Commercial applications of this mining function include credit card scoring, ranking of customers for directed mailing, the prediction of credit risk in new customers, and attrition prediction.

IM Modeling uses the Decision tree for Classification models. An overview of the models and algorithms is provided in Table 3.

Decision tree Classification

IM Modeling supports a decision tree implementation of classification. A Tree Classification algorithm is used to compute a decision tree. Decision trees are easy to understand and modify, and the model developed can be expressed as a set of decision rules. This algorithm scales well, even where there are varying numbers of training examples and considerable numbers of attributes in large databases.

Decision Tree Classification generates the output as a binary tree-like structure, which gives fairly easy interpretation to the marketing people and easy identification of significant variables for the churn management. A Decision Tree model contains rules to predict the target variable. The Tree Classification algorithm provides an easy-to-understand description of the underlying distribution of the data.

The intuition is that, by classifying larger datasets, you will be able to improve the accuracy of the Classification model. In Classification, the given situation is a set of example records, called a training set, where each record consists of several fields or attributes. Attributes are either numerical (coming from an ordered domain), or categorical (coming from an unordered domain). One of the attributes, called the class label field (target field), indicates the class to which each example belongs. The objective of Classification is to build a model of the class label based on the other attributes. After a model is built, it can be used to determine the class label of unclassified records. Applications of Classification arise in diverse fields, such as retail target marketing, customer retention, fraud detection, and medical diagnosis.

Among these models, decision trees are particularly suited for data mining. Decision trees can be constructed relatively quickly, compared to other methods. Another advantage is that decision tree models are simple and easy to understand. A decision tree is a class discriminator that recursively partitions the training set until each partition consists entirely or dominantly of examples from one class. Each non-leaf node of the tree contains a split point that is a test on one or more attributes and determines how the data is partitioned. The tree is built by recursively partitioning the data. Partitioning continues until each partition is either 'pure' (all members belong to the same class) or sufficiently small (a parameter set by the user). The initial lists created from the training set are associated with the root of the decision tree. As the tree is grown and nodes are split to create new children, the attribute lists for each node are partitioned and associated with the children.

A decision tree classifier is built in two phases:

After the initial tree has been built (the 'growth phase'), a sub-tree is built with the least estimated error rate (the 'prune phase'). The process of pruning the initial tree consists of removing small, deep nodes of the tree resulting from 'noise' contained in the training data, thus reducing the risk of 'overfitting', and resulting in a more accurate classification of unknown data. While the decision tree is being built, the goal at each node is to determine the split attribute and the split point that best divides the training records belonging to that leaf. The value of a split point depends on how well it separates the classes. Several splitting indices have been proposed in the past to evaluate the quality of the split. IM Modeling uses the gini index.

Class label field

To predict a classification, you must specify the input fields to be classified and the class label field, which is also referred to as target field. The class label field contains the class labels of the classes to which the records in the source data were attributed during the historical classification.

Example
To identify customers who have allowed their insurance to lapse, you can specify the data fields shown in Table 7.
Table 7. Selected input fields for the Classification mining function
Input fields Class label field
Town districts Risk class
Country
Profession

For instructions on defining the class label, see Specifying the class label field.

Maximum purity per internal node

You can customize the binary decision tree by specifying the maximum purity per internal node. This value is a limit to stop further splitting of a node that has reached the specified purity value when the initial decision tree is being built. The maximum purity is specified as a percentage value.

For instructions on using this feature, see Specifying maximum purity.

Maximum tree depth

You can customize the binary decision tree by specifying the tree depth. The tree depth is an INTEGER value. Maximum tree depth is a limit to stop further splitting of nodes when the specified tree depth has been reached during the building of the initial decision tree.

For instructions on using this feature, see Specifying maximum tree depth.

Minimum number of records per internal node

You can customize the binary decision tree by specifying the minimum number of records per internal node. The minimum number of records is an INTEGER value. This sets a limit value. It prevents further splitting of a node that has reached the specified minimal size when the initial decision tree is being built.

For instructions on using this feature, see Specifying the minimum number of records per internal node.

Tolerated levels of incorrect predictions

You can specify the percentage of incorrect predictions that you will tolerate on validation data in a Classification model. You do this by setting the cost rate value for a training run in a DM_ClasSettings value. The Tree Classification algorithm does not stop if this percentage is reached. This method is provided for compatibility with the SQL/MM standard. It does not have an effect on the model being generated.

For instructions on using this feature, see Specifying the tolerated level of incorrect predictions.

Cost matrix

By default:

This section describes how to adjust the cost matrix manually.

A cost matrix is useful when specific classification errors are more severe than others (for example, with 'skewed data'). The Classification mining function tries to avoid classification errors with a high error weight. The trade-off of avoiding 'expensive' classification errors is the possibility of an increased number of 'cheap' ones. Thus, the number of errors increases while the cost of the errors decreases in comparison with the same classification without a cost matrix. Weights specified must be greater than or equal to zero; the default weight is 1. The cost matrix diagonal must be all zero.

Notes:
  1. To improve classification decision trees and to get better models with 'skewed data', the Tree heuristic works with regular data. It automatically generates an appropriate cost matrix ("error matrix") to balance the distribution of class labels when a decision tree is trained.
  2. Model refresh fields and parameters remain the same.
  3. Actual data and the result of the autonomic variable selection change.
  4. As a result, model refresh might come to a different result than expected and to a different result of the autonomic variable selection.
  5. If there are no up-to-date runstats, the routine for autonomic variable selection must first calculate the necessary information. For more information refer to Autonomic variable selection.

You assign error weights to misclassifications by specifying a cost matrix. A cost matrix is a table of the following format, where the assumption is that the class labels are 'High risk', 'Low risk', and 'Safe':

Table 8. Sample cost matrix table
Actual predicted weight
'High risk' 'Safe' 7.0
'Low risk' 'Safe' 3.0
Tip:

Your input data might contain information about customers, of whom 99% are satisfied and 1% are not satisfied. You might try to build a model that predicts whether a customer is satisfied, and you might use only a small training set of data. In this case, you might obtain a degenerated pruned tree. This tree might consist only of one node that predicts that all of the customers are satisfied. In terms of prediction power, this model is of high quality because the error rate is very low (1%). However, to understand which attribute values describe a customer who is not satisfied, a different behavior is required.

Solution:
You might want to enforce the following:
  • A misclassification of a customer who is not satisfied is considered ten times as expensive as a misclassification of a customer who is satisfied.

For instructions on how to implement this feature, see Defining a cost matrix.

Active or inactive fields

You can split your input fields between active and inactive fields.

When using the Classification mining function you need not set fields as active or inactive. This task is done by the Classification mining function together with the routine for autonomic variable selection. If this routine determines a field not to be useful for the mining process, you can overrule it by setting this field to active.

For more information refer to Autonomic variable selection, Defining fields as active or inactive, and DM_setFldUsageType.

Clustering

The following sections introduce the Clustering mining function.

Business context

The Clustering mining function consists of a range of algorithms that group data records on the basis of how similar they are. A data record may, for example, consist of information about a customer. In this case, Clustering would group similar customers together, while at the same time maximizing the differences between the different customer groups formed in this way.

The groups that are found are known as clusters. Each cluster tells a specific story about customer identity or behavior, for example, about their demographic background, or about their preferred products or product combinations. In this way, customers that are similar are grouped together in homogeneous groups that are then available for marketing or for other business processes.

Each algorithm within the Clustering mining function has its own approach to discovering clusters in data. The algorithm used in IM Modeling is Distribution-based Clustering. A possible scenario for its use is as follows:

Example:
A bank offers its customers a particular kind of account (account X). However, the take-up of the account is less than the bank hoped for. How can the bank increase the number of its customers who choose account X, without undertaking a large-scale marketing campaign?

The bank can use Distribution-based Clustering to first create a data mining model of all its customers. This model will contain one or more clusters of customers who use account X, each cluster having a specific demographic profile. The bank can then selectively target the customers of other clusters who have similar demographic profiles to those with account X but who do not have this type of account.

The Clustering mining function is used largely in CRM. The business insights provided by the use of this mining function enable firms to offer specific, personalized services and products to their customers. In the commercial environment, Clustering is used in the following areas:

Concept

The Clustering mining function searches the input data for characteristics that most frequently occur in common. The mining function segments the input data into subsets, the clusters, with the members of each cluster having similar properties, and it groups the related records accordingly. There are no preconceived notions of what patterns exist within the data; it is a discovery process.

The resulting model created by the Clustering mining function contains the number of clusters that were detected and the characteristics that make up each cluster. The results also show how these characteristics are distributed within the clusters. To determine the composition of each cluster, you can inspect the results of the Clustering process by means of visualization tools.

Distribution-based Clustering

IM Modeling supports the demographic implementation of Clustering. Distribution-based Clustering provides fast and natural clustering of very large databases. It automatically determines the number of clusters to be generated.

Distribution-based Clustering works with demographic data, which (typically) consists of large amounts of categorical (that is, non-numerical) variables. For this reason, the mining function works best with datasets consisting of this type of variable. When working with numerical variables, the algorithm treats them almost like categorical variables by categorizing their values into buckets.

Distribution-based Clustering is an iterative process over the input data. Each input record is read in succession. The similarity of each record with each of the currently existing clusters is calculated. Initially, no clusters exist. If the biggest calculated similarity is above a given threshold, the record is added to the relevant cluster. This cluster's characteristics change accordingly. If the calculated similarity is not above the threshold, or if there is no cluster, a new cluster is created, containing the record alone. You can specify the maximum number of clusters, as well as the similarity threshold.

Distribution-based Clustering uses the statistical Condorcet criteria to manage the calculation of the similarity between records and other records, between records and clusters, and between clusters and other clusters. The Condorcet criteria evaluates how homogeneous each discovered cluster is (in that the records it contains are similar) and how heterogeneous the discovered clusters are among each other. The iterative process of discovering clusters stops after one or more passes over the input data if there is no time remaining to do another pass or if the improvement of the clusters according to the Condorcet criteria would not justify a new pass.

Similarity

Similarities between records are determined by comparing their field values. The similarity between a record and a cluster is calculated by summing the similarities between that record and all the records of the cluster.

Take a situation where you want to identify similar characteristics in records of customer information. Similarity between two customers is calculated by comparing each customer attribute variable and giving a score for how closely the variables match. The scores are then summed and divided by the number of variables you compared.

If all the variables are categorical, then this is easy to understand. Take gender, for example. If you compare two customers who are both male, the gender attribute variables are identical, and they contribute to a score of 1.0. If they are different (male and female), they contribute to a score of 0.0. So take a situation where a customer is described by 10 categorical variables and you compare two customers. If any five variables are the same and the other five are different, then the two customers are 50% similar and could be grouped together, if the similarity threshold is smaller than or equal to 0.5.

For numerical variables, the concept of being the same is slightly different. If the values are identical, they contribute a score of 1.0. If the values differ, they get a score based on the degree of difference. A typical situation is where the difference is expressed in terms of the number of standard deviation of the variable for all customers. The score is then calculated so that if the two values are 0.5 standard deviation apart, the score is 0.5. Although 0.5 standard deviation is used by default, an absolute value, called similarity scale, can be defined for each field instead.

For more information refer to Similarity scale and Specifying similarity scale.

Maximum number of clusters

You can control the number of clusters to be created during a Clustering training run by specifying a value for the maximum number of clusters. Limiting the number of clusters prevents the production of many small clusters, and thus saves run time. By default, the Distribution-based Clustering algorithm will not create an unlimited number of clusters but will itself set a limit.

If the mining function cannot continue to create clusters because the cluster limit is reached, this may prevent further improvement in the accuracy of the model.

Increasing the number of clusters improves the likelihood of finding market niches.

For instructions on using this feature, see Specifying the maximum number of clusters.

Similarity threshold

The similarity threshold is a lower limit for the similarity of two records belonging to the same cluster. For example, if you set the similarity threshold to 0.25, records with field values that are 25% similar are likely to be assigned to the same cluster.

If you specify a similarity threshold of 1.0, you are insisting that, for customers to appear in the same group, their characteristics must be identical. You might have a large number of customer characteristic variables, or the variables might take a wide range of values. In this case, you would probably end up with each customer in a separate segment. At the other extreme is what happens if you set the similarity threshold to zero. In that case, you would end up with one large cluster containing all of your customers, because all of them become candidates. The right setting is somewhere in between, but where? You have to preserve a balance between the number of clusters that is acceptable and the degree of similarity.

There is another important factor that the Distribution-based Clustering algorithm has to consider. Even if a customer has an acceptable similarity to an existing group of customers, this does not automatically mean that they will go into the same cluster. There may be other customer groups where the match is better. The Distribution-based Clustering algorithm finds the optimum combination of customers that maximizes the similarity of all the customers within each cluster. At the same time, it maximizes the dissimilarity between the clusters it produces. To decide that, it tries to maximize the value of a statistic that it calculates, the Condorcet value.

A situation might occur where you try to give the Distribution-based Clustering algorithm a similarity threshold, and you do not limit the number of clusters that it can produce. In this case, it will keep trying to find the minimum number of clusters that satisfy the similarity threshold, because this also maximizes the Condorcet value. In a different situation, you might have limited the number of clusters with the result that, after all the possible clusters are created, a record does not have a similarity above the threshold with any of them. In this case, the record will be assigned to the cluster with the best similarity, even if the similarity threshold is not reached.

For instructions on using this feature, see Defining the similarity threshold.

Active or supplementary fields

You can split your input fields between active and supplementary fields.

Supplementary fields are not used to calculate the similarity between records. This means that they do not participate in the creation of the clusters. However, each cluster collects statistics on both the active and supplementary fields of the records it contains. This information can be visualized in the resulting Clustering model.

If you do not set the usage type for a field, the Clustering algorithm does it for you. The algorithm detects fields that are not useful for a Clustering training run, and automatically sets them to supplementary. Refer to Autonomic variable selection for more information about fields that are not considered useful for mining. The other fields are considered active and used for the Clustering run.

For information refer to Defining fields as active and supplementary and DM_setFldUsageType.

Field weighting

Field weighting gives more or less weight to certain input fields during a Clustering training run.

Example:
Take a situation where you are using the Clustering mining function to identify different types of shoppers. In this case, you might not want to give too much weight to the strong correlation between the number of purchases and the total purchase amount. Therefore you might want to assign a smaller weight to these fields.

Table 9 shows lowered field weights for the Number of purchases and the Total purchase amount fields.

Table 9. Applying field weighting
Active fields Field weighting Value weighting Compensate
Number of purchases 0.5 None No
Day of purchase 1.0 None No
Customer age 1.0 None No
Senior discount 1.0 None No
Total purchase amount 0.5 None No

For instructions on using this feature, see Specifying field weighting.

Value weighting

Value weighting deals with the fact that particular values in a field might be more common than other values in that field. The coincidence of rare values in a field adds more to the overall similarity than the coincidence of frequent values.

Example:
Most people do not have a Gold credit card. It is not very significant if two people do not have one; however, if they do, it is significant. Therefore, the coincidence of people not having a Gold credit card adds less to their overall similarity than the coincidence of people having one.

You can use one of the following types of value weighting:

Probability weighting
Probability weighting assigns a weight to each value according to its probability in the input data. Rare values carry a large weight, while common values carry a small weight. This weight is used for both matching and non-matching records.

Probability weighting uses a factor of one divided by the square root of p, where p is the probability of a value.

Logarithmic weighting
Logarithmic weighting assigns a weight to each value according to the logarithm of its probability in the input data. Rare values carry a large weight, while common values carry a small weight. This weight is used for both matching and non-matching records.

Logarithmic weighting assigns a value of the square root of (-log(p)) to both the agreement information content value and the disagreement information content value. The number p is the probability of a value.

Each type of value weighting looks at a problem from a different angle. Depending on the value distribution, using one type or the other might lead to very different results.

Example:
If a supermarket is located in a retirement community, a Senior discount field has a high probability of having the value Yes. You might use probabilistic value weighting to assign a weight to the values in the Senior discount field that is equal to its probability in the input data.

Value weighting has the additional effect of emphasizing fields with many values because their values are less frequent than those of fields with fewer possible values. By default, the mining function does not compensate for this additional effect.

You can select whether you want to compensate for the value weighting applied to each field. If you compensate for value weighting, the overall importance of the weighted field is equal to that of an unweighted field. This is so regardless of the number of possible values. Compensated weighting affects only the relative importance of coincidences within the set of possible values.

An example of the use of value weighting is given in Table 10.

Table 10. Applying field weighting and value weighting with compensation switched on
Active fields Field weighting Value weighting Compensate
Number of purchases 0.5 None No
Day of purchase 1.0 None No
Customer age 1.0 None No
Senior discount 1.0 Probabilistic Yes
Total purchase amount 0.5 None No

For instructions on setting value weighting, see Specifying value weighting.

Similarity scale

For a general description refer to Similarity.

The similarity between two records sums the similarities between each pair of values of these records. For a categorical field, the similarity is 0 if both values are different, and 1 if they are equal. For a numerical field, the similarity depends on the difference between the two values compared with the similarity scale of the field. If the two values are equal, the similarity is 1. If the two values are distant from the similarity scale, the similarity is 0.5. Other values of the similarity are calculated using a Gaussian curve passing through these two reference points.

You can choose to specify a similarity scale or not. You specify the similarity scale as an absolute number. The specification is considered only for active numerical fields. If you do not specify a similarity scale, the default value (half of the standard deviation) is used.

Tip:
To obtain a larger number of clusters, decrease the mean similarity between pairs of clusters by smaller similarity scales for numerical fields.

For instructions on specifying similarity scale values, see Specifying similarity scale.

Similarity matrices

For a general description refer to Similarity.

For each categorical field, you can define a similarity matrix that contains user-defined similarities between two field values. A similarity matrix is represented as a reference to a database table containing three columns. Two columns contain the field values to be compared, and the third column contains the similarity (between 0 and 1) for these field values.

You can specify the similarity for each pair of possible values. A pair of possible values can be used only once. The similarity of the inverse pair is the same.

For instructions on using this feature, see Specifying a similarity matrix.

Outlier treatment

The Clustering mining function detects outliers in numerical fields. Outliers are values that lie beyond the scope of a field's value range. You can define the field's value range by specifying the lower and upper bounds for this field. If bounds are not defined, no outliers will exist for numerical fields with a small number of values. However, a numerical field may contain too many values for them to be considered independently; for example, a total purchase amount might contain almost as many values as the number of records. In this case, the Clustering algorithm will statistically calculate a lower and upper bound and will group the values in buckets between these bounds. The outliers are the values outside these buckets.

You can determine how outliers are treated by specifying one of the following options:

Place outliers into lower and upper buckets
A single bucket is added to both ends of the value range to contain the outliers. This is the default.
Replace outlier with MIN or MAX
Any outlier less than the minimum value is replaced with the minimum value. Any outlier greater than the maximum value is replaced with the maximum value.
Treat outliers as missing values
Outliers are disregarded during a Clustering training run.

You can specify an outlier treatment for each numerical field in the logical data specification.

For instructions on using outliers, see Treating outliers.

Desired execution time

You can determine, to an approximate extent, the maximum amount of time that you are willing to wait before having a result. You do this by defining your preferred execution time. This time (in certain circumstances) is approximately respected by the Clustering mining function; if the time cannot be respected, an error message will appear. If you do not set this parameter, the execution time is unlimited, but the Distribution-based Clustering algorithm will try to keep it as short as possible.

For instructions on using this feature, see Setting the desired execution time.

Minimum percentage of data

If you set a desired execution time, you can also set the minimum percentage of data to be processed by the Clustering mining function. This parameter is active only if the desired execution time is set. The Clustering mining function is then allowed to work on this minimum sample of data in order to keep the execution time within the set limit. If the function is not able to create a usable model from the minimum percentage of data during this time, an error message is returned. If an error is returned, either increase the desired execution time or decrease the minimum percentage of data.

For instructions on using this feature, see Specifying the minimum percentage of data that is processed.

Regression

The following sections introduce you to the Regression mining function.

Business context

Assuming that you want to start a mailing campaign to maximize your business volume. You want to address 30% of your customers.

To predict the business volume when mailing 30% of your customers, you can start a Regression mining run on your customer data. Every record in the data table represents one customer. You might want to specify BUSINESS VOLUME as the target field.

You can also start a Regression mining run if you want to know how many of your customers to address if you want to reach a business volume of, for example, 50 000$.

You can use IM Visualization to view the curve of the model in a gains chart. A random curve, for example, means that the quality of the model is basically good. The higher the model curve starts at the beginning, the better is the model for predicting the business volume because you want to address only 30% of your customers.

Concept

A Regression model predicts the value of a numerical data field, which is the target field, in a given data record from the known values of other data fields of the same record. These latter data fields are called input data fields or explanatory data fields. They can be numerical or categorical. The predicted value might not be identical with any value contained in the data used to build the model. An example application is shown in Business context.

IM Modeling supports Transform Regression, a combination of step-wise linear regression and nonlinear field transformations. The algorithm has been patented by IBM Research.

Regression can be used to create Regression models and to test these models.

A regression model is constructed, or trained, based on known datasets of data records whose target field values are known. The model can then be applied to either known or unknown data. In unknown data, the values of the input fields are known, but not the value of the target field.

The application of the model to known data is often called test mode. The main purpose of a test mode mining run is to verify the quality and predictive power of the model by comparing its predictions to the known actual target field values of the test data. In particular, if working with a once created mining model for a long time, it is recommended that you regularly perform test runs to verify that the model is still useful. It might not be valid anymore because of systematic changes in the data as a function of time.

Regression automatically performs some sort of model testing while constructing the model. For that purpose, a part of the training data (or an extra dataset specified by the user) is held out and not used for the training process itself. Rather, this data is used to validate the current model by measuring its ability to correctly predict the target fields of records which have not been used for training before. This held-out data is called validation data, the validation step is called validation mode.

The difference between validation mode and test mode is that validation steps are performed during model construction and have an impact on the created model, whereas test mode runs are performed after model construction and leave the model unchanged. The application of models to data with unknown target field values is called application mode. This is the most frequently used mode to apply a model: it exploits the knowledge which is stored in the constructed model and uses it to generate concrete predictions for unknown target field values.

For a description of the application mode, see Intelligent Miner Scoring: Administration and Programming for DB2.

Target field

To predict the value of a data field using a Regression model, the following types of data fields must be declared:

The target field contains the historical values of the field to be predicted. When you start the training process of a Regression model, you must specify the target field. The input fields need not be specified explicitly. By default, the training algorithm considers all fields that are available in the training data (except the target field) as input fields.

For more information refer to Specifying the target field.

Maximum tolerated systematic error (RSquared)

Use DM_setRegRSquared to specify the maximum tolerated squared Pearson correlation coefficient r2. This coefficient can be tolerated in the regression model for the error on verification data. If the training algorithms find that it is impossible to construct a model with r2 below that threshold, a warning is issued, but a valid model is constructed. Note: r2 (with 0 <= r2 <= 1) measures the correlation between the prediction error on verification data and the actual target values. r2=0 means that the prediction error and the target field values are uncorrelated, r2=1 means that the two values are perfectly (positively or negatively) correlated.

Therefore, setting an upper threshold for r2 means setting an upper limit for the acceptable systematic error of the model.

For more information refer to Specifying the maximum tolerated systematic error (RSquared) or DM_setRegRSquared.

Desired execution time

You can determine, to an approximate extent, the maximum amount of time that you are willing to wait before having a result. You do this by defining your preferred execution time. This time (in certain circumstances) is approximately respected by the Regression mining function; if the time cannot be respected, an error message will appear. If you do not set this parameter, the execution time is unlimited, but the Regression algorithm will try to keep it as short as possible.

For instructions on using this feature, see Setting the desired execution time.

Active or inactive fields

You can split your input fields between active and inactive fields.

When using the Regression mining function you need not set fields as active or inactive. This task is done by the Regression mining function together with the routine for autonomic variable selection. If this routine determines that a field is not useful for the mining process, you can overrule it by setting this field to active.

Notes:
  1. You must set the target field explicitly, it is not set automatically.
  2. For more information refer to DM_setFldUsageType, Defining fields as active and inactive, or Autonomic variable selection.

Introducing database objects and data mining in SQL

This chapter introduces you to the database objects provided by IM Modeling. These largely reflect the current standard for data mining in the context of SQL. The code sample of how you might build a data mining model is available at SQL code examples for data mining.

The SQL/MM API is a standardized open SQL API, it:

The following list of data types familiarizes you with the SQL API terminology:

MiningData
Describes physical schema of input table
LogicalDataSpec
Describes the logical schema of input table
Settings
Describes the function parameters for the modeling phase
BldTask
Describes the job parameters for the modeling phase
TestTask
Describes the job parameters for the test phase
Model
Describes the rules and patterns found in the modeling phase
TestResult
Describes the quality information found in the test phase
Note:
The database objects are created in a predefined schema IDMMX, which is provided by IM Modeling.

User-defined data types

User-defined types (UDTs) provided by IM Modeling consist of:

Structured types
The following user-defined types are structured types in IM Modeling. They are used for creating mining models and test results:

Use user-defined methods to create or change the value of structured types, or to get information about the content of a type value.

Distinct types
The following user-defined types are distinct types in IM Modeling. They are used for representing models and test results:

You create values of distinct types and access information about them by using the user-defined stored procedures and functions supplied with IM Modeling.

The source data type of the distinct type is BLOB. A data mining training run encodes the model in PMML, but transforms it into a binary, compressed format in the code set UTF16BE. The resulting data mining model type is not provided in readable PMML format. A binary format for the models offers the following:

Note:
The types DM_RuleModel, DM_ClasModel, DM_RegressionModel, and DM_ClusteringModel are also available in IM Scoring as distinct types. This means that you can reuse the data type definition in the database if you are also using IM Scoring.

You can also distinguish UDTs as follows:

User-defined data types describing input data

The user-defined types for the mining data and the logical data specification describe the input data for training runs. This information is not specific to any mining function. Use these types to define the metadata needed for later mining functions.

Note:
These types are not provided with any methods to compute mining-related information. They provide the basic infrastructure for the types that are specific to mining functions described in User-defined data types specific to mining functions.
DM_MiningData
This user-defined type is an abstraction for the physical data contained in your source tables or views. It simply stores the metadata to access the source tables.

This metadata consists of:

DM_LogicalDataSpec
This user-defined type contains the logical data specification for a training run. This specification is the logical definition of the input fields, or mining fields, used by training runs. For each column defined in the DM_MiningData value, a logical definition might be present in the logical data specification. This specification includes:

User-defined data types specific to mining functions

Use the user-defined types that are specific to mining functions for the actual mining processes.

Note:
The mining functions are Associations, Classification, Clustering, and Regression.

For each mining function, there may be one type in each of the following categories. The test task type and the mining test result type are only available for the Classification and Regression mining functions.

Mining settings types
Provide all the control information necessary for a mining function (for example, the DM_ClasSettings type). Each settings type contains a logical data specification of type DM_LogicalDataSpec. It may also contain additional settings for fields, depending on the mining function. For example, for Classification you need the specification of the target field; in this case, no additional settings for other fields are necessary. These settings are specific to each mining function.
Mining task types
Provide all the information actually needed to start a training run and to compute a model (for example, the DM_ClasBldTask type).
Test task type
Provides all the information actually needed to start a test run and to compute a test result (for example, the DM_ClasTestTask or DM_RegTestTask type).
Mining model type
Is an abstraction for an actual mining model. It provides functions to access the properties of the model (for example, the DM_ClasModel type).
Mining test result types
Hold the result information from a test run computed for a model (DM_ClasTestResult or DM_RegTestResult).

User-defined data types in the model-building process

This section describes the process of model-building and model-testing. The information here expands on the overview given in Building and storing mining models.

Figure 6 adds to that by showing the user-defined types that define all the information needed for a training run. The mining function used in the example is Classification. The goal is to define a mining task of type DM_ClasBldTask that contains all the information actually needed to do the building of a Classification model. You can start from either the data side or the settings side.

Figure 6. User-defined types in the model-building phase
User-defined types in the model-building phase

The simplest, and the recommended, way to start the model-building process is by defining a DM_MiningData value. You can then simply derive the logical data specification from this mining data value. When you begin this way, the alias names in the mining data value are the same as the original column names. This simplifies things, and ensures that the field names in the eventual model are the same as those in the data source. It also avoids the complication of having to redefine alias names. You can then create mining settings containing the logical data specification that has been derived in this way.

However, in special cases, you might choose to begin by defining the mining settings, for example, if you want to create generic mining settings that can be mapped to different mining data values describing source tables of similar content but different column names. You do this by using a set of fields, the existing logical data specification. You then use the logical data specification to define a mining settings value. Finally, you connect the settings value (containing the logical data specification) to the representation of the physical data (the DM_MiningData value). Note that only a matching DM_MiningData value can be connected, that is, where the mining field names are the same as the alias names. Making this connection completes the definition of the Classification task object, the DM_ClasBldTask value.

You must have a task object in order to start a training run by calling a stored procedure. The output of the training run is a model, in the case of this example, a Classification model. In Figure 6, the output of the training run is named simply Model.

For an overview of the user-defined types involved in the training run illustrated here, see User-defined data types in a Classification training and test run.

User-defined data types in the model-testing process

This section describes the process of model-testing. Figure 3 shows the Classification model test phase in broad overview. Figure 7 adds to that by showing the user-defined types that define all the information needed for a test run. In this case, the example shows how the types interact in the test phase of the Classification mining function. Starting from the physical data side, the goal is to define a test task containing all the information actually needed to test a Classification model. Finally, you put two items together into the Classification test task object:

Figure 7. User-defined types in the model-testing phase
User-defined types in the model-testing phase

You can use a Classification test task object to start a test run. The output of the test run is a Classification test result. In Figure 7, the output of the test run is named simply 'Test Result'.

It is also possible to start a test run by using directly a DM_MiningData object and the location of the Classification model to test without creating a test task before. This is described in User-defined data types in a Classification training and test run. For a graphical representation of this approach, see Figure 8.

For an overview of the user-defined types involved in the Classification test run illustrated here, see User-defined data types in a Classification training and test run.

User-defined data types in a Classification training and test run

Figure 8 provides an overview of the user-defined data types involved in the Classification training and test runs illustrated in the previous sections. Compare this figure with Figure 6 and Figure 7 to see which parts relate to which data types.

Figure 8. User-defined types in a Classification training and test run
User-defined types in a Classification training and test run

The user-defined types shown in Figure 6 and Figure 7 enable you to store the definitions used for data mining and to combine them flexibly. The user-defined types shown here hold the results of either a training run or a test run. The training run creates a data mining model from a mining task. This model incorporates a logical data specification. Objects of the DM_MiningData type must match this specification in order to be usable for a subsequent test of the model.

You can do a test run in two different ways:

User-defined methods

Use user-defined methods to create, modify, or query the values of structured user-defined types. You can call the methods that are defined for each type as follows:

Method syntax
To call, or invoke, a method using the method syntax:
  1. In an appropriate context, specify the method name preceded by both a reference to a structured type instance, and the double dot operator.
  2. Follow this with the list of arguments enclosed in parentheses.
Example:
IDMMX.DM_defMiningData(IDMMX.DM_MiningData(),source_table_name)
Function syntax
To call, or invoke, a method using the function syntax: Example:

IDMMX.DM_defMiningData(IDMMX.DM_MiningData(),source_table_name)

The user-defined methods are described in Methods reference.

User-defined functions

Use user-defined functions to work with mining models, test results, and analyze the model quality. User-defined functions work with distinct user-defined types.

The invocation syntax is as described in Function syntax.

The user-defined functions are described in Functions reference.

Stored procedures

Use stored procedures to:

Call a stored procedure by using the CALL statement from a DB2 client application program or DB2 command line. For an example, see Code example.

The stored procedures are described in Stored procedures reference. The Easy Mining procedures are also implemented as stored procedures. They are described in DB2 Intelligent Miner Scoring and DB2 Intelligent Miner Modeling: Data Mining with Easy Mining procedures.

SQL code examples for data mining

This database objects provided by IM Modeling largely reflect the current standard for data mining in the context of SQL. This chapter provides an example of how you can build a data mining model in a data warehouse environment. The example given here uses the Clustering mining function.

Sample scenario

The following is the sample scenario:

  1. An insurance company maintains a customer table CT with columns CUSTOMER, SEX, SALARY, AGE, and PRODUCT.
  2. The objective is to compute a Clustering model to identify the different characteristics of the customers.
  3. It should be possible to recompute the Clustering model from time to time to see whether the model changes over time.

Model-building procedure

The first steps are to define the values of the user-defined types needed to store the information for the training run, that is, to create the DM_ClusBldTask value. Due to requirement 3, you must store the DM_ClusBldTask value, so that you can later repeat the training run. For this purpose, you use the table IDMMX.ClusTasks for mining tasks. The table contains the columns ID (of type VARCHAR) and TASK (of type DM_ClusBldTask).

You define the DM_ClusBldTask value as follows:

  1. Create a DM_MiningData value by using the method DM_defMiningData. The column information is automatically retrieved. For more information refer to DM_defMiningData.
  2. Create a DM_LogicalDataSpec value from the DM_MiningData value by using the method DM_genDataSpec.
  3. Create a DM_ClusSettings value using the constructor, and assign the DM_LogicalDataSpec value.
  4. Use the DM_setMaxNumClus method to specify the creation of five clusters at most.
  5. Create a DM_ClusBldTask value; to do this, use the DM_defClusBldTask method.
  6. Store the newly created DM_ClusBldTask value in the table MT.

Code example

You can express all of the steps outlined in Model-building procedure by using a single SQL statement, as in the following code example:

INSERT INTO IDMMX.ClusTasks (ID,TASK)
WITH MyData(MyDataCol) AS ( 
VALUES(IDMMX.DM_MiningData()..DM_defMiningData('CT'))
)
SELECT 'MyTask',
IDMMX.DM_ClusBldTask()..DM_defClusBldTask(MyDataCol, 
IDMMX.DM_ClusSettings()..DM_useClusDataSpec(MyDataCol..DM_genDataSpec())
..DM_setMaxNumClus(5))
FROM MyData ; 

This generates the DM_ClusBldTask value, and stores it in the table IDMMX.ClusTasks under the ID MyTask.

You can now start the Clustering training run. Use the stored procedure DM_buildClusModelCmd to compute the Clustering model. This stored procedure can be called from the DB2 command line. It reads the DM_ClusBldTask value from the table IDMMX.ClusTasks, and stores the computed model in the table IDMMX.ClusterModels with the name MyClusModel. This table contains the columns MODELNAME (of type VARCHAR) and MODEL (of type DM_ClusteringModel).

Use the following CALL statement:

CALL IDMMX.DM_buildClusModelCmd( 'IDMMX.CLUSTASKS', 'TASK', 'ID', 'MyTask',
'IDMMX.CLUSTERMODELS', 'MODEL', 'MODELNAME', 'MyClusModel' )

PMML: A markup language for data mining

PMML is a standard format for data mining models. Based on XML, the PMML format provides a standard that enables data mining models to be shared between the applications of different vendors. The intention is to provide a vendor-independent method for defining models. In this way, proprietary issues and incompatibilities are no longer a barrier to the exchange of models between applications.

For more information on PMML support refer to Appendix D. IM Modeling conformance to PMML.

Quick start using the sample applications

Running the sample applications
Using the Clustering mining function
Creating the sample table
Using the Clustering mining function for clustering segmentation
Defining a task and starting a Clustering training run
Extracting information from a Clustering model
Building and running a task
Specifying mining data
Defining logical data specifications and Clustering settings
Defining Clustering mining tasks
Starting training runs
Deleting entries from the sample tables
Using the Classification mining function
Creating a sample table
Creating a Classification task and building a Classification model
Extracting information from a Classification model
Testing a Classification model
Working with a Classification test result
Deleting entries from the sample tables
Using the Regression mining function
Creating a sample table
Creating a Regression task and building a Regression model
Extracting information from a Regression model
Testing a Regression model
Working with a Regression test result
Deleting entries from the sample table
Using the Associations mining function
Creating the sample tables
Creating an Associations task and building an Associations model
Extracting information from an Associations model
Deleting entries from the sample tables
Creating additional error and progress tables
Working with the sample error tables
Working with the sample progress tables

Running the sample applications

The aim of this chapter is to get you up and running quickly in using the IM Modeling samples. It provides information on the tasks that you need to complete to get started.

To install IM Modeling, insert the CD into the machine and change to the appropriate subdirectory. The CD contains subdirectories for each platform that is supported.

After you have installed IM Modeling, you need to configure your DB2 instance and the databases that you want to use with IM Modeling.

Refer to DB2 Intelligent Miner Modeling, DB2 Intelligent Miner Scoring, DB2 Intelligent Miner Visualization: Installing the Intelligent Miner products for a detailed description on how to install and configure IM Modeling.

The IM Modeling package provides a set of sample SQL applications that you can use as practice exercises in building and testing mining models. You find instructions on using these samples and the content of the corresponding data and scripts. Both, the data and the scripts of samples are contained in the samples directory in the IM Modeling package. For more information refer to DB2 Intelligent Miner Modeling, DB2 Intelligent Miner Scoring, DB2 Intelligent Miner Visualization: Installing the Intelligent Miner products.

Notes:
  1. All of the data types, methods, and functions used in the sample applications are contained in the schema IDMMX.
  2. On Windows open a DB2 command window (db2cmd) to run the commands.

The following list shows how to run the samples that are provided with IM Modeling:

  1. Enable the DB2 instance as described in DB2 Intelligent Miner Modeling, DB2 Intelligent Miner Scoring, DB2 Intelligent Miner Visualization: Installing the Intelligent Miner products.
  2. Specify the following command to create a database:
    DB2 CREATE DATABASE dbname
  3. IM Modeling provides a set of UDTs, UDFs, UDMs, and stored procedures. Before you can use them from SQL statements, you must create them as database objects in the databases that you want to use with IM Modeling. To create the database objects, call the idmenabledb command, which is located in the bin directory of your IM Modeling installation.

    Enable the database for the use of IM Modeling:

    idmenabledb dbname fenced dbcfg

    For more information refer to:

  4. Connect to the database:
    db2 connect to dbname
Note:
Before starting the exercises, you must be connected to a database that is enabled for the use of IM Modeling. To run the scripts, you must have SELECT and INSERT privileges on all the tables created when you enable the database.

Using the Clustering mining function

The sample applications for the Clustering mining function show how to work with the various functions to complete a Clustering task. The samples describe customer segmentation.

Creating the sample table

In this exercise, you create the sample table BANKCUSTOMERS and import the banking data. This table is used for the Clustering training run.

To create a table and import the sample data from file bankingScoring.data, run the sample script bankingImport.db2. Use the following command to run the sample script bankingImport.db2:

db2 -stf bankingImport.db2

In the first part of the script bankingImport.db2, the DB2 table BANKCUSTOMERS is created, its columns are specified, and data types are defined for each column.

UPDATE COMMAND OPTIONS USING C off;

CREATE TABLE "BANKCUSTOMERS" (
   "CLIENT_ID"		CHAR(9) NOT NULL PRIMARY KEY,
   "AGE"       		REAL,
   "GENDER"		CHAR(2),
   "MARITAL_STATUS"	CHAR(12),
   "PROFESSION"		CHAR(24),
   "NBR_YEARS_CLI"	REAL, 
   "SAVINGS_ACCOUNT"	CHAR(3),
   "HAS_LIFE_INSURANCE" CHAR(3),
   "INT_CREDITCARD"	CHAR(3),
   "ONLINE_ACCESS"	CHAR(3),
   "JOINED_ACCOUNTS"	CHAR(3),
   "BANKCARD"		CHAR(3),
   "AVERAGE_BALANCE"	DECIMAL(10,2),
   "NO_CRED_TRANS"	REAL,
   "NO_DEBIT_TRANS"	REAL
) NOT LOGGED INITIALLY; 

In the second part of the script the flat file bankingScoring.data is imported and inserted into the new table.

IMPORT FROM bankcustomers.data OF DEL INSERT INTO "BANKCUSTOMERS"
(  "CLIENT_ID",
   "AGE",
   "GENDER",
   "MARITAL_STATUS",
   "PROFESSION",
   "NBR_YEARS_CLI", 
   "SAVINGS_ACCOUNT",
   "HAS_LIFE_INSURANCE",
   "INT_CREDITCARD",
   "ONLINE_ACCESS",
   "JOINED_ACCOUNTS",
   "BANKCARD",
   "AVERAGE_BALANCE",
   "NO_CRED_TRANS",
   "NO_DEBIT_TRANS");

Using the Clustering mining function for clustering segmentation

Defining a task and starting a Clustering training run

In this exercise, the sample script bankingClusTrain.db2 shows how to define a task and start a training run for a Clustering model.

Use the following command to run the sample script bankingClusTrain.db2 to create a DM_ClusBldTask value and run the Clustering training:

db2 -stf bankingClusTrain.db2

The first part of the sample script shows how to define a task. It contains the INSERT statement to create a DM_ClusBldTask value to segment customers in table 'BANKCUSTOMERS'. The task is inserted into table IDMMX.CLUSTASKS with ID 'BankingSimpleTask':

INSERT INTO  IDMMX."CLUSTASKS" ( "ID", "TASK")
WITH "MYDATA" ( "MYDATACOL" ) AS 
  (VALUES(IDMMX.DM_MiningData()..DM_defMiningData('BANKCUSTOMERS')))
SELECT 'BankingSimpleTask',
  IDMMX.DM_ClusBldTask()..DM_defClusBldTask("MYDATACOL",  
    IDMMX.DM_ClusSettings()..
    DM_useClusDataSpec("MYDATACOL"..DM_genDataSpec())) 
FROM "MYDATA";

The second part contains a CALL statement to call a stored procedure for Clustering training that uses the DM_ClusBldTask value to build a Clustering model:

CALL IDMMX.DM_buildClusModelCmd('IDMMX.CLUSTASKS', 'TASK', 'ID',
                                'BankingSimpleTask',
                                'IDMMX.CLUSTERMODELS', 'MODEL', 
                                'MODELNAME',
                                'BankCustomerSegments' );
Note:
Ignore the warning. It only tells you that key field 'CLIENT_ID' has been removed from the active fields.

Extracting information from a Clustering model

In this exercise, the sample script bankingClusTrainResult.db2 extracts information from a Clustering model.

Use the following command to run the sample script bankingClusTrainResult.db2 to extract information from the Clustering model:

db2 -stf bankingClusTrainResult.db2

The first part of the sample script defines the SELECT statement to extract the following information from a Clustering model:

SELECT 
  SUBSTR(IDMMX.DM_getClusMdlName("MODEL"),1,20) AS "MODELNAME",
  IDMMX.DM_getNumClusters("MODEL") as "NUMBER_CLUSTERS",
  IDMMX.DM_getClusMdlSpec("MODEL")..DM_getNumFields() 
                                    AS "NUMBER_FIELDS",
  CAST (IDMMX.DM_getMdlQuality("MODEL") AS DEC(5,2)) 
                                        AS "MODEL_QUALITY"
FROM IDMMX."CLUSTERMODELS" WHERE "MODELNAME"='BankCustomerSegments';

The next part of the sample script shows the field importance in a Clustering model. The returned field names and types can also be used to determine the model signature for applying the model in IM Scoring.

SELECT 
  CAST ("FIELDNAME" AS CHAR(20)) AS "FIELDNAME",
  CAST ("IMPORTANCE" AS DEC(5,2)) AS "IMPORTANCE",
  CASE "MININGTYPE"
    WHEN 0 THEN 'CATEGORICAL'
    WHEN 1 THEN 'NUMERICAL'
  END AS "MINING_FIELD_TYPE"  
FROM TABLE (IDMMX.DM_getFields((
  SELECT "MODEL" FROM IDMMX."CLUSTERMODELS" 
  WHERE "MODELNAME"='BankCustomerSegments'))) AS "FIELDS"
ORDER BY "IMPORTANCE" DESC;

The following part shows the field correlations in the Clustering model:

 SELECT 
  CAST ("FIELDNAME1" AS CHAR(20)) AS "FIELDNAME1",
  CAST ("FIELDNAME2" AS CHAR(20)) AS "FIELDNAME2",
  CAST ("CORRELATION" AS DEC(5,2)) AS "CORRELATION"
FROM TABLE (IDMMX.DM_getCorrelations((
  SELECT "MODEL" FROM IDMMX."CLUSTERMODELS" 
  WHERE "MODELNAME"='BankCustomerSegments'))) AS "FIELDS"
WHERE ABS(CORRELATION)> 0.1 
ORDER BY ABS(CORRELATION) DESC;

The last part of the sample script shows the clusters in the Clustering model:

SELECT 
  "ID" AS "CLUSTERID",
  CAST ("NAME" AS CHAR(20)) AS "CLUSTERNAME",
  "SIZE",
  CAST ("HOMOGENEITY" AS DEC(5,2)) AS "HOMOGENEITY"
FROM TABLE (IDMMX.DM_getClusters((
  SELECT "MODEL" FROM IDMMX."CLUSTERMODELS" 
  WHERE "MODELNAME"='BankCustomerSegments'))) AS "CLUSTERS"
ORDER BY SIZE DESC;

Building and running a task

This sample application supports the following advanced examples for creating a task and building a model:

Advanced example 1:
The logical data specification is generated from the alias names in the mining data. These alias names are the same as the names of the columns in your input data source. As a result, these column names are used in the mining settings and are also contained in the mining model.

In this example, there is a strong correlation between the data, the settings, and the model.

Advanced example 2:
The logical data specification is generated from the alias names in the mining data. These alias names are different from the column names in your input data. As a result, the alias names used in the mining settings and contained in the mining model are different from the column names in your input data.

In this example, the settings and the model contain no indication of what data was used.

Advanced example 3:
The logical data specification is created field by field by means of the DM_addDataSpecFld method. The mining settings are combined with the mining data when the task is being defined. You create the mapping between the field names in the logical data specification and the column names in the input data source by setting alias names in the mining data. You do this when you define the task. The alias names match the field names in the logical data specification.

This example enables you to create generic settings that you can use with different mining data.

Specifying mining data

In this exercise, the sample script defines the mining data. You can rename columns and define aliases.

Use the following command to run the sample script bankingCreateMiningData.db2 to create the DM_MiningData values and to insert them into the table IDMMX.MiningData:

db2 -stf bankingCreateMiningData.db2

The first part of the sample script bankingCreateMiningData.db2 creates a DM_MiningData value and inserts it into the table IDMMX.MiningData. The column name and type information is extracted from DB2 catalog tables:

INSERT INTO IDMMX."MININGDATA" VALUES (
   'AliasEqualToColumn',
   IDMMX.DM_MiningData()..DM_defMiningData('BANKCUSTOMERS'));

The next part of the sample script defines column aliases that differ from the column names in the input data source using method DM_setFldAlias.

INSERT INTO IDMMX."MININGDATA" VALUES (
   'AliasDifferentToColumn',
   IDMMX.DM_MiningData()..DM_defMiningData('BANKCUSTOMERS')
   ..DM_setFldAlias('CLIENT_ID','CUSTNO')
   ..DM_setFldAlias('PROFESSION','JOB')
   ..DM_setFldAlias('NBR_YEARS_CLI','LOYALTY'));

The next statement creates a view to use only a sample of customers as input data. This example defines a repeatable random sample of 10 percent. The sample must be repeatable to support multiple passes during model training:

CREATE VIEW "CUSTSAMPLE"
   AS SELECT * FROM "BANKCUSTOMERS" TABLESAMPLE SYSTEM(10) 
                                    REPEATABLE(3);
   
INSERT INTO IDMMX."MININGDATA" VALUES (
   'CustomerSample',
   IDMMX.DM_MiningData()..DM_defMiningData('CUSTSAMPLE'));

The following statement uses a predicate (WHERE clause) to specify the list of input records:

INSERT INTO IDMMX."MININGDATA" VALUES (
   'MarriedCustomers',
   IDMMX.DM_MiningData()..DM_defMiningData('CUSTSAMPLE')
   ..DM_setWhereClause('MARITAL_STATUS=''married'''));

Defining logical data specifications and Clustering settings

In this exercise, you create values of type DM_ClusSettings that include a value of type DM_LogicalDataSpec, and you insert them into the table IDMMX.ClusSettings.

The sample script contains INSERT statements to build a DM_ClusSettings value that consists of the following:

The field names in the DM_LogicalDataSpec values are different in each statement. The DM_LogicalDataSpec value is also constructed in different ways.

Use the following command to run the sample script bankingCreateSettings.db2 to create DM_ClusSettings values and insert them into the table IDMMX.ClusSettings:

db2 -stf bankingCreateSettings.db2

The sample script bankingCreateSettings.db2 contains the following INSERT statement to construct the DM_LogicalDataSpec value from the DM_MiningData value contained in the IDMMX.MININGDATA table. The field names in the DM_LogicalDataSpec value are the same as the column names in the BANKCUSTOMERS table. The field 'GENDER' is removed from the generated DM_LogicalDataSpec.

INSERT INTO IDMMX."CLUSSETTINGS"
SELECT
    'BankingClusSettings',
    IDMMX.DM_ClusSettings()..
    DM_useClusDataSpec("MININGDATA"..DM_genDataSpec()..
                       DM_remDataSpecFld( 'GENDER' ) )..
    DM_setMaxNumClus(9)..
    DM_setFldUsageType( 'NO_DEBIT_TRANS', 2 )
FROM IDMMX."MININGDATA" where "ID"='AliasEqualToColumn';

The following INSERT statement constructs the DM_LogicalDataSpec value from the DM_MiningData value contained in the IDMMX.MININGDATA table. Some field names in the DM_LogicalDataSpec value are different from the column names in the BANKCUSTOMERS table.

The DM_LogicalDataSpec value contains as field names the alias names that were specified in the DM_MiningData value that was used. The use of alias names that are different from the column names amounts to a renaming of the columns, because the settings contain only the alias names. The model later contains both names, but it is possible to extract only alias names using the methods that are available.

INSERT INTO IDMMX."CLUSSETTINGS" SELECT
    'BankingClusAliasSettings',
    IDMMX.DM_ClusSettings()..
    DM_useClusDataSpec("MININGDATA".. DM_genDataSpec()..
                       DM_remDataSpecFld( 'CUSTNO' ) )..
    DM_setMaxNumClus(9)..
    DM_setFldUsageType( 'JOB', 2 )
FROM IDMMX."MININGDATA" where "ID"='AliasDifferentToColumn';

The following INSERT statement constructs the DM_LogicalDataSpec value using the method DM_addDataSpecFld. Use this approach to build generic settings which can be combined with different DM_MiningData values when task values are constructed:

INSERT INTO IDMMX."CLUSSETTINGS" VALUES (
    'BankingClusGenericSettings',
    IDMMX.DM_ClusSettings()..
    DM_useClusDataSpec( IDMMX.DM_LogicalDataSpec()..
                        DM_addDataSpecFld('AGEYEARS')..
                        DM_addDataSpecFld('MARITALSTATUS')..
                        DM_addDataSpecFld('LOYALTY')..
                        DM_addDataSpecFld('SAVINGSACCOUNT')..
                        DM_addDataSpecFld('AVERAGEBALANCE')..
                        DM_addDataSpecFld('JOB')..
                        DM_setFldType('AGEYEARS', 1 )..
                        DM_setFldType('MARITALSTATUS', 0 )..
                        DM_setFldType('LOYALTY', 1 )..
                        DM_setFldType('SAVINGSACCOUNT', 0 )..
                        DM_setFldType('AVERAGEBALANCE', 1 )..
                        DM_setFldType('JOB',0)
                        )..
    DM_setMaxNumClus(9)..
    DM_setFldUsageType( 'JOB', 2 ));

Defining Clustering mining tasks

In this exercise, you create values of type DM_ClusBldTask and insert them into the table IDMMX.CLUSTASKS.

Use the following command to run the sample script bankingCreateTask.db2 to create DM_ClusBldTask values and to insert them into the table IDMMX.CLUSTASKS:

db2 -stf bankingCreateTask.db2

The following INSERT statements construct a DM_ClusBldTask value from a DM_MiningData value and a DM_ClusSettings value.

Note:
Depending on the field names in the DM_ClusSettings value, different DM_MiningData values must be used to construct a DM_ClusBldTask value.

In the first part of the sample script bankingCreateTask.db2, the INSERT statement uses a DM_MiningData value that contains matching alias names and column names:

INSERT INTO IDMMX."CLUSTASKS" SELECT
     'BankingClusTask',
     IDMMX.DM_ClusBldTask()..
     DM_defClusBldTask( D."MININGDATA", S."SETTINGS" )
FROM IDMMX."MININGDATA" D, IDMMX."CLUSSETTINGS" S
WHERE D."ID"='AliasEqualToColumn' AND
S."ID"='BankingClusSettings';

In the next part of the sample script, the INSERT statement uses a DM_MiningData value that contains different alias names and column names:

INSERT INTO IDMMX."CLUSTASKS" SELECT
     'BankingClusAliasTask',
     IDMMX.DM_ClusBldTask()..
     DM_defClusBldTask( D."MININGDATA", S."SETTINGS" )
FROM IDMMX."MININGDATA" D, IDMMX."CLUSSETTINGS" S
WHERE D."ID"='AliasDifferentToColumn' AND
S."ID"='BankingClusAliasSettings';

In the following part of the sample script, the INSERT statement uses a DM_MiningData value that contains matching alias names and column names. The alias names are adapted to the field names contained in the DM_ClusSettings value using the method DM_setFldAlias.

This sample statement also specifies the usage of an error table and a progress table. Depending on the field names in the DM_ClusSettings value, different DM_MiningData values must be used to construct a DM_ClusBldTask value:

INSERT INTO IDMMX."CLUSTASKS" SELECT
     'BankingClusGenericTask',
     IDMMX.DM_ClusBldTask()..
     DM_defClusBldTask( D."MININGDATA"..
                     DM_setFldAlias('AGE','AGEYEARS')..
                     DM_setFldAlias('MARITAL_STATUS','MARITALSTATUS')..
                     DM_setFldAlias('NBR_YEARS_CLI','LOYALTY')..
                     DM_setFldAlias('SAVINGS_ACCOUNT','SAVINGSACCOUNT')..
                     DM_setFldAlias('AVERAGE_BALANCE','AVERAGEBALANCE')..
                     DM_setFldAlias('PROFESSION','JOB'),
                     S."SETTINGS" )..
     DM_setErrorTab('IDMMX.ERRORTABLE')..
     DM_setProgTab('IDMMX.PROGRESSTABLE')
FROM IDMMX."MININGDATA" D, IDMMX."CLUSSETTINGS" S
WHERE D."ID"='AliasEqualToColumn' AND
S."ID"='BankingClusGenericSettings';

Starting training runs

This exercise shows how to call stored procedures to run the Clustering mining training.

Use the following command to run the sample script bankingRunTask.db2 to start Clustering mining training runs:

db2 -stf bankingRunTask.db2

The sample script bankingRunTask.db2 calls the stored procedure DM_buildClusModelCmd to execute the Clustering training run and writes the model into the IDMMX.CLUSTERMODELS table. In this sample script the name of the model is 'BankingClusAliasModel'. The model that is produced contains field names that are different from the column names in the BANKCUSTOMERS table:

CALL IDMMX.DM_buildClusModelCmd('IDMMX.CLUSTASKS', 'TASK', 'ID',
                       'BankingClusAliasTask',
                       'IDMMX.CLUSTERMODELS', 'MODEL', 'MODELNAME',
                       'BankingClusAliasModel' );
                                
SELECT 
  CAST ("FIELDNAME" AS CHAR(20)) AS "FIELDNAME",
  CASE "MININGTYPE"
    WHEN 0 THEN 'CATEGORICAL'
    WHEN 1 THEN 'NUMERICAL'
  END AS "MINING_FIELD_TYPE"  
FROM TABLE (IDMMX.DM_getFields((
  SELECT "MODEL" FROM IDMMX."CLUSTERMODELS" 
  WHERE "MODELNAME"='BankingClusAliasModel'))) AS "FIELDS";

In the following part of the sample script the stored procedure call of DM_buildClusModelCmd executes a clustering training run and writes the model into the table IDMMX.CLUSTERMODELS. The name of the model is BankingClusGenericModel. The model that is produced contains field names that are different from the column names in the BANKCUSTOMERS table.

CALL IDMMX.DM_buildClusModelCmd('IDMMX.CLUSTASKS', 'TASK', 'ID',
                   'BankingClusGenericTask',
                   'IDMMX.CLUSTERMODELS', 'MODEL', 'MODELNAME',
                   'BankingClusGenericModel' );
                                
                                
SELECT 
  CAST ("FIELDNAME" AS CHAR(20)) AS "FIELDNAME",
  CASE "MININGTYPE"
    WHEN 0 THEN 'CATEGORICAL'
    WHEN 1 THEN 'NUMERICAL'
  END AS "MINING_FIELD_TYPE"  
FROM TABLE (IDMMX.DM_getFields((
  SELECT "MODEL" FROM IDMMX."CLUSTERMODELS" 
  WHERE "MODELNAME"='BankingClusGenericModel'))) AS "FIELDS";

Deleting entries from the sample tables

In this exercise, you delete entries from the sample tables that were created when running the samples. This is required if you want to run the Clustering samples again.

Use the following command to run the sample script bankingDelete.db2 to delete the entries that were inserted in the tables:

db2 -tf bankingDelete.db2

Using the Classification mining function

The following sections describe the sample application for using the Classification mining function. The sample is a life sciences example predicting a patient's heart disease based on other information about the patient. The patient information is stored in table HEART and the predicted column's name is DISEASED.

Creating a sample table

In this exercise, you create the sample table HEART, which contains the sample data.

Use the following command to run the sample script heartImport.db2 to create the sample table HEART:

db2 -stf heartImport.db2

The following part of the sample script heartImport.db2 creates the sample table HEART, which contains the sample data.

CREATE TABLE "HEART" (
    "AGE"              DOUBLE,
    "SEX"              VARCHAR(3),
    "PAIN_TYPE"        VARCHAR(3),
    "BLOOD_PRESSURE"   DOUBLE,
    "CHOLESTEROL"      DOUBLE,
    "SUGAR"            VARCHAR(3),
    "ECG"              VARCHAR(3),
    "HEART_RATE"       DOUBLE,
    "ANGINA"           VARCHAR(3),
    "OLD_PEAK"         DOUBLE,
    "SLOPE"            VARCHAR(3),
    "NUM_VESSELS"      VARCHAR(3),
    "THAL"             VARCHAR(3),
    "DISEASED"         CHAR(1)
  );

The next part of the sample script imports data from heart disease cases contained in the sample file heart.data into the HEART table.

IMPORT FROM heart.data OF DEL INSERT INTO "HEART" (
    "AGE"             ,
    "SEX"             ,
    "PAIN_TYPE"       ,
    "BLOOD_PRESSURE"  ,
    "CHOLESTEROL"     ,
    "SUGAR"           ,
    "ECG"             ,
    "HEART_RATE"      ,
    "ANGINA"          ,
    "OLD_PEAK"        ,
    "SLOPE"           ,
    "NUM_VESSELS"     ,
    "THAL"            ,
    "DISEASED"
   );

Creating a Classification task and building a Classification model

In this exercise, you create a value of type DM_ClasBldTask, and insert it into the table IDMMX.CLASTASKS.

Use the following command to run the sample script heartClasTrain.db2 to create a DM_ClasBldTask value and start a Classification training run:

db2 -stf heartClasTrain.db2

The first part of the sample script heartClasTrain.db2 contains an INSERT statement to build a DM_CLASBLDTASK to predict the column DISEASED in table HEART. The task is inserted into table IDMMX.CLASTASKS with ID HeartClasTask:

INSERT INTO  IDMMX."CLASTASKS" ( "ID", "TASK")
WITH "MYDATA" ( "MYDATACOL" ) AS 
  (VALUES(IDMMX.DM_MiningData()..DM_defMiningData('HEART')))
SELECT 'HeartClasTask',
  IDMMX.DM_ClasBldTask()..DM_defClasBldTask(
    "MYDATACOL", cast( NULL as IDMMX.DM_MiningData), 
    IDMMX.DM_ClasSettings()..
          DM_useClasDataSpec("MYDATACOL"..DM_genDataSpec())
                           ..DM_setClasTarget('DISEASED')) 
FROM "MYDATA";

The next part of the sample script calls the Classification training stored procedure DM_buildClasModelCmd, which uses the DM_CLASBLDTASK value to build a Classification model.

CALL IDMMX.DM_buildClasModelCmd('IDMMX.CLASTASKS', 'TASK', 'ID',
                       'HeartClasTask',
                       'IDMMX.CLASSIFMODELS', 'MODEL', 'MODELNAME',
                       'HeartClasModel' );

Extracting information from a Classification model

In this exercise, you can extract information from a Classification model.

Use the following command to run the sample script heartClasTrainResult.db2 to extract information from the Classification model:

db2 -stf heartClasTrainResult.db2

The first part of the sample script heartClasTrainResult.db2 contains definitions to show the field correlations in a Classification model:

SELECT 
  CAST ("FIELDNAME1" AS CHAR(20)) AS "FIELDNAME1",
  CAST ("FIELDNAME2" AS CHAR(20)) AS "FIELDNAME2",
  CAST ("CORRELATION" AS DEC(5,2)) AS "CORRELATION"
FROM TABLE (IDMMX.DM_getCorrelations((
  SELECT "MODEL" FROM IDMMX."CLASSIFMODELS" 
  WHERE "MODELNAME"='HeartClasModel'))) AS "FIELDS"
ORDER BY ABS(CORRELATION) DESC;

The next part of the sample script contains definitions to show the field importance in a Classification model:

SELECT 
  CAST ("FIELDNAME" AS CHAR(20)) AS "FIELDNAME",
  CAST ("IMPORTANCE" AS DEC(5,2)) AS "IMPORTANCE",
  CASE "MININGTYPE"
    WHEN 0 THEN 'CATEGORICAL'
    WHEN 1 THEN 'NUMERICAL'
  END AS "MINING_FIELD_TYPE"  
FROM TABLE (IDMMX.DM_getFields((
  SELECT "MODEL" FROM IDMMX."CLASSIFMODELS" 
  WHERE "MODELNAME"='HeartClasModel'))) AS "FIELDS"
ORDER BY "IMPORTANCE" DESC;

The last part of the sample script contains definitions to show the tree decision rules in a Classification model for target field DISEASED:

SELECT 
  CAST ("CLASS" AS CHAR(5)) AS "PREDICT",
  'IF' AS "IF",
  CAST ("CONDITION" AS CHAR(50)) AS "CONDITION",
  CAST ("SIZE" AS SMALLINT) AS "SIZE",
  CAST ("CONFIDENCE" AS DEC(5,2)) AS "CONF"
FROM TABLE (IDMMX.DM_getTreeRules((
  SELECT "MODEL" FROM IDMMX."CLASSIFMODELS" 
  WHERE "MODELNAME"='HeartClasModel'))) AS "RULES"
WHERE "ISLEAF" = 1  
ORDER BY "CONDITION" DESC;

Here is the sample output for the DM_getTreeRules statement. The rules are shown in the Classification model for the target field 'DISEASED'.

PREDICT IF CONDITION                                          SIZE   CONF
------- -- -------------------------------------------------- ------ -------
1       IF THAL = 3 AND NUM_VESSELS = 0                           91    0.91
2       IF THAL = 3 AND NUM_VESSELS <> 0 AND PAIN_TYPE = 4        18    0.83
1       IF THAL = 3 AND NUM_VESSELS <> 0 AND PAIN_TYPE <> 4       25    0.84
2       IF THAL <> 3 AND NUM_VESSELS = 0 AND ANGINA = 1           23    0.78
1       IF THAL <> 3 AND NUM_VESSELS = 0 AND ANGINA <> 1          26    0.73
2       IF THAL <> 3 AND NUM_VESSELS <> 0                         57    0.89

  6 record(s) selected.

Testing a Classification model

In this exercise, you create a value of type DM_ClasTestTask and start a Classification test run.

Use the following command to run the sample script heartClasTest.db2 to create a DM_ClasTestTask value and start a classification test run:

db2 -stf heartClasTest.db2

The first part of the sample script heartClasTest.db2 builds a value of DM_CLASTESTTASK and inserts it into the table IDMMX.CLASTESTTASKS with ID HeartClasTestTask.

INSERT INTO IDMMX."CLASTESTTASKS" ("ID", "TASK")
WITH  "MYDATA" ("MYDATACOL") AS 
  (VALUES(IDMMX.DM_MiningData()..DM_defMiningData('HEART')))
SELECT 'HeartClasTestTask',
  IDMMX.DM_ClasTestTask()..DM_defClasTestTask( 
    "MYDATACOL", 'IDMMX.CLASSIFMODELS', 'MODEL', 'MODELNAME',
    'HeartClasModel' )
FROM "MYDATA";

The next part of the sample script calls the Classification test stored procedure DM_testClasModelCmdT that uses the DM_CLASTESTTASK value to test a Classification model.

CALL IDMMX.DM_testClasModelCmdT('IDMMX.CLASTESTTASKS', 'TASK', 'ID',
                                'HeartClasTestTask',
                                'IDMMX.CLASTESTRESULTS', 'RESULT', 'ID',
                                'HeartClasTestResult' );

Working with a Classification test result

In this exercise, you extract information from the created Classification test result.

Use the following command to run the sample script heartClasTestResult.db2 to extract information from the created Classification test result:

db2 -stf heartClasTestResult.db2

The first part of the sample script heartClasTestResult.db2 contains a SELECT statement that reads the Classification error and model quality indicators from the result of a Classification test run:

SELECT 
  CAST (IDMMX.DM_getClasError("RESULT") AS DEC(5,2))
              AS "CLASSIFICATION_ERROR",'%' AS "%",
  CAST (IDMMX.DM_getMdlQuality("RESULT") AS DEC(5,2)) 
              AS "MODEL_QUALITY",
  CAST (IDMMX.DM_getReliability("RESULT") AS DEC(5,2)) 
              AS "RELIABILITY",
  CAST (IDMMX.DM_getRankQuality("RESULT",'2') AS DEC(5,2)) 
              AS "RANK_QUALITY",
  CAST (IDMMX.DM_getPredAccuracy("RESULT",'2') AS DEC(5,2)) 
              AS "PRED_ACCURACY"
FROM IDMMX."CLASTESTRESULTS"
WHERE "ID"='HeartClasTestResult';

The next part of the sample script contains a SELECT statement that reads the confusion matrix from the result of a Classification test run. Classifications are divided into actual and predicted values.

SELECT CAST ("ACTUAL" AS CHAR(15)) AS "ACTUAL_VALUE",
       CAST ("PREDICTED" AS CHAR(15)) AS "PREDICTED_VALUE",
       "COUNT" AS "NUM_CASES",
       "COST" AS "COST_OF_WRONG_PREDICTION"
FROM TABLE (IDMMX.DM_getConfMatrix(
  (SELECT "RESULT" FROM IDMMX."CLASTESTRESULTS" 
   WHERE ID='HeartClasTestResult'))
) AS "MATRIX"
ORDER BY "ACTUAL", "PREDICTED";

The following part of the sample script contains a SELECT statement that reads the gains chart information from the result of a Classification test run:

SELECT CAST ("ROWCOUNT" AS SMALLINT) AS "NUMROWS_IN_SUBSET",
       CAST ("SUMACTUAL" AS SMALLINT) AS "NUMROWS_DISEASED_IS_2",
       CAST ("THRESHOLD" AS DEC(5,2)) 
                         AS "SMALLEST_CONFIDENCE_IN_SUBSET"
FROM TABLE (IDMMX.DM_getGainsChart(
  (SELECT "RESULT" FROM IDMMX."CLASTESTRESULTS" 
   WHERE ID='HeartClasTestResult'),'2')
) AS "MATRIX"                                  
ORDER BY "NUMROWS_IN_SUBSET";

Deleting entries from the sample tables

In this exercise, you delete entries from the sample tables that were created when running the samples. This is required if you want to run the Classification samples again.

Use the following command to run the sample script heartDelete.db2 to delete the entries that were inserted in the tables:

db2 -tf heartDelete.db2

Using the Regression mining function

The following sections describe the sample application for using the Regression mining function. The samples describe how to predict the number of claims of insurance customers based on those customer's characteristics. The customer records are stored in table INSURANCE and the column to be predicted is NUM_CLAIMS.

Creating a sample table

In this exercise, you create the sample table INSURANCE, which contains the sample data.

Use the following command to run the sample script insurImport.db2 to create the sample table INSURANCE:

db2 -stf insurImport.db2

The following part of the sample script insurImport.db2 creates the sample table INSURANCE, which contains the sample data.

CREATE TABLE "INSURANCE" (
   "SALARY"          FLOAT,
   "RENEWAL_MONTH"   VARCHAR(3),
   "SEX"             CHAR(1),
   "MARITAL_STATUS"  CHAR(1),
   "NUM_DEPENDENTS"  INTEGER,
   "YEAR_1ST_POLICY" INTEGER,
   "NUM_CLAIMS"      INTEGER,
   "CYCLES"          INTEGER,
   "AGE"             FLOAT,
   "COMMUTE_DIST"    FLOAT,
   "RECORDID"        INTEGER NOT NULL PRIMARY KEY
  );

The next part of the sample script imports data from insurance claims contained in the sample file insurance.data into the INSURANCE table.

IMPORT FROM insurance.data OF DEL INSERT INTO "INSURANCE" 
(  "SALARY",
   "RENEWAL_MONTH",
   "SEX",
   "MARITAL_STATUS",
   "NUM_DEPENDENTS",
   "YEAR_1ST_POLICY",
   "NUM_CLAIMS",
   "CYCLES",
   "AGE",
   "COMMUTE_DIST",
   "RECORDID"
   );

Creating a Regression task and building a Regression model

In this exercise, you create a value of type DM_REGBLDTASK, and insert it into the table IDMMX.REGTASKS.

Use the following command to run the sample script insurRegTrain.db2 to create a DM_REGBLDTASK value and start a Regression training run:

db2 -stf insurRegTrain.db2

The following part of the sample script insurRegTrain.db2 contains an INSERT statement that builds a DM_REGBLDTASK to predict the numeric column NUM_CLAIMS in table INSURANCE. The task is inserted into table IDMMX.REGTASKS with ID InsuranceTask:

INSERT INTO  IDMMX."REGTASKS" ("ID", "TASK")
WITH  "MYDATA" ("MYDATACOL") AS 
  (VALUES(IDMMX.DM_MiningData()..DM_defMiningData('INSURANCE')))
SELECT 'InsuranceTask',
  IDMMX.DM_RegBldTask()..DM_defRegBldTask(
    "MYDATACOL", cast( NULL as IDMMX.DM_MiningData), 
    IDMMX.DM_RegSettings()..DM_useRegDataSpec("MYDATACOL"
                          ..DM_genDataSpec())
                          ..DM_setRegTarget('NUM_CLAIMS')) 
FROM "MYDATA";

The next part of the sample script calls the Regression training stored procedure DM_buildRegModelCmd that uses the DM_REGBLDTASK value to build a Regression model:

CALL IDMMX.DM_buildRegModelCmd('IDMMX.REGTASKS', 'TASK', 'ID',
                   'InsuranceTask',
                   'IDMMX.REGRESSIONMODELS', 'MODEL', 'MODELNAME',
                   'InsuranceModel' );

Extracting information from a Regression model

In this exercise, you can extract information from a Regression model.

Use the following command to run the sample script insurRegTrainResult.db2 to extract information from the Regression model:

db2 -stf insurRegTrainResult.db2

The first part of the sample script insurRegTrainResult.db2 contains definitions to show field correlations in a Regression model:

SELECT 
  CAST ("FIELDNAME1" AS CHAR(20)) AS "FIELDNAME1",
  CAST ("FIELDNAME2" AS CHAR(20)) AS "FIELDNAME2",
  CAST ("CORRELATION" AS DEC(5,2)) AS "CORRELATION"
FROM TABLE (IDMMX.DM_getCorrelations((
  SELECT "MODEL" FROM IDMMX."REGRESSIONMODELS" 
  WHERE "MODELNAME"='InsuranceModel'))) 
  AS "FIELDS"
ORDER BY ABS("CORRELATION") DESC;

The next part of the sample script contains definitions to show field importance in a Regression model:

SELECT 
  CAST ("FIELDNAME" AS CHAR(20)) AS "FIELDNAME",
  CAST ("IMPORTANCE" AS DEC(5,2)) AS "IMPORTANCE",
  CASE "MININGTYPE"
    WHEN 0 THEN 'CATEGORICAL'
    WHEN 1 THEN 'NUMERICAL'
  END AS "MINING_FIELD_TYPE"  
FROM TABLE (IDMMX.DM_getFields((
  SELECT "MODEL" FROM IDMMX."REGRESSIONMODELS" 
  WHERE "MODELNAME"='InsuranceModel'))) 
  AS "FIELDS"
ORDER BY "IMPORTANCE" DESC;

Testing a Regression model

In this exercise, you create a value of type DM_RegTestTask and start a Regression test run.

Use the following command to run the sample script insurRegTest.db2 to create a DM_RegTestTask value and start a Regression test run:

db2 -stf insurRegTest.db2

The first part of the sample script insurRegTest.db2 contains an INSERT statement to build a value of DM_REGTESTTASK and to insert it into the IDMMX.REGTESTTASKS table with ID 'InsuranceTestTask'.

INSERT INTO  IDMMX."REGTESTTASKS" ("ID", "TASK")
WITH  "MYDATA" ("MYDATACOL") AS 
  (VALUES(IDMMX.DM_MiningData()..DM_defMiningData('INSURANCE')))
SELECT 'InsuranceTestTask',
  IDMMX.DM_RegTestTask()..DM_defRegTestTask( 
    "MYDATACOL",'IDMMX.REGRESSIONMODELS','MODEL','MODELNAME',
    'InsuranceModel')
FROM "MYDATA";

The next part of the sample script calls the Regression test stored procedure DM_testRegModelCmdT that uses the DM_REGTESTTASK value to test a Regression model:

CALL IDMMX.DM_testRegModelCmdT('IDMMX.REGTESTTASKS', 'TASK', 'ID',
                         'InsuranceTestTask',
                         'IDMMX.REGTESTRESULTS', 'RESULT', 'ID',
                         'InsuranceTestResult' );

Working with a Regression test result

In this exercise, you extract information from the created Regression test result.

Use the following command to run the sample script insurRegTestResult.db2 to extract information from the created Regression test result:

db2 -stf insurRegTestResult.db2

The first part of the sample script defines a SELECT statement that reads the root mean squared error and model quality indicators from the result of a Regression test run:

SELECT CAST (IDMMX.DM_getRMSE("RESULT") AS DEC(5,2))
             AS "ROOT_MEAN_SQUARE_ERROR",
       CAST (IDMMX.DM_getMdlQuality("RESULT") 
             AS DEC(5,2)) AS "MODEL_QUALITY",
       CAST (IDMMX.DM_getReliability("RESULT") 
             AS DEC(5,2)) AS "RELIABILITY",
       CAST (IDMMX.DM_getRankQuality("RESULT") 
             AS DEC(5,2)) AS "RANK_QUALITY",
       CAST (IDMMX.DM_getPredAccuracy("RESULT") 
             AS DEC(5,2)) AS "PRED_ACCURACY"
FROM IDMMX."REGTESTRESULTS"
WHERE "ID"='InsuranceTestResult';

The next part of the sample script defines a SELECT statement that reads the gains chart information from the result of a Regression test run:

SELECT CAST ("ROWCOUNT" AS SMALLINT) AS "NUMROWS_IN_SUBSET",
       CAST ("SUMACTUAL" AS SMALLINT) 
                         AS "SUM_OF_ACTUAL_TARGET_VALUES",
       CAST ("THRESHOLD" AS DEC(5,2)) 
                         AS "SMALLEST_PRED_VALUE_IN_SUBSET"
FROM TABLE (IDMMX.DM_getGainsChart(
  (SELECT "RESULT" FROM IDMMX."REGTESTRESULTS" 
   WHERE "ID"='InsuranceTestResult'))
) AS "MATRIX"
ORDER BY "NUMROWS_IN_SUBSET";

Deleting entries from the sample table

In this exercise, you delete entries from the sample tables that were created when running the samples. This is required if you want to run the regression samples again.

Use the following command to run the sample script insurDelete.db2 to delete the entries that were inserted in the sample tables:

db2 -tf insurDelete.db2

Using the Associations mining function

The following sections describe the sample application for using the Associations mining function. The samples show how to analyze market baskets in retail. A market basket is the list of items that a customer bought in one transaction. The sample finds rules that explain which products are bought together. The table RETAIL contains lists of transactions and table RETAIL_NAMES maps item numbers to human readable names.

Creating the sample tables

In this exercise, you create the sample tables RETAIL and RETAIL_NAMES, which contain the sample data.

Use the following command to run the sample script retailImport.db2 to create the sample tables RETAIL and RETAIL_NAMES:

db2 -stf retailImport.db2

The following part of the sample script retailImport.db2 creates the sample table RETAIL, which contains the sample data.

CREATE TABLE "RETAIL" (
   "CUSTOMER_ID" CHAR(7), 
   "TRANSDATE"   CHAR(6),
   "ITEMID"      CHAR(3),
   "STOREID"     CHAR(3),
   "TRANSID"     CHAR(5)
); 

The next part of the sample script imports retail data contained in the sample file retail.data into the RETAIL table.

IMPORT FROM retail.data OF DEL INSERT INTO 
   "RETAIL"( "CUSTOMER_ID",
             "TRANSDATE",
             "ITEMID",
             "STOREID",
             "TRANSID");

The following part of the sample script creates the sample table RETAIL_NAMES, which contains the sample data.

CREATE TABLE "RETAIL_NAMES" (
   "ITEMID"          CHAR(3),
   "DESCRIPTION"     CHAR(18)
);

The next part of the sample script imports the data of retail names contained in the sample file retail_names.data into the RETAIL_NAMES table.

IMPORT FROM retail_names.data OF DEL INSERT INTO 
   "RETAIL_NAMES"( "ITEMID",
                   "DESCRIPTION");

Creating an Associations task and building an Associations model

This exercise shows how to find articles in market baskets:

Use the following command to run the sample script retailRuleTrain.db2 to create a DM_RuleBldTask value and start an Associations training run:

db2 -stf retailRuleTrain.db2

The first part of the sample script retailRuleTrain.db2 contains an INSERT statement that builds a value of DM_RULEBLDTASK and inserts it into the IDMMX.RULETASKS table with ID RetailRuleTask.

INSERT INTO IDMMX."RULETASKS" ("ID", "TASK")
WITH  "MYDATA" ("MYMININGDATA") AS (
        VALUES(IDMMX.DM_MiningData()
                     ..DM_defMiningData('RETAIL')
        ))
SELECT 'RetailRuleTask',
IDMMX.DM_RuleBldTask()..
DM_defRuleBldTask(
   "MYMININGDATA",
   IDMMX.DM_RuleSettings()
     ..DM_useRuleDataSpec(MyMiningData..DM_genDataSpec()
        ..DM_addNmp('DescriptionForITEMID','RETAIL_NAMES',
                    'ITEMID','DESCRIPTION')
        ..DM_setFldNmp('ITEMID','DescriptionForITEMID'))
--     ..DM_setItemFormat(1)   
     ..DM_setItemFld('ITEMID')
     ..DM_setGroup('TRANSID')
     ..DM_setMinSupport(2.7)
--     ..DM_setMaxLen(2)
--     ..DM_setMinConf(50.0)
--     ..DM_setConType(0)
--     ..DM_addConItem('Crackers')
   )  
FROM "MYDATA";

The next statement in the sample script calls the Associations training stored procedure DM_buildRuleModelCmd that uses the DM_RULEBLDTASK value to build an Associations model; the model is inserted into the IDMMX.RULEMODELS table with MODELNAME RetailRuleModel:

CALL IDMMX.DM_buildRuleModelCmd('IDMMX.RULETASKS', 'TASK', 'ID',
                                'RetailRuleTask',
                                'IDMMX.RULEMODELS', 'MODEL', 
                                'MODELNAME',
                                'RetailRuleModel' );

Extracting information from an Associations model

In this exercise, you can extract information from an Associations model.

Use the following command to run the sample script retailRuleTrainResult.db2 to extract rules from the Associations model:

db2 -stf retailRuleTrainResult.db2

The first part of the sample script retailRuleTrainResult.db2 contains definitions to show the number of rules and number of transactions in a model:

SELECT SUBSTR(IDMMX.DM_getRuleMdlName("MODEL"),1,30) AS "MODELNAME",
       IDMMX.DM_getNumRules("MODEL") AS "NUMRULES",
       IDMMX.DM_getNumTransacts("MODEL") as "NUMTRANSACTIONS"
FROM IDMMX."RULEMODELS" WHERE "MODELNAME"='RetailRuleModel';

The next part of the sample script lists the Associations rules in a model:

SELECT	SUBSTR("BODYTEXT",1,38) AS "BODY", '==>' AS "==>", 
        SUBSTR("HEADNAME",1,18) AS "HEAD",
        CAST ("SUPPORT" AS DEC(5,2)) AS "SUPPORT", 
        CAST ("CONFIDENCE" AS DEC(5,2)) AS "CONF"
FROM TABLE (IDMMX.DM_getRules((SELECT "MODEL" FROM IDMMX."RULEMODELS" 
       				where "MODELNAME"='RetailRuleModel'))) AS "T1"
ORDER BY "SUPPORT" DESC, "CONF" DESC
;                                

The following part of the sample script copies rules from the model into the tables RETAILRULES and RETAILRULEBODIES to allow for real-time cross-selling recommendations in the queries below:

CREATE TABLE "RETAILRULES" ( "ID"           INTEGER,
                       "HEADNAME"     VARCHAR(1024),
                       "HEAD"         VARCHAR(1024),
                       "BODYID"       INTEGER,
                       "LENGTH"       SMALLINT,
                       "BODYTEXT"     LONG VARCHAR,
                       "SUPPORT"      REAL,
                       "CONFIDENCE"   REAL,
                       "LIFT"         REAL ) NOT LOGGED INITIALLY;
                       
ALTER TABLE "RETAILRULES" ACTIVATE NOT LOGGED INITIALLY;                       


INSERT INTO "RETAILRULES" ( "ID","HEADNAME","HEAD","BODYID","LENGTH",
                            "BODYTEXT","SUPPORT","CONFIDENCE","LIFT")
  SELECT "ID","HEADNAME","HEAD","BODYID","LENGTH","BODYTEXT",
         "SUPPORT","CONFIDENCE","LIFT"
  FROM TABLE (IDMMX.DM_getRules((SELECT "MODEL" FROM IDMMX."RULEMODELS" 
                               where "MODELNAME"='RetailRuleModel'))) AS "T1";

CREATE TABLE "RETAILRULEBODIES" ( "BODYID"     INTEGER,
                       "ITEMNAME"   VARCHAR(1024),
                       "ITEM"       VARCHAR(1024)) NOT LOGGED INITIALLY;
                       
ALTER TABLE "RETAILRULEBODIES" ACTIVATE NOT LOGGED INITIALLY;                       

INSERT INTO "RETAILRULEBODIES" ("BODYID", "ITEMNAME", "ITEM")
  SELECT "BODYID", "ITEMNAME", "ITEM"  
  FROM TABLE (IDMMX.DM_getRuleBodies((SELECT "MODEL" FROM IDMMX."RULEMODELS" 
                                where "MODELNAME"='RetailRuleModel'))) AS "T1";

The next statement contains the definitions for the query: "Which items might promote the sale of 'Crackers'?" It finds all items in rule bodies with rule head="Crackers":

SELECT	DISTINCT SUBSTR("ITEMNAME",1,18) AS "ITEMNAME"
FROM "RETAILRULES" T1, "RETAILRULEBODIES" T2
     WHERE T1."BODYID"=T2."BODYID" and "HEADNAME"='Crackers';

The following statement contains the definitions for the query: "For which items should we increase the stock when 'Crackers' goes on sale?" It finds all head items of rules with 'Crackers' in their bodies:

SELECT DISTINCT SUBSTR("HEADNAME",1,18) AS "HEADNAME"
FROM "RETAILRULES" T1, "RETAILRULEBODIES" T2
     WHERE T1."BODYID"=T2."BODYID" and "ITEMNAME"='Crackers';

Deleting entries from the sample tables

In this exercise, you delete entries from the sample tables that were created when running the samples. This is required if you want to run the regression samples again.

Use the following command to run the sample script retailDelete.db2 to delete the entries that were inserted in the sample tables:

db2 -tf retailDelete.db2

Creating additional error and progress tables

The following sections describe the sample application for creating additional error and progress tables.

Working with the sample error tables

IM Modeling can write run-time errors and warnings to an error table. It creates the default error table IDMMX.ERRORTABLE.

To specify the error table that must be used during a mining run, use the method TASK..DM_setErrorTab, which is described in DM_setErrorTab.

To create an additional error table, change the table name, add a schema qualifier if required, or both in the sample script createErrorTable.db2. Additional columns can also be appended if required:

UPDATE COMMAND OPTIONS USING s OFF;

DROP TABLE "ERRORTABLE";

CREATE TABLE "ERRORTABLE" (
  "CALLID"    CHAR(19) FOR BIT DATA,
  "RC"        CHAR(1),
  "SQLSTATE"  CHAR(5),
  "EXCID"     INTEGER,
  "PROCNAME"  VARCHAR(100),
  "COMPNAME"  VARCHAR(100),
  "TIMESTMP"  TIMESTAMP,
  "MESSAGE"   VARCHAR(1000)
);

CREATE INDEX "ERRORTABLEINDEX" ON "ERRORTABLE" ("CALLID");
Note:
You must not change the names and types of the columns provided in this sample script.

Use the following command to run the sample script createErrorTable.db2 to create an additional error table:

db2 -tf createErrorTable.db2

Working with the sample progress tables

IM Modeling can write progress information to a progress table. It creates the default progress table IDMMX.PROGRESSTABLE.

To specify the progress table that must be used during a mining run, use the method TASK..DM_setProgTab, which is described in DM_setProgTab.

To create an additional progress table, change the table name, add a schema qualifier if required, or both in the sample script createProgressTable.db2. Additional columns can also be appended if required:

UPDATE COMMAND OPTIONS USING s OFF;

DROP TABLE "PROGRESSTABLE";

CREATE TABLE "PROGRESSTABLE"(
  "CALLID"         CHAR(19) FOR BIT DATA,
  "PROCNAME"       VARCHAR(100),
  "KERNELPHASEID"  INTEGER,
  "KERNELPHASE"    VARCHAR(500),
  "KERNELINFO"     CLOB(32K),
  "ITERATIONNO"    INTEGER,
  "PROGRESS"       REAL,
  "QUALITYID"      INTEGER,
  "QUALITYMEASURE" VARCHAR(500),
  "QUALITYVALUE"   REAL,
  "TIMESTMP"       TIMESTAMP,
  "MESSAGEID"      INTEGER,
  "MESSAGE"        VARCHAR(1000),
  "CANCELREQUEST"  INTEGER
);

CREATE INDEX "PROGTABLEINDEX" ON "PROGRESSTABLE" ("CALLID", 
                                                  "CANCELREQUEST");

Note:
You must not change the names and types of the columns provided in this sample script.

Use the following command to run the sample script createProgressTable.db2 to create an additional progress table:

db2 -stf createProgressTable.db2

Using IM Modeling

Creating database objects
Enabling databases
Disabling databases
Checking databases
Specifying mining data
Specifying the source table for your data
Defining alias names
Filtering data
Defining logical data specifications
Deriving a logical data specification from a mining data value
Deriving a logical data specification from individual fields
Defining field types and properties
Defining name mappings
Defining a name mapping in the logical data specification
Activating a name mapping
Retrieving information about a name mapping
Removing a name mapping
Defining taxonomies
Defining a taxonomy in the logical data specification
Adding and removing category maps
Activating a taxonomy
Retrieving information about a taxonomy
Removing a taxonomy
Dealing with issues specific to mining functions
Associations
Classification
Clustering
Regression
Defining mining settings
Adding a logical data specification to a settings value
Defining settings that are specific to mining functions and algorithms
Autonomic variable selection
Features of autonomic variable selection
Specifying the usage type
Which fields are not considered during the mining run?
Memory usage and impact
Specifying power options
Specifying settings parameters for the Associations mining function
Defining the layout of the input table
Defining the item names
Discretization for numeric fields
Defining the table layout in the settings
Example settings
Additional comments on table layout
Controlling the number of association rules
Defining minimum support
Defining minimum confidence
Specifying maximum rule length
Name mapping and taxonomy
Setting item constraints
Defining fields as active or inactive
Specifying settings parameters for the Classification mining function
Specifying the class label field
Specifying maximum purity
Specifying maximum tree depth
Specifying the minimum number of records per internal node
Specifying the tolerated level of incorrect predictions
Defining a cost matrix
Defining fields as active or inactive
Specifying settings parameters for the Clustering mining function
Defining fields as active and supplementary
Specifying field weighting
Specifying value weighting
Specifying similarity scale
Treating outliers
Specifying a similarity matrix
Specifying the maximum number of clusters
Defining the similarity threshold
Setting the desired execution time
Specifying the minimum percentage of data that is processed
Specifying settings parameters for the Regression mining function
Specifying the target field
Specifying the maximum tolerated systematic error (RSquared)
Setting the desired execution time
Defining fields as active and inactive
Defining mining tasks
Defining mining task values for training runs
Defining mining task values for test runs
Defining additional control parameters
Building and storing mining models
Executing a training run
Example for a Clustering training run
Testing a model and analyzing its quality
Testing Classification or Regression models
Executing a test run on the mining model
Executing a test run on the test task
Analyzing the model quality
Quality concepts
Overall quality Q
Ranking quality R
Predictive accuracy A
Generalization robustness (or reliability) G
Algorithm specifications
Using the confusion and cost matrix of a Classification model
Checking the overall quality
Checking gains chart information
Deviations between predicted values and actual target values
Comparing the order of data records
Systematic error in DM_RegressionModel
Capability to correctly predict unknown data
Identifying the deviation between predicted and actual target values
Working with mining models and test results
Working on mining models
Introducing field importance and field-field correlation
Identifying fields in the logical data specification
Extracting the name of a model
Identifying the mining task
Retrieving information specific to mining functions
Exporting mining models
Working with test results
Retrieving information from test results
Exporting test results

Creating database objects

IM Modeling provides a set of UDTs, UDFs, UDMs, and stored procedures. Before you can use them from SQL statements, you must create them as database objects in the databases that you want to use with IM Modeling. For more information refer to Introducing database objects and data mining in SQL.

You can create the database objects by calling the idmenabledb command. You can also disable or check databases by calling the idmdisabledb command or the idmcheckdb command. These commands are located in the bin directory of your IM Modeling installation.

Note:
You can use the commands idmenabledb and idmdisabledb only on the DB server where the appropriate database is located. You cannot use these commands for remote database servers, because the shared libraries for IM Modeling and IM Scoring are not installed on these servers.

If you have IM Modeling and IM Scoring installed on a client machine, you can use the command idmcheckdb to check cataloged databases on remote servers.

Enabling databases

To create the database objects that are necessary, you must enable the database for the use of IM Modeling. To enable the database, use the following IM Modeling command:

idmenabledb mydb 

Where mydbpr is the name of the database that you want to enable.

The idmenabledb command gets the database name as input parameter. It connects to the database, and creates the UDTs, UDFs, and UDMs in the database in the schema IDMMX. To execute idmenabledb, you must have SYSADM or DBADM authority.

You must call the idmenabledb command for each database that you want to use with IM Modeling.

The idmenabledb command is shared between IM Modeling and IM Scoring. This means that you have to call it only once for each database if you have both products installed. The command detects automatically which products are installed. It also detects which UDTs, UDFs, and UDMs already exist in the database and which ones must be created.

If you call idmenabledb and the only parameter that you specify is the database name, then all the UDFs and UDMs are created in fenced mode. This means that they run in a process separate to the DB2 server process. All model UDTs are created for a maximum size of 10 MB. Additional options allow you to change these default values.

If you submit the unfenced option as a second argument to idmenabledb, all UDFs and UDMs are created as unfenced, and all model UDTs are generated for a maximum size of 50 MB. If you submit the dbcfg option as an additional argument, the database configuration is changed as recommended for Intelligent Miner.

For more information refer to The idmenabledb command.

Disabling databases

The IM Modeling command idmdisabledb drops from the database all the IM Modeling UDTs, UDMs, UDFs, and stored procedures that were created. The command idmdisabledb is also in the bin directory of the IM Modeling installation. Call this command if you want to discontinue using a database with IM Modeling, or before you uninstall IM Modeling.

The idmdisabledb command gets the database name as its input parameter. It connects to the database and drops all the UDTs, UDFs, and UDMs that were created when the database and the schema IDMMX were enabled. To execute idmdisabledb, you must have SYSADM or DBADM authority.

You can only drop database objects if they do not depend on other database objects. For example, you might have created tables using IM Modeling UDTs as column types or you might have created triggers using some IM Modeling UDFs or UDMs. In this case, you must drop these database objects first before you call idmdisabledb. It might be the case that the only dependent database objects that you have are the tables created using idmenabledb. These tables are dropped if you call idmdisabledb with the tables option.

The idmdisabledb command is shared between IM Modeling and IM Scoring. This means that, if you have both products installed, you have to call the command only once for each database. If both products are installed, it is not possible to disable a database only for the use of one product. To disable the database at least one product must be installed.

For complete reference information about the idmdisabledb command, see The idmdisabledb command.

Checking databases

The IM Modeling command idmcheckdb enables you to check whether a database is enabled. The command idmcheckdb is located in the bin directory of the IM Modeling installation.

The idmcheckdb command gets the database name as input. It connects to the database and returns a message saying whether the database is already enabled for IM Modeling, IM Scoring, or both.

Example:
idmcheckdb mydb

The database "mydb" is enabled for IM Modeling Version 8.2 
and IM Scoring Version 8.2 in fenced mode.

To check a cataloged database on a remote system, use the idmcheckdb command and additionally specify the user ID and the password for the database on the remote system.

To display a list of the database objects that are available in the specified database, you can use the optional parameter Show detail.

For complete reference information about the idmcheckdb command, see The idmcheckdb command.

Specifying mining data

This chapter describes how to select and define the source data that provides the input that you use in building or testing your mining model. Your definition of input data holds the information that the training run needs. This includes the name of the source table, and information about the columns in the table.

Specifying mining data is the first step in the model-building process:

In this step you:

The data type DM_MiningData stores the metadata to access the physical data in source tables. These source tables can be either base tables or views. The metadata consists of the fully-qualified name of the source table, the column names, and the SQL data types of the source data.

In addition, DM_MiningData stores any other information necessary to make the physical data accessible for a subsequent training or test run. This other information might include alias names or, optionally, a WHERE clause to filter the data. The alias name maps a field name in the physical data to a field name in a logical data specification. An alias name and its corresponding field name in the logical data specification must be the same. The default arrangement is that the alias names are the same as the names in the physical data. Use alias names that are different from the names in the physical data only if a logical data specification with different names already exists.

Specifying the source table for your data

To define source data, you define a DM_MiningData value. Call the user-defined method DM_defMiningData. This identifies the source table; you specify the fully-qualified name of the source table as input, such as:

IDMMX.DM_MiningData()..DM_defMiningData('MYSCHEMA.MYTABLE')

The column information is automatically retrieved. If the source table exists, information about all columns of the table is also stored in the mining data object. For more information refer to DM_defMiningData.

Use the table function DM_getFields to obtain a list of all fields defined in the DM_MiningData value, such as:

select t.* from table (IDMMX.DM_getFields(IDMMX.DM_MiningData()..
           DM_defMiningData('MYSCHEMA.TABLE'))) t

Defining alias names

To define alias names:
When you have defined the source table and the columns of a DM_MiningData object, you can then define an alias name that is different from the column name. Use the method DM_setFldAlias to do this. You might have already defined a logical data specification, and you want to combine your new DM_MiningData value with it. In this case, the alias name must match a field name in that logical data specification.
To find the alias name of a column:
Use the method DM_getFldAlias to ascertain the alias name of a column in the DM_MiningData value.

Filtering data

If you want to filter the source data for your training run, you need to store a WHERE clause in your DM_MiningData value.

To filter your source data:
Use the method DM_setWhereClause.
To find information about a WHERE clause:
Use the method DM_getWhereClause to retrieve information about a WHERE clause in your DM_MiningData value.

Defining logical data specifications

This chapter describes how to specify the logical definitions for the data that will be part of your training run. Each field in your physical data (defined at the beginning) must have a logical definition that enables it to be used in the training run. This logical definition is contained in the logical data specification. The logical data specification contains only some generic settings for the fields to be used. The specification does not hold any data from your source tables, and the specification is also largely independent of the data mining function that you are using.

Defining the logical data specification is the next step in the model-building process:

In this step, you create values of the data type DM_LogicalDataSpec, perform operations on them, or both.

For more information refer to Introducing database objects and data mining in SQL.

For a full list of the methods that you can use in connection with DM_LogicalDataSpec, see Logical data specification methods.

The easiest way to define the logical data specification is to let IM Modeling do it for you from the input data definition that you created at the beginning. However, you can also create or modify the logical data specification manually if you want. You might do this in order to create generic data mining settings. Generic field definitions and settings are independent of physical data. This means that you can use them without change for different source tables with different layouts but with similar content. An example of this is where different sources might be suitable for doing customer segmentation using the Clustering mining function.

The DM_LogicalDataSpec data type defines the input fields used by training runs. An input field is defined by a name and a type. The type defines how a mining algorithm handles that field. Possible types are DM_Categorical or DM_Numerical, which map by default to certain DB2 source data types (for details, see Mining field types). Optionally, you can specify further field-related information in a logical data specification as follows:

For more information refer to:

Deriving a logical data specification from a mining data value

The recommended way to define a logical data specification is to derive it from a mining data value.

Define an initial logical data specification by calling the method DM_genDataSpec acting on a DM_MiningData value. This provides you with a completely defined logical data specification. The specification contains the required definitions, such as field name and field type. The field type is automatically derived from the corresponding column type in the DM_MiningData value.

Example:
The following example includes the construction of a DM_MiningData value:
 IDMMX.DM_MiningData()..DM_defMiningData('MYSCHEMA.MYTABLE')
..DM_genDataSpec()

Deriving a logical data specification from individual fields

You can also construct an initial DM_LogicalDataSpec value by using the methods DM_addDataSpecFld and DM_setFldType. Construct the value this way if you want a generic logical data specification that is independent from a physical source table or if you want to define certain field types manually as numerical or categorical. If you do this, you have to ensure that the alias names in the DM_MiningData value that will be associated with this logical data specification match the field names in the DM_LogicalDataSpec value. If you do not call the method DM_setFldType for a given field, the type of this field defaults to DM_Categorical.

Example:
The following example creates a DM_LogicalDataSpec value with two numerical fields, COL1 and COL2:
 IDMMX.DM_LogicalDataSpec()..DM_addDataSpecFld('COL1')
..DM_setFldType('COL1',1)..DM_addDataSpecFld('COL2')
..DM_setFldType('COL2',1) 

Defining field types and properties

You can set optional field-related information for each field individually in the logical data specification. A field is identified by its name. If you want, you can iterate over all of the fields to specify field-related information. To do this, use the position of the fields.

Use the method DM_getNumFields to get the number of fields. Use the DM_getFldName method to get the name of the field name at a given position. Field positions range from 1 to the number of fields in the logical data specification. For details on specifying optional field-related information, see Dealing with issues specific to mining functions.

Defining name mappings

This section provides instructions on how to perform the tasks associated with name mappings. A name mapping maps a field value in the physical data to another name. For an introductory description, see Name mappings.

Defining a name mapping in the logical data specification

Use the method DM_addNmp to define a name mapping. The parameters are the name of the name mapping, the name of a table, and the names of two columns. One column contains the field values, and the other contains the corresponding mapped names. The SQL data type of the column containing the field values must be the same as that of the corresponding column in your mining data table. The SQL data type of the column containing the mapped names must be categorical.

You can define more than one name mapping.

Example:
IDMMX.DM_LogicalDataSpec()..DM_addNmp('MyNmp',
'MYSCHEMA.MYNMPTABLE', 'VALUECOL', MAPPEDVALUECOL') 

Activating a name mapping

After you have defined a name mapping, it will not be active until you link it to a mining field in the logical data specification. Use the method DM_setFldNmp to make a name mapping active. Only categorical fields can be linked to name mappings. If you want to define a name mapping for a field having numerical values, you must explicitly force the type of this field to categorical.

Note:
If you remove a name mapping by calling DM_remNmp, you also remove the linkage between the mining field and the name mapping.

The method DM_getFldNmp enables you to check what name mapping is linked to a mining field.

Example:
IDMMX.DM_LogicalDataSpec()..DM_addDataSpecFld('COL1')
..DM_addNmp('MyNmp', 'MYSCHEMA.MYNMPTABLE', 'VALUECOL',
'MAPPEDVALUECOL')..DM_setFldNmp('COL1', 'MyNmp') 

Retrieving information about a name mapping

Use the method DM_getNumNmp to retrieve the number of name mappings that are defined in a DM_LogicalDataSpec value.

Use the method DM_getNmpName to retrieve the name of a name mapping. This method requires a number that ranges from 1 to the total number of name mappings.

To obtain the table name, the column name of the field values, and the column name of the mapped names, use the methods DM_getNmpTabName, DM_getNmpValCol, and DM_getNmpMapValCol respectively. These methods take the name of the name mapping as parameter.

Removing a name mapping

Use the method DM_remNmp to remove a name mapping, which takes the name of the name mapping as its parameter.

Note:
If you remove a name mapping by calling DM_remNmp, you also remove the linkage between the mining field and the name mapping.

Defining taxonomies

A taxonomy is a set of relationships between items and categories. For a full introduction to taxonomies, see Taxonomies.

Defining a taxonomy in the logical data specification

An introduction is provided in Taxonomies.

Use the method DM_addTax. This method takes the following parameters:

The first category map must contain the relations between the items and the categories on hierarchy level 1. Note that the name mapping specified with the category map only acts on the categories. You must specify the name mapping for the items with the item field; for details, see Defining name mappings.

You can define more than one taxonomy in a logical data specification.

Examples:
  1. Without a name mapping:
    IDMMX.DM_LogicalDataSpec()..DM_addTax('MyTax', 'MYSCHEMA.MYTAXTABLE',
    'ITEMCOL', 'CATMAPCOL_1', cast(NULL as VARCHAR), 0)
  2. With name mappings for the child items (ItemNmp) and name mapping for the parent items (CatMapNmp).
    IDMMX.DM_LogicalDataSpec()..DM_addDataSpecFld('COL1')..DM_addNmp
    ('ItemNmp','MYSCHEMA.MYNMPTABLE', 'ITEMCOL','MAPPEDITEMCOL')
    ..DM_addNmp('CatMapNmp','MYSCHEMA.MYNMPTABLE','VALUECOL', 
    'MAPPEDVALUECOL')..DM_setFldNmp('COL1', 'ItemNmp')..DM_addTax
    ('MyTax', 'MYSCHEMA.MYTAXTABLE', 'ITEMCOL', 'CATMAPCOL_1', 
    'CatMapNmp', 0)

Adding and removing category maps

An introduction is provided in Category maps.

To add a category map use the method DM_addTaxMap, which takes the same parameters as the method DM_addTax. The order of the added category maps determines the order in which the category maps are put together in building up the hierarchy. The first category map contains the relations starting from the lowest hierarchy level, that is, the level defined by the items.

Use the method DM_remTaxMap to remove a category map.

Activating a taxonomy

An introduction is provided in Taxonomies.

You must link the taxonomy to the mining field that will be used as the item field. To do this, use the method DM_setFldTax. The method DM_getFldTax enables you to check what taxonomy is active for a mining field. Only categorical fields can be linked to a taxonomy. If you remove a taxonomy by using the method DM_remTax, you also remove the link from the taxonomy to the mining field.

Examples:

Assume that you have the following tables:

The contents of the tables are as follows:

Table 11. Contents of the table MYSCHEMA.MYTAXTABLE
ITEMCOL CATMAPCOL_1
138 160
139 160
140 161
141 161
Table 12. Contents of the table MYSCHEMA.MYNMPTABLE
ITEMCOL MAPPEDITEMCOL VALUECOL MAPPEDVALUECOL
138 Beer 160 Alcoholic drink
139 Wine 161 Non-alcoholic drink
140 Mineral water
141 Coke
SQL sample 1
This sample shows how a taxonomy is defined and assigned to the field COL1. In the physical data table, the column that is mapped to COL1 later when a task is defined must contain the values 138, 139, 140, and 141 in order to make the taxonomy effective.
IDMMX.DM_LogicalDataSpec()..DM_addDataSpecFld('COL1')
..DM_addTax('MyTax', 'MYSCHEMA.MYTAXTABLE', 'ITEMCOL',
'CATMAPCOL_1', cast(NULL as VARCHAR), 0)
..DM_setFldTax('COL1','MyTax')
SQL sample 2
This sample shows how a taxonomy is defined and assigned to COL1. In addition, a name mapping ItemNmp is defined for COL1 as well as for the category field CATMAPCOL_1 in the taxonomy table CatMapNmp.
IDMMX.DM_LogicalDataSpec()..DM_addDataSpecFld('COL1')
..DM_addNmp('ItemNmp', 'MYSCHEMA.MYNMPTABLE', 'ITEMCOL',
'MAPPEDITEMCOL')..DM_addNmp('CatMapNmp',
'MYSCHEMA.MYNMPTABLE', 'VALUECOL','MAPPEDVALUECOL')
..DM_setFldNmp('COL1', 'ItemNmp')..DM_addTax('MyTax',
'MYSCHEMA.MYTAXTABLE', 'ITEMCOL', 'CATMAPCOL_1', 
'CatMapNmp', 0)..DM_setFldTax('COL1','MyTax')

Retrieving information about a taxonomy

An introduction is provided in Taxonomies.

Use the method DM_getNumTax to retrieve the number of taxonomies that have been defined.

Use the method DM_getTaxName to retrieve the name of a taxonomy. This method requires a number that ranges from 1 to the total number of taxonomies that have been defined. After you know the name of a taxonomy, you can retrieve information about the different category maps in the taxonomy.

To retrieve information about category maps:

Each method gets the taxonomy name and the position of the category map as input, and returns the appropriate output value. The position of a category map ranges from 1 to the total number of category maps that are defined in the taxonomy.

Removing a taxonomy

To remove a taxonomy use the method DM_remTax, which takes the name of the taxonomy as its parameter.

If you remove a taxonomy by using the method DM_remTax, you also remove the link from the mining field to the taxonomy.

Dealing with issues specific to mining functions

There are a number of issues related to the logical data specification that are specific to the different data mining functions.

Associations

The Associations algorithm enables you to specify optional field-related information in a logical data specification, as follows:

The name mapping and the taxonomy of a field defined as a group field are not considered during the training run.

Classification

By default, the fields defined in the logical data specification are considered to be independent fields. An exception is the field defined by means of DM_setClasTarget, a method of the DM_ClasSettings type. The field defined in this way is considered to be the dependent field; this field must be of the categorical mining type.

The Tree Classification algorithm enables you to specify optional field-related information in a logical data specification, as follows:

Specify a name mapping for a categorical field by using DM_setFldNmp.

The Tree Classification algorithm does not support certain optional field-related information that can be specified in a logical data specification. It is possible to specify this information in a logical data specification contained in a Classification settings object. However, this has no impact on the Classification model being generated. The unsupported specifications are as follows:

Clustering

The Distribution-based Clustering algorithm enables you to specify optional field-related information in a logical data specification, as follows:

The Distribution-based Clustering algorithm does not support the following:

Specifying a taxonomy for a categorical field by using DM_setFldTax

Regression

The Transform Regression algorithm enables you to specify optional field-related information in a logical data specification. Specify a name mapping for a categorical field by using DM_setFldNmp and DM_addNmp.

The Transform Regression algorithm does not support the following:

Defining mining settings

This chapter describes how to define the mining settings that your training run will need. These settings contain the specific instructions necessary for the mining function that you want to use. The logical data specification, which you have created already, becomes part of the mining settings.

Defining mining settings in the model-building process:

In this step, you create the following data types, perform operations on them, or both:

For a full discussion of the data types used with IM Modeling, see Introducing database objects and data mining in SQL.

For a full list of the methods that you can use in connection with settings data types, see Mining settings methods.

The DM_RuleSettings, DM_ClasSettings, DM_ClusSettings, and DM_RegSettings data types store the settings for an Associations, Classification, Clustering, and Regression training run. These settings are sets of control parameters. There are two types of settings, as follows:

The definitions and roles of the fields also belong to the settings specification. This means that the logical data specification is part of the settings definition.

Adding a logical data specification to a settings value

To add the logical data specification to a settings value:

Example:
IDMMX.DM_ClusSettings()..DM_useClusDataSpec(IDMMX.DM_LogicalDataSpec()
..DM_addDataSpecFld( COL1  ) ..DM_setFldType( COL1  ,1)
..DM_addDataSpecFld( COL2  )..DM_setFldType( COL2  ,1))

Defining settings that are specific to mining functions and algorithms

Settings that are specific to mining functions include parameters that are shared by various mining algorithms of that mining function. Settings that are specific to mining algorithms include parameters that are only respected by a specific implementation of a mining function, for example, by Distribution-based Clustering.

To define settings that are specific to mining functions:
In IM Modeling, you can specify settings that are specific to mining functions by using various methods; you can use different methods for different parameters. For example, if you are using the Clustering mining function, you can set the maximum number of clusters that you want the training run to produce. To do this, use the method DM_setMaxNumClus.
To define algorithm-specific settings:
You can set algorithm-specific settings by using a generic method. This method gets as its first parameter a keyword that identifies the parameter to be set. These generic methods are: Appropriate get methods are also available.
To specify field definitions:
In a settings object, you can also specify field definitions that are specific to mining functions and mining algorithms, such as the role of a field in a training run. For example, in a Clustering settings definition, you can specify whether a field is treated as active or supplementary. In a Classification or Regression settings definition, you must specify which field is the target field; for Associations, you may specify a group field and an item field. Field definitions that are specific to mining algorithms can be set for the Distribution-based Clustering algorithm only by means of the DM_setDClusFldPar method. This method gets a field name and a keyword identifying the parameter to be set as its first parameters, followed by the parameter value. Since these field definitions are specific to a mining function or to a mining algorithm, they are part of the settings definition. They are therefore not part of the logical data specification.

Fields for which you create definitions as part of the settings specification must have a matching field name in the logical data specification. Note that you must include a logical data specification as the first step in creating settings. Some field definitions in the settings specification are required, for example, the target field for a Classification setting. Other field definitions are optional, for example, the definition of a field as active or supplementary in a Clustering settings specification. For the optional field definitions, default values are assumed.

To add or remove fields in the settings:
You cannot directly remove fields from settings or add them to settings. The set of fields is always defined in the logical data specification. If you want to add a field, you must first extract the logical data specification from the settings value. To do this, use, for example, the method DM_getClusDataSpec for Clustering settings. You can then add the new field to the logical data specification by using the method DM_addDataSpecFld. The final step is to add the logical data specification to the settings again by using the appropriate method, for example, DM_useClusDataSpec for the Clustering settings.

Autonomic variable selection

IM Modeling provides a device for autonomic variable selection for the following algorithms:

For example, obvious key fields, degenerated fields (only a single value) or unusable fields (all records have missing values for it) should be dropped. If several fields are strongly correlated, only one of the correlated fields should be used.

The autonomic variable selection can be controlled by the usage type specified for a field. It is automatically enabled if one or more of the fields in the input table do not have a usage type. All fields with no usage type are checked towards their value for the mining process.

In Associations, Tree Classification, and Transform Regression, all fields with no usage type, which are not of any value for the mining process, are removed before the model is built. In Distribution-based Clustering, fields with no value for the mining process are not completely removed from the model. They are marked as supplementary. This means, their values are not needed to find out the clusters, but the clustering model contains statistics about their value distributions in the whole training data and in each cluster.

Features of autonomic variable selection

The following list shows the features of autonomic variable selection:

  1. All fields:
  2. Categorical fields:
  3. Numeric fields:
  4. Missing value related:
  5. univariat stats (for both, numeric and categorical values)
  6. correlation matrices for numeric and categorical fields:

Specifying the usage type

If you want to force certain fields to be contained in the model, you must call DM_setFldUsageType() on this field and specify the type accordingly:

To ease this process for large tables, DM_setFldUsageType can set all fields to a certain usage type at once.

Notes:
  1. The target field for Classification and Regression, and the group and item field for Associations are automatically exempt from this selection, because they were explicitly chosen by the user for a special purpose. You need not call the method DM_setFldUsageType on them.
  2. For more information refer to DM_setFldUsageType.

Which fields are not considered during the mining run?

A field is not considered during the mining run if it does not have a usage type and if it matches at least one of the following criteria:

Note:
For some of these criteria, DB2 runstats are used if available. If not available, criteria are still applied, but performance may be decreased.

The criteria are based on the following:

If you have performed a mining run with input fields that do not have a usage type, you can see in the final model which of these fields are actually used and which are sorted out. For a more in-depth analysis, it is recommended that you read the respective messages for the mining run, which provide more details on which fields were omitted and why.

Memory usage and impact

Note:
Calculating the correlations between categorical fields takes a lot of memory. To avoid abortion of the mining run, a memory limit exists and is honored by the autonomic variable selection.

To change this memory limit, use the power option '-buf' described in:

If this limit is exceeded, calculation of as many correlations as necessary to meet this limit are discarded. This may result in slightly worse results, however, the mining process is run successfully.

You are notified if the memory limit is too low. Repeating the mining run with a higher limit ensures the optimum result. Another factor is the number of different values that are tracked for each field. By default, 100 different values are distinguished and taken into account for correlation calculation. This usually ensures good results. However, you can change this value using the power option -IDM_MAX_DISCR_COUNT.

Notes:
  1. If you raise the value, the results might improve slightly, but this can have a dramatic impact on the memory consumption and performance, which leads to discarding of correlations.
  2. If you lower the value, the results of correlation calculation can become unreliable.

Specifying power options

You can use DM_setPowerOptions to set the following power options and apply them to DM_RuleSettings, DM_ClasSettings, or DM_ClusSettings.

Notes:
  1. For more information refer to DM_setPowerOptions.
  2. The power options do not have an effect on DM_RegSettings.
-buf MB
Set the maximum memory that the kernel uses for its calculations. By default 256 MB is used. If you specify a larger value, the performance may improve and the models may be more precise.

For example, to increase the memory limit to 1024 MB, specify:

 DM_setPowerOptions('-buf 1024')
-IDM_MAX_DISCR_COUNT n
Reduces the memory consumption and the execution time. Each categorical and numerical field can have statistics consisting of no more than n different values. The default value for n is 100: For example, to specify that 150 different values of a categorical field be considered, use the following function call:
DM_setPowerOptions('-IDM_MAX_DISCR_COUNT 150') 
Note:
It is recommended that you do not specify larger values than the default value. If you specify for these fields larger values than the default value, the memory consumption is increased and the performance of the algorithm is decreased considerably, while the resulting model is not improved.

Specifying settings parameters for the Associations mining function

The following provides information on settings definitions that are specific to the Associations mining function.

Defining the layout of the input table

The table layout that you want to use for your mining run is defined in the structured type DM_RuleSettings. Use the following methods for the value of type DM_RuleSettings to define the table layout of your choice:

If your table layout requires a group ID, refer to DM_setGroup to define it.

A general introduction is provided in Items and groups in tables.

The Association kernel can read the groups of items out of tables with different table layouts. The following examples show the table layouts that are supported and how those table layouts are defined in your settings.

In general a group table consists of one or more item fields and optionally of a group ID field.

This section describes a scenario in a bank. The items are the different products that the bank offers to its customers. The list of products a customer uses yields a group of items. For simplicity the following groups are chosen:

In the first example in Table 13 there is a group ID field and one item field. Each record corresponds to one item in a group, that is, each group is represented by as many records as there are items in the group. The group ID is mandatory in this example because it is needed to identify the items that belong to the same group. Table 13 shows the most flexible table layout because neither the maximum transaction length nor the number of different items per group are limited after the table format has been defined.

Table 13. Table layout--Example 1
Group ID Item
Smith checking account
Smith saving account
Smith credit card
Jackson checking account
Jackson credit card
Jackson loan
Jackson custody account
Douglas checking account
Douglas custody account

In the next examples in Table 14 and Table 15 each group is represented by exactly one record. The group ID is not needed to find the items that belong to the same group. Therefore the group ID is optional for those table layouts.

In example 2 shown in Table 14 each item field contains the item at a given position in the group, or NULL if there is no such item in this group. The field value identifies the item, whereas the field name is not relevant. The table layout of Table 14 limits the maximum transaction length to the number of item fields once the table has been created.

Table 14. Table layout--Example 2
Group ID Item1 Item2 Item3 Item4
Smith checking account saving account credit card -
Jackson checking account credit card loan custody account
Douglas checking account custody account - -

In example 3 in Table 15 each item field corresponds to exactly one item, that is, if your table contains N different items, there are N item fields. The field identifies the item and the field value states if the item is part of the group or not. In this example "Y" indicates that the item is a member of the group and NULL or empty string or blank string indicates that it is not a member of the group. You may choose your own string as 'Yes'-indicator. Each string that is not NULL, empty or blank is considered as 'Yes'-indicator.

Table 15. Table layout--Example 3
Group ID checking account saving account credit card loan custody account
Smith Y Y Y - -
Jackson Y - Y Y Y
Douglas Y - - - Y
Notes:
  1. If you replace the 'No' indicators NULL/empty string/blank string by a non-empty string, refer to example 4 rather than example 3.
  2. The table layout of Table 15 is the most inflexible table layout because both, the maximum transaction length and the number of different items, are set once the table has been created.

Example 4 in Table 16 shows the table layout of Table 15 in a more sophisticated way. The field values provide additional information about the items, such as the balance of the checking and saving account, the number of credit cards, the type of the loan and a rating of the usage of the custody account.

Note:
Some item fields contain numeric values. There is no restriction to categorical values any more.
Table 16. Table layout--Example 4
Group ID checking account saving account credit card loan custody account
Smith 122.76 25,183.15 1 - -
Jackson -3,000 - 5 long term high activity
Douglas 11,877.43 - - - low activity

Defining the item names

For Table 13 and Table 14 the content of the item fields define the unique item names (such as saving account) needed to distinguish the items. For Table 15 and Table 16, however, it is different:

Table 17

displays the resultant item names for the examples described before.

Table 17. Resultant item names
Example Item name Origin of item name
1 [checking account] [field value]
2 [checking account] [field value]
3 [checking account] [field name]
4 [checking account = 122.76] [field name = field value]
Notes:
  1. The equal sign (=) is surrounded by blanks.
  2. The item names you choose must be unique across all item fields. If they are not unique, the items are considered identical.

As you can see from the examples above, the table layout is determined by the way you define the item name from the field name and field value.

Discretization for numeric fields

In a real scenario there are many different balances in the fields "checking account" and "saving account" in example 4 (Table 16). The probability that two customers have the same balance is rather low. Therefore an Associations mining run with those numeric fields might be useless because the balance is part of the item name and almost each customer generates his own items.

To circumvent this principal problem of numeric fields, the Intelligent Miner provides a discretization mechanism for numeric fields. If a numeric field contains more than 20 different values, the value range is divided in buckets. The number of buckets and the boundaries of the buckets are automatically determined by the association kernel. If a discretization of a numeric field occurs, the resultant item names are as follows:

For example, if there are more customer entries in Table 16 of example 4 with more than 20 different balances in the field 'checking account', the items resulting from the field 'checking account' might be:

[checking acccount: < -5000]
[checking account: >= -5000 AND < 0]
[checking account: >= 0 AND < 5000]
[checking account: >= 5000 AND < 10000]
[checking account: >= 10000 AND < 15000]
[checking account: >= 15000 AND < 20000]
[checking account: >= 20000 AND < 25000]
[checking account: >= 25000 AND < 30000]
[checking account: >= 30000 AND < 35000]
[checking account: >= 35000 AND < 40000]
[checking account: >= 40000]
Notes:
  1. The following operators are surrounded by blanks: '>' '>=' '<' 'AND'
  2. 'AND' is language-independent
  3. The number format of the boundary values is language-independent; the decimal separator is a dot, for example: '122.76'

If the automatically chosen buckets do not suit your needs, you can set the most left and the most right boundary value by the method DM_setFldOutlLim in the logical data specification. Ten equally broad buckets will be created between these boundary values.

Defining the table layout in the settings

As described in the previous sections, the table layout that you want to use for your mining run is defined by the item format. The item format is defined in the structured type DM_RuleSettings. Use the method DM_setItemFormat for the value of type DM_RuleSettings to define the item format of your choice. For more information refer to DM_setItemFormat.

The chosen item format can be retrieved by the method DM_getItemFormat.

If your table layout requires a group ID, refer to DM_setGroup to define it.

If your table contains fields you do not want to use in your mining run, you can deactivate a field using the method DM_setFldUsageType.

Notes:
  1. If you do not explicitly set the field-usage type to 'active' or 'inactive', the kernel decides if the field is taken into account or discarded for your mining run.
  2. If you want to use one item field only for your mining run, you can apply the method DM_setItemFld on the value of type DM_RuleSettings. This method sets the item format to 1, the field-usage type of the item field to 'active', and deactivates all other item fields for the mining run.

Example settings

Here you find the settings for the examples provided in previous sections:

Additional comments on table layout

For the examples shown in Table 14, Table 15, and Table 16 there is no restriction to one record per group.

Table 18, for example, shows the table layout of example 2 (Table 14) with two instead of four item fields.

Table 18. Modified table layout of example 2--Example 5
Group ID Item1 Item2
Smith checking account saving account
Smith credit card -
Jackson checking account credit card
Jackson loan custody account
Douglas checking account custody account
Note:
If a transaction is represented by more than one record, a group ID must be defined. Therefore, the setting for Example 5 (Table 18) is:
IDMMX.DM_RuleSettings()..DM_useRuleDataSpec(...)
..DM_setMinSupport(58.0)
..DM_setMinConf(95)
..DM_setItemFormat(1)
..DM_setFldUsageType(1)
..DM_setGroup('Group ID')

If you join two different tables for your input table, some entries might be duplicated in the resulting view. The duplicated items do not cause any problem because the kernel ignores duplicated items in a group.

For example, if you join Table 19 with the table shown in Table 15, the table shown in Table 20 is created.

Table 19. Additional customer data
Group ID Customer access
Smith Internet
Smith ATM/Desk
Jackson Internet
Douglas Internet
Table 20. Joined table layout
Group ID Item1 Item2 Item3 Item4 Customer access
Smith checking account saving account credit card - Internet
Smith checking account saving account credit card - ATM/Desk
Jackson checking account credit card loan custody account Internet
Douglas checking account custody account - - Internet
Note:
The duplication of, for example, [credit card] in group 'Smith' does not affect the result, because duplicated items in the group are eliminated for the calculation of the rules.

Controlling the number of association rules

There are several ways of controlling the number of rules that are created.

Defining minimum support

For a general description refer to Support in an association rule.

To define the minimum support that a rule must exceed to be calculated, use the DM_setMinSupport method to set the minimum support in the DM_RuleSettings value such as:

 IDMMX.DM_RuleSettings()..DM_setMinSupport(25)

If you do not set the minimum support, the algorithm estimates a useful level for it.

Note:
DM_setMinSupport takes a percentage value as its input parameter, that is, for example, 25 rather than 0.25.

To retrieve the value set for minimum support, use the method DM_getMinSupport.

Defining minimum confidence

For a general description refer to Confidence in an association rule.

To define the minimum confidence that a rule must exceed to be calculated, use the DM_setMinConf method to set the minimum confidence, as a percentage value, in the DM_RuleSettings value.

If you do not set the minimum confidence, the default value of 25 applies.

Note:
DM_setMinConf takes a percentage value as its input parameter, that is, for example, 35 rather than 0.35.

To retrieve the value set for minimum confidence, use the method DM_getMinConf.

Specifying maximum rule length

A general introduction is provided in Rule body and rule head and Rule length and item constraints.

To control the number of rules you can define an upper limit for the length of the rules including both, the rule head and the rule body, that is, the maximum number of items in a rule.

To specify maximum rule length set the maximum rule length in the DM_RuleSettings value by using the method DM_setMaxLen. Retrieve this value by using DM_getMaxLen.

Name mapping and taxonomy

For a general description refer to Name mappings and Taxonomies.

Name mapping and taxonomy are defined in the logical data specification of your mining task. For more information refer to Defining a name mapping in the logical data specification.

Consider the following for an association mining run:

Setting item constraints

You have seen that you can control the number of rules by specifying settings for minimum support, minimum confidence, and maximum rule length. However, a further (and very effective) way exists: you can apply an item constraint.

A general introduction is provided in Rule length and item constraints.

To set item constraints define the constraint type in the DM_RuleSettings value by using the method DM_setConType(type), and retrieve it by using DM_getConType. Set up the list of items and categories in the DM_RuleSettings value by repeatedly calling the method DM_addConItem(item). To remove an item, use the method DM_remConItem(item). The method DM_getNumConItem returns the total number of items in the constraint list, and DM_getConItem returns an item from this list. These latter methods take a parameter whose value ranges from 1 to the total number of items.

Notes:
  1. The item names are case sensitive.
  2. For the item constraints you must state the correct item name, that is, if you choose the item format field name = field value, you must not omit the field name or field value or the equal sign. Vice versa, if you define the item name as field value or field name, you must not add the field name or field value, respectively.
  3. If a name mapping is defined for the field in the logical data specification, the field value is built from the mapped field value rather than the original field value.

    For example, a field 'Account Type' contains the field value 'C1'. You define the item name as field name = field value. A name mapping exists for this field that maps 'C1' to 'Checking Basic'. The resulting item name for the definition of the item constraints is 'Account Type = Checking Basic'.

  4. If you want to add a category of your taxonomy to the list of item constraints, you must build the correct category name the same way you build your item names, that is, you might have to add the field name or replace the category name by the mapped category name.
  5. If you choose the item format [fieldname = field value] and you want to exclude all items whose names are built from the same field value but different fieldnames you must not state all item names individually. You can replace the fieldname by "*" when you define the item constraint. The Association mining function replaces the '*' by a list of all active item field names.

    For example, if you replace all NULL values in Table 15 by "N" to indicate that the customer has not used the product, you get rules of the type [saving account = N] ==> [credit card = N], because the field value "N" is neither NULL, an empty String, nor a blank string. You can suppress these rules when you apply an excluding item constraint [* = N]. All rules that have items of the type [... = N] are excluded from the result.

Defining fields as active or inactive

A general introduction is provided in Active or inactive fields.

When using the Association mining function you should explicitly set the usage type of a field to active if you want to use it as an item field. Set the usage type to inactive if you do not want to use it as an item field. If you are undecided about a field, do not set the usage type of this field.

The Association mining function decides about the usage type together with the routine for autonomic variable selection. If this routine determines the field not to be useful for the mining process, the field is considered inactive during the generation of the mining model.

For more information refer to DM_setFldUsageType and Autonomic variable selection.

Specifying settings parameters for the Classification mining function

The following are a number of issues to do with settings definitions that are specific to the Classification mining function.

Specifying the class label field

For a description of the class label field, see Class label field.

Use DM_setClasTarget to specify the target (class label) field for a DM_ClasSettings value. The mining data type of this field must be categorical. The specification of this field is mandatory.

Example:
In this example, the logical data specification is created manually.

IDMMX.DM_ClasSettings()..DM_useClasDataSpec(IDMMX.DM_LogicalDataSpec()..
DM_addDataSpecFld('NAME')..DM_addDataSpecFld('SEX')..DM_addDataSpecFld
('DISEASED'))..DM_setClasTarget('DISEASED')
Note:
Class labels can be up to 256 characters long.

Specifying maximum purity

For a general description, see Maximum purity per internal node.

Use DM_setTreeClasPar('MaxPur','purity value') to set the value for maximum purity in the DM_ClasSettings value.

Note:
Default: 100 percent

Specifying maximum tree depth

For a general description, see Maximum tree depth.

Use DM_setTreeClasPar('MaxDth','maxTreeDepth value') to set the maximum tree depth in the DM_ClasSettings value.

Note:
Default: Unlimited

Specifying the minimum number of records per internal node

For a general description, see Minimum number of records per internal node.

Use DM_setTreeClasPar('MinRec','MinRecords value') to set the minimum number of records per internal node in the DM_ClasSettings value.

Note:
Default: 5

Specifying the tolerated level of incorrect predictions

For a general description refer to Tolerated levels of incorrect predictions.

Use DM_setClasCostRate(percentage) to specify the percentage of incorrect predictions that can be tolerated on validation data in a Classification model.

Note:
By default, the tolerated level is zero.

Defining a cost matrix

For a general description refer to Cost matrix.

You can assign more or less weight to certain misclassifications by defining asymmetric error weighting. To define asymmetric error weighting, you specify a cost matrix.

Use DM_setCostMat(tableName, colNameActualValue, colNamePredValue, colNameWeight) to specify a cost matrix for a DM_ClasSettings value.

Notes:
  1. By default, all classifications have an equal weight of 1.
  2. By default, the cost matrix will be automatically adjusted so that values of a target field that appear less frequently are not discriminated.

Defining fields as active or inactive

For a general description refer to Active or inactive fields.

When using the Classification mining function you need not set fields as active or inactive. This task is done by the Classification mining function together with the routine for autonomic variable selection. If this routine determines a field not to be useful for the mining process, you can overrule it by setting this field to active.

Notes:
  1. You must set the target field explicitly for decision trees, it is not set automatically.
  2. For more information refer to DM_setFldUsageType and Autonomic variable selection.

Specifying settings parameters for the Clustering mining function

The following are a number of issues to do with settings definitions that are specific to the Clustering mining function.

For each field in a logical data specification, you can create optional definitions in a DM_ClusSettings value that are specific to the Distribution-based Clustering algorithm. You can also set some control parameters, for example, the maximum number of clusters or the desired execution time.

Defining fields as active and supplementary

For more information refer to Active or supplementary fields, Autonomic variable selection, and DM_setFldUsageType.

You can personalize the fields that must be used to train the Clustering model by specifying active fields and supplementary fields.

You can set the usage type of a field to active or supplementary on a DM_ClusSettings value.

Specifying field weighting

For a general description refer to Field weighting.

Use the method DM_setFldWeight(fieldName, weight) on a DM_ClusSettings value to assign a field weight for a field in the logical data specification.

Note:
The weight value is strictly positive. You can choose to implement field weighting or not. The specification is considered only for active fields. If you do not specify a value, the default field weight (1.0) is used during the Clustering training run.

Specifying value weighting

For a general description refer to Value weighting.

Use the method DM_setDClusFldPar(fieldname, 'ValueWeighting', value) on a DM_ClusSettings value to specify a value weighting for a field in the logical data specification.

Note:
Default: No value weighting is used.

For a full description of the parameters to use for value weighting, including weighting with compensation, see DM_setDClusFldPar.

Specifying similarity scale

For a general description refer to Similarity scale.

You can set the scale of similarity that the mining function uses when it compares two values of a numerical field. Use the method DM_setFldSimScale(fieldName, absoluteSimilarity) on a DM_ClusSettings value to specify a similarity scale for a numerical field in the logical data specification.

Note:
Default: The Distribution-based Clustering algorithm uses half of the standard deviation of the numerical field.

Treating outliers

For a general description refer to Outlier treatment.

You can specify how the mining function treats values that lie outside the scope of a field's value range.

Use the method DM_setFldOutlTreat(fieldName, outlierTreatment) on a DM_ClusSettings value to set the outlier treatment.

Notes:
  1. Default: 0 (treat outliers as they are)
  2. It is recommended that you define an outlier treatment only if you also define lower and upper bounds for the numerical field with the method DM_setFldOutlLim in the logical data specification.
  3. If you specify an outlier treatment without specifying any limits, the Clustering algorithm might use the outlier treatment with its own calculated limits.

Specifying a similarity matrix

For a general description refer to Similarity matrices.

To define a similarity matrix call the method DM_addSimMat(matrixName, tableName, fldValCol1, fldValCol2, simCol) on a DM_ClusSettings value. You can later attribute this similarity matrix to one or several fields of the logical data specification. To do this, use the method DM_setFldSimMat(fieldName, matrixName) on the same DM_ClusSettings value.

Note:
Default: The identity matrix. Two different values have a similarity of 0; two identical values have a similarity of 1.

Specifying the maximum number of clusters

For a general description refer to Maximum number of clusters.

To specify the maximum number of clusters use the method DM_setMaxNumClus(maxNOClus) on a DM_ClusSettings value.

Note:
If you do not set the maximum number of clusters, an unlimited number of clusters is not necessarily created. When no value is set, the Clustering mining function itself determines the maximum number of clusters.

Defining the similarity threshold

For a general description refer to Similarity threshold.

Use the method DM_setDClusPar('SimThr', value) on a DM_ClusSettings value to set the similarity threshold.

Note:
Range: 0 to 1. Default: 0.5

Setting the desired execution time

For a general description refer to Desired execution time.

Use the method DM_setExecTime(time) on a DM_ClusSettings value.

Specifying the minimum percentage of data that is processed

For a general description refer to Minimum percentage of data.

Use the method DM_setMinData(minData) on a DM_ClusSettings value to specify the minimum percentage of data that is processed.

Notes:
  1. The default value, 100, means that no sampling is specified; 100% of the data has to be considered.
  2. You must also specify the desired execution time.

Specifying settings parameters for the Regression mining function

The following are a number of issues to do with settings definitions that are specific to the Regression mining function.

For each field in a logical data specification, you can create optional definitions in a DM_RegSettings value that are specific to the Regression algorithm.

Specifying the target field

For a general description refer to Target field.

You must use DM_setRegTarget to specify the field name of a target field of a DM_RegSettings object. The mining data type of this field must be numerical. Its name must coincide with one of the field names defined in the logical data specifications.

Note:
This field is mandatory.

For more information refer to DM_setRegTarget.

Specifying the maximum tolerated systematic error (RSquared)

For a general description refer to Maximum tolerated systematic error (RSquared).

Use DM_setRegRSquared to set an upper threshold for r2 to set an upper limit for the acceptable systematic error of the model. For more information refer to DM_setRegRSquared.

Setting the desired execution time

For a general description refer to Desired execution time.

You set the desired execution time to specify the maximum threshold for the total run time of subsequent Regression mining runs. Use the method DM_setExecTime(time) on a DM_RegSettings value.

Notes:
  1. If you do not set this parameter, the execution time is unlimited, but the Regression algorithm will try to keep it as short as possible.
  2. The value which was specified in DM_setExecTime is not a rigorous threshold, which is always respected by the training algorithm. The training stops at the first suitable point as soon as this threshold has been passed. Therefore, sometimes the training can take considerably more time than specified using DM_setExecTime.

For more information refer to DM_setExecTime.

Defining fields as active and inactive

For a general description refer to Active or inactive fields.

You can personalize the fields that must be used to train the Regression model by specifying active fields and inactive fields. Such a field does not take part in the calculation of a Regression model.

If you do not set the usage type for a field, the Regression algorithm does it for you. The algorithm detects fields that are not useful for a Regression training run, and automatically sets them to inactive. Refer to Autonomic variable selection for more information about fields that are not considered useful for mining. The other fields are considered active and are used for the Regression run.

For more information refer to DM_setFldUsageType.

Defining mining tasks

This chapter describes how to create the mining task. A mining task brings together all the information actually needed to start a training run and to compute the mining model. This information consists of the mining settings you created in the previous step, and the input data definition that you created at the beginning.

You can also define tasks for test runs. These tasks bring together all the information actually needed to start a test run. This information consists of the mining data used to test a mining model and a location of the mining model to be tested.

For more information on defining mining tasks in the model-building and model-testing process refer to:

The tasks you perform in this step are:

In this step, you create the following data types, perform operations on them, or both:

For a full discussion of the data types used with IM Modeling, see Introducing database objects and data mining in SQL.

For a full list of the methods that you can use in connection with those data types, see Mining tasks methods.

A DM_RuleBldTask, DM_ClasBldTask, DM_ClusBldTask, or DM_RegBldTask type provides all the information actually needed to start a training run and to compute a data mining model. In a task, a settings definition is combined with a physical data specification of type DM_MiningData. This combination is valid if an alias name is defined in the physical data specification for each field name in the logical data specification of the settings values.

Defining mining task values for training runs

To combine a settings definition with a physical data specification and to construct a task, call the following methods:

The training runs are executed in stored procedures named DM_buildRuleModel for association, DM_buildClasModel for classification, DM_buildClusModel for clustering, and DM_buildRegModel for regression.

Tasks parameters for the Classification or Regression mining function

For Classification or Regression the DM_defClasBldTask method or the DM_defRegBldTask method gets a second DM_MiningData value as input. The source table defined in that DM_MiningData value is used to validate the data mining model produced during the execution of a Classification or Regression training run. If this second DM_MiningData value is NULL, no validation takes place.

Defining mining task values for test runs

It is also possible to define a task that contains all the information needed for a Classification or Regression test run. Use the type DM_ClasTestTask and DM_RegTestTask for this purpose. In a test task, you must define a physical data specification of type DM_MiningData and the location of the Classification model that you want to test. To define a complete test task, use the method DM_defClasTestTask and DM_defRegTestTask. The alias names in the physical data specification must match the field names contained in the model, including the target field.

The stored procedures for the test run are named DM_testClasModel and DM_testRegModel.

Defining additional control parameters

You can specify additional control parameters for all the task types. These control parameters consist of the name of an error table or the name of the progress table. For more information about the error and progress table, see:

To define the error message table (EMT):

Call the DM_setErrorTab method to define the name of the EMT for the task values:

As you enabled the database, an EMT was created with the name IDMMX.ErrorTable. You can read the EMT name from the task values by calling the DM_getErrorTab method. If you do not define an EMT, error information is written to the file only.

To identify a mining run in the EMT:

The association between error messages written to the error table and the corresponding mining run is established by a call ID. This is a binary character value that can be specified as an input parameter to the stored procedure doing the training or test run. You can generate the call ID by using the DB2 built-in function GENERATE_UNIQUE(). The call ID is written into each row of the error table to identify the error messages. If you specify no call ID, you are recommended to do one of the following:

To define the progress information table (PIT):

Call the DM_setProgTab method to define the PIT name for the task values:

A progress table is created with the name IDMMX.ProgressTab. To retrieve the PIT name from the task values, call DM_getProgTab. If you do not define a PIT, progress information is not written.

To identify a mining run in the PIT:
The association between progress information written to the PIT and the corresponding mining run is given by the call ID. This is a binary character value that can be specified as an input parameter to the stored procedure doing the training or test run. You can generate the call ID by using the DB2 built-in function GENERATE_UNIQUE(). The call ID is written into each row of the PIT to identify the progress entries. This is the same mechanism as for the error table. If you specify a call ID, it is used for the error message table (EMT) and PIT if specified. If you specify no call ID, you are recommended to do one of the following:

Building and storing mining models

This chapter describes how to build the mining model. For this task, IM Modeling provides predefined procedures that build the mining models and store them in database tables. To build a model, you specify the mining task that you built in the previous step, as well as a database location for the model.

For more information on building and storing mining models in the model-building process refer to:

The principal task you perform in this step is to call the appropriate stored procedure to execute the training run.

In this step, you create the following data types:

For a full discussion of the data types used with IM Modeling, see Introducing database objects and data mining in SQL.

For a full list of the stored procedures that you can use in connection with these data types, see Stored procedures for building mining models.

Executing a training run

To execute training runs, use the following stored procedures:

Each of the procedures exists twice. They take the task as input, either as a CLOB value or as a database location. To get CLOB values from the task types (for example, DM_ClasBldTask), use export methods like DM_expClasTask. When you call the stored procedure, the appropriate data mining model is computed, using all the parameters specified in the task value.

Optionally, you can specify a call ID as an input parameter to the stored procedure. The call ID is a binary character string; it can be generated by means of the DB2 built-in function GENERATE_UNIQUE(). It identifies the entries in the error table and in the progress table as entries written by this specific mining run. If you use a call ID, one error table or progress table can be used by different mining runs. If you do not want to specify a call ID, you must specify NULL for this parameter. (For information about the error and progress table, see Getting error information, and Getting progress information.)

IM Modeling does not provide the data mining model as the return value of the stored procedure. Instead, the model is saved in a database table. The table name, column, and additionally an ID and an ID column are specified as input parameters to the stored procedure. The reason for storing the model directly in a table has to do with its size. The stored procedure must be called in a client application program by means of a CALL statement. If the model were returned by the stored procedure, the client application would have to provide the storage for the model. Because the storage requirements for the model types DM_RuleModel, DM_ClasModel, DM_RegressionModel, or DM_ClusteringModel are very large, this might lead to problems in the client application.

Other versions of the stored procedures take the task as input in the form of a database location. These versions are as follows:

These stored procedures do not have the parameter call ID.

Example for a Clustering training run

A code example for executing a training run on the mining model is provided here. It is assumed that you use the sample tables provided with IM Modeling to store the following:

The parameters are as follows:

MyClusGenericTask
The ID for the Clustering training task
MyClusGenericModel
The name of the Clustering training model

The stored procedure call to execute the training run of the model is as follows:

CALL IDMMX.DM_buildClusModelCmd('IDMMX.CLUSTASKS', 'TASK', 'ID', 
'MyClusGenericTask', 'IDMMX.CLUSTERMODELS', 'MODEL', 'MODELNAME',
'MyClusGenericModel' );

Testing a model and analyzing its quality

You can test a model (Classification or Regression models) by running a test task, and you can also analyze its quality by extracting quality information from the test result or model.

For a general introduction refer to Testing a model and analyzing its quality.

Testing Classification or Regression models

You can test a Classification or Regression model. Testing the model includes checking and analyzing the quality of the prediction that IM Modeling makes for the classification or regression of the records used in the test. For a general description refer to Testing Classification or Regression models.

You test a Classification or Regression model by using stored procedures. You can run a test on the:

For more information refer to Stored procedures for testing mining models.

Executing a test run on the mining model

When you do a Classification or Regression test run on the mining model using new data, you specify only the model and the relevant physical data specification.

Use one of the following stored procedures to test the:

The DM_testClasModelCmdD or DM_testRegModelCmdD procedure can be called from the DB2 command line. These procedures take the Classification or Regression model as input. Passing the complete model as input would mean passing many megabytes into the stored procedure. Therefore, you pass only a database location to the model into the stored procedure. This database location consists of the table name, the model column name, the ID, and the ID column name.

Another input parameter specifies the source table to be used to test the model. The DM_testClasModelD or DM_testRegModelD procedure gets a CLOB value that was exported from a value of type DM_MiningData by means of the method DM_expMiningData. The DM_testClasModelCmdD or DM_testRegModelCmdD procedure takes a database location that points to a value of type DM_MiningData. The database location consists of:

This source table must contain the fields in the model and the target field, which contains the actual classification or regression of the rows. The columns contained in the DM_MiningData value must be mapped to the fields contained in the model using the alias name. To query the fields in the model, use the following functions on the model:

The DM_getFields table function returns a table containing the list of all fields except the target field. The target field is returned by the function DM_getClasTarget or DM_getRegTarget.

You can also specify a call ID, which identifies this particular test run in progress and error information. To generate the call ID, use the DB2 built-in function GENERATE_UNIQUE().

The stored procedure saves the test result as a value of type DM_ClasTestResult or DM_RegTestResult in a database table. You specify the database location consisting of the table name, column, and additionally an ID and an ID column as input parameters to the stored procedure.

Example for a Classification test:
A code example for executing a test run on the mining model is provided here. It is assumed that you use the samples tables provided with IM Modeling to store the following: The parameters are as follows:
MyClassifmodel
The model name for the classification model
MyMiningData
The ID for the mining data value
MyTestResult
The ID for the classification test result
The stored procedure call to test the model is as follows:
 CALL IDMMX.DM_testClasModelCmdD( 'IDMMX.MININGDATA', 'MININGDATA',
'ID', 'MyMiningData', 'IDMMX.CLASSIFMODELS', 'MODEL', 'MODELNAME', 
'MyClassifModel', 'IDMMX.CLASTESTRESULTS', 'RESULT', 'ID',
'MyTestResult' ) 

For more information refer to:

Executing a test run on the test task

When you do a Classification or Regression test run on the test task, you specify the test task, and also some additional control parameters if you wish.

To test the Classification or Regression model, use the stored procedure DM_testClasModelT or DM_testRegModelT, and provide the test task as input. The test task is provided either as a CLOB value that was exported from a value of type DM_ClasTestTask or DM_RegTestTask by means of the method DM_expClasTestTask or DM_expRegTestTask, or as a database location. A database location consists of a table name, a column containing the DM_ClasTestTask or DM_RegTestTask value, a column containing an ID, and the ID itself.

If you wish, you can also specify a call ID, which identifies this particular test run in progress and error information. To generate the call ID, use the DB2 built-in function GENERATE_UNIQUE().

You can also use another stored procedure, which can be called from the DB2 command line. This is DM_testClasModelCmdT or DM_testRegModelCmdT, which takes the task as a database location. You cannot specify a call ID as a parameter of the procedure DM_testClasModelCmdT or DM_testRegModelCmdT.

The stored procedures save the test result as a value of type DM_ClasTestResult or DM_RegTestTask in a database table. You specify the database location consisting of the table name, column, and additionally an ID and an ID column as input parameters to the stored procedure.

Here is a code example for executing a Classification Test run on the test task. It is assumed that you use the samples tables provided with IM Modeling to store the following:

The parameters are as follows:

MyClasTestTask
The ID for the classification test task
MyTestResult
The ID for the classification test result

The stored procedure call to test the model is as follows:

 CALL IDMMX.DM_testClasModelCmdT( 
'IDMMX.CLASTESTTASKS', 'ID', 'TASK', 'MyClasTestTask',
'IDMMX.CLASTESTRESULTS', 'RESULT', 'ID', 'MyTestResult' )

For more information refer to:

Analyzing the model quality

When you analyze the quality of a model you extract quality information from a test result or model. This information is provided in tables that you can further process with other programs, as described in Working with mining models and test results.

Quality concepts

With known data, the purpose of applying the model is to detect and verify correlations between the target field's value and the values of the other data fields. Each Regression model, for example, represents a set of assumptions on those causal relations. By comparing the model output with the actual values of the target field in the known data, one can estimate the degree of validity of the model's inherent rules and assumptions. The Regression models, for example, generated by Regression quantify this vague notion of 'degree of validity' by providing two levels of quality information.

The following sections introduce you to the quality measurements and algorithm specifications provided by IM Modeling.

Overall quality Q

This measure indicates the information gain that you get from using the model compared to a random prediction. It provides an overall analysis of the quality.

Each model contains an overall quality measure expressed by the following number:

Note:
The quality numbers are calculated automatically during model creation, based on the data used for training. In Classification and Regression, the quality numbers based on training data tend to be too optimistic. Therefore, Classification and Regression offer the following ways to obtain more reliable quality measures:

The overall quality Q of a model or test result can be retrieved using function DM_getMdlQuality. For more information refer to DM_getMdlQuality.

Ranking quality R

Compares the order of the validation data records when sorted by the predicted values with the order of the same data records when sorted by the actual values of the target fields. The exact formula for R is:

R = area(model) / area(optimum)

Here, area(model) is the area between the gains chart curve for the model and the straight line corresponding to random ordering of the data records. Area(optimum) is the same measure which arises if the data records are ranked by decreasing actual target values on the x-axis (whereas area(model) ranks by decreasing predicted target values on the x-axis). This quality measure is adequate for use cases in which one is interested in identifying, for example, the top 10% of the data with respect to the predicted value. A typical scenario is the planning of a target mailing campaign in which those 10% of the customers are to be mailed for which the action results in the highest additional income.

Keep in mind that the ranking quality only measures the model's ability to predict the correct relative order of the target field values. A model with high ranking quality can still have large systematic errors in its prediction. The ranking quality R of a Classification or Regression model or test result can be retrieved using function DM_getRankQuality. For more information refer to DM_getRankQuality. The quality is indicated by a number between 0 and 1 as described in Overall quality Q.

Predictive accuracy A

Describes whether the predicted values match the actual values of the target field within the incertitude due to statistical fluctuations and noise in the input data values. This is a stronger criterion than R since it requires that not only the relative ordering of the target field values but also their absolute size is correctly modeled. A typical use scenario in which this quality measure is important is again a direct marketing campaign. This time, the aim of the campaign is to generate a given amount X of additional income. The task is to select a sufficient number of the most promising customers so that the planned income will (probably) be reached. Here, it is inevitable that the model predicts not only the ordering of the predicted fields but also their absolute values.

The predictive accuracy A of a Regression model can be retrieved using function DM_getPredAccuracy. For more information refer to DM_getPredAccuracy. The quality is indicated by a number between 0 and 1 as described in Overall quality Q.

Generalization robustness (or reliability) G

This quantity describes the estimated ability of the model to predict unknown data. A value of G=1 means that you can expect the model to provide as accurate predictions on new test or application data as on the training data. A value of G=0 means that the model is considered useless for new data.

The reliability G of a Regression or Classification model can be retrieved using function DM_getReliability. For more information refer to DM_getReliability. The quality is indicated by a number between 0 and 1 as described in Overall quality Q.

Algorithm specifications

The following functions are provided to work with algorithm specifications:

Using the confusion and cost matrix of a Classification model

You can check the confusion and cost matrix of a Classification model.

Define the DM_getConfMatrix function to receive a table that holds the confusion matrix and cost matrix information contained in a value of type DM_ClasTestResult or DM_ClasModel.

If the value is of type DM_ClasModel, the confusion and cost matrix are returned from the validation result.

If no validation result is contained in the model, nothing is returned if you have not specified explicitly that the confusion and cost matrix of the Classification model should be returned.

The following example shows how to define the confusion matrix:

SELECT CAST ("ACTUAL" AS CHAR(15)) AS "ACTUAL_VALUE",
       CAST ("PREDICTED" AS CHAR(15)) AS "PREDICTED_VALUE",
       "COUNT" AS "NUM_CASES",
       "COST" AS "COST_OF_WRONG_PREDICTION"
FROM TABLE (IDMMX.DM_getConfMatrix(
  (SELECT "RESULT" FROM IDMMX."CLASTESTRESULTS" 
   WHERE ID='HeartClasTestResult'))
) AS "MATRIX"
ORDER BY "ACTUAL", "PREDICTED";

For more information refer to DM_getConfMatrix.

Checking the overall quality

Use the DM_getMdlQuality function to check the overall quality of a model as it has been determined in a preceding validation or test step.

It can be specified for the following value types:

The following example shows how to extract information about the quality of a model:

SELECT 
   IDMMX.DM_getMdlQuality("MODEL") AS "MODEL_QUALITY"
FROM IDMMX."CLUSTERMODELS" 
            WHERE "MODELNAME"='BankCustomerSegments';

The following example shows how to extract information about the quality of a test result:

SELECT IDMMX.DM_getMdlQuality("RESULT") AS "MODEL_QUALITY"
        FROM IDMMX."REGTESTRESULTS"
WHERE "ID"='InsuranceTestResult';

For more information refer to DM_getMdlQuality.

Checking gains chart information

Use the DM_getGainsChart function to check gains chart information from a Classification or Regression model.

It can be specified for the following value types:

The following example defines that the gains chart information is read from the result of a Regression test run:

SELECT CAST ("ROWCOUNT" AS SMALLINT) AS "NUMROWS_IN_SUBSET",
       CAST ("SUMACTUAL" AS SMALLINT) 
                         AS "SUM_OF_ACTUAL_TARGET_VALUES",
       CAST ("THRESHOLD" AS DEC(5,2)) 
                         AS "SMALLEST_PRED_VALUE_IN_SUBSET"
FROM TABLE (IDMMX.DM_getGainsChart(
  (SELECT "RESULT" FROM IDMMX."REGTESTRESULTS" 
   WHERE "ID"='InsuranceTestResult'))
) AS "MATRIX"
ORDER BY "NUMROWS_IN_SUBSET";

For more information refer to DM_getGainsChart.

Deviations between predicted values and actual target values

Use the DM_getPredAccuracy function for a Regression or Classification model to check if:

It can be specified for the following value types:

The following example shows how to predict test results from a Regression test run:

SELECT IDMMX.DM_getPredAccuracy("RESULT") 
                               AS "PRED_ACCURACY"
FROM IDMMX."REGTESTRESULTS"
WHERE "ID"='InsuranceTestResult';

For more information refer to DM_getPredAccuracy and Quality concepts.

Comparing the order of data records

Use the DM_getRankQuality function for a Regression or Classification model to compare the order of the:

It can be specified for the following value types:

The following example shows a definition for training data records:

SELECT IDMMX.DM_getRankQuality("RESULT",'2') AS "RANK_QUALITY"
FROM IDMMX."CLASTESTRESULTS"
WHERE "ID"='HeartClasTestResult';

For more information refer to DM_getRankQuality and Quality concepts.

Systematic error in DM_RegressionModel

Use the DM_getRegRSquared function to retrieve the squared Pearson correlation coefficient contained in a value of type DM_RegressionModel.

For more information refer to DM_getRegRSquared and Quality concepts.

Capability to correctly predict unknown data

Use the DM_getReliability function to check if the application of the model produces reliable results if the application data is similar to the validation or test data used.

It can be specified for the following value types:

The following example shows a definition to extract the information from a test result:

SELECT IDMMX.DM_getReliability("RESULT") AS "RELIABILITY"
FROM IDMMX."CLASTESTRESULTS"
WHERE "ID"='HeartClasTestResult';

For more information refer to DM_getReliability and Quality concepts.

Identifying the deviation between predicted and actual target values

Use the DM_getRMSE function to check the error between actual and predicted target field values.

It can be specified for the following value types:

The following example shows a definition to extract the information from a test result:

SELECT IDMMX.DM_getRMSE("RESULT") AS "ROOT_MEAN_SQUARE_ERROR"
FROM IDMMX."REGTESTRESULTS"
WHERE "ID"='InsuranceTestResult';

For more information refer to DM_getRMSE and Quality concepts.

Working with mining models and test results

This chapter describes where you can deploy the model or test result, and how you can prepare the model content for the corresponding application phase.

You use user-defined functions to:

For a general description refer to Working with mining models and test results.

You retrieve information for the following data types:

For a full discussion of the data types used with IM Modeling, see Introducing database objects and data mining in SQL.

Working on mining models

This section describes how to work on data mining models.

Introducing field importance and field-field correlation

When the model building process is finished you can work on field importance and field-field correlation. Classification, Clustering, and Regression store detailed field importance and field-field correlation information in the created model.

For example, the primary purpose for constructing Regression models is to predict numerical values for the target field. However, as a second (and sometimes even more important) purpose, you might be interested in gaining insight into the relations between the explanatory fields and the target field.

Field importance
Describes how important each input field is for the generated model. Classification, Clustering, and Regression create a list containing the names of the most important input fields and for each field a number between 0 and 1. The larger the number is, the more important is the corresponding input field for the resulting model.

DM_getFields returns a table that contains the signature of a model and the importance of its field.

Field-field correlations
Classification, Clustering, and Regression models contain a matrix of field-field correlations between input fields. Only the correlations that can impact the autonomic variable selection of IM Modeling are calculated and written into the model. If the training data contains a large number of fields (columns), so that the matrix of all field-field correlations would be too large, the data mining function automatically drops part of the correlations and writes only the most important ones into the created model.

DM_getCorrelations returns a table that contains the correlations between fields with respect to a data mining model.

Together with the field importance information, the field-field correlations can optimize the data mining process for computation time, the amount of data storage, and the cost of data acquisition.

Example 1
The data to be mined consists of the target field T and 4 input fields A, B, C, and D. The field importance information of a first model created by Regression indicates that fields A, C and D are important for the resulting model, B is less important. The field-field correlations indicate that A and C are strongly correlated, all other field-field correlations are small. The user who performed the mining run knows that acquiring the data for fields B and C is rather costly, whereas A and D can be gathered almost for free. Then a good choice for the future would be to stop gathering the data for fields B and C and continue the mining with input fields A and D only. This reduces the costs without decreasing the model quality (and thus the economic benefit of the mining) considerably.
Note:
Even though field C is important for the resulting model, it can be dropped because the strongly correlated field A still is in the input data, so that a large part of the information brought in by field C will still be provided by field A.
Example 2
A retail marketing company plans a new mailing campaign. Within this campaign, 10% of all customers from a customer database should be informed about several special offers. The company starts a mining process with the aim of finding those 10% of the customers for which the mailing campaign will generate the maximum additional profit for the company.

Based on the common attributes of these customers and on the results of similar mailing campaigns in the past, Regression creates a model which predicts the company's additional profit from the mailing campaign for each customer - also for those customers who have never before been involved in a similar mailing campaign:

  1. A Regression mining run analyzes the data of earlier target marketing campaigns and creates a model which relates the customer response behavior to certain other customer attributes. Then Regression automatically tests the accuracy of this model by applying the model to test data with known customer response behavior. If the user did not specify an extra test data set, Regression can automatically reserve a part of the training data for that test purpose.
  2. The company can apply the validated model with IM Scoring to customers for which no response data exist.
  3. The company might use the field-importance and field-field correlation information of the created mining model to simplify the customer data acquisition process in the future: those customer attributes which the model considers irrelevant for the response behavior need not be gathered and stored any more (for the target marketing purpose).

Identifying fields in the logical data specification

You can use the table function DM_getFields to identify fields in the logical data specification that are used for a test or application run. This function returns a table that contains the signature of a model. The signature of a model is the set of all input data fields which appear in the model's internal equations and whose values are therefore needed to apply the model. The importance of its fields can also be identified in the table.

For more information refer to DM_getFields and Introducing field importance and field-field correlation.

Extracting the name of a model

Use the following function to extract the name of a model:

Identifying the mining task

To identify the mining task that was used to build a model, you can use the following functions:

Retrieving information specific to mining functions

Depending on the mining model, you can retrieve different types of information:

Exporting mining models

IM Modeling also provides export functions that return the model in PMML format as a character large object type, as outlined in Table 21.

Table 21. Functions for exporting mining models
Export function Model type converted to a CLOB value
DM_expRuleModel DM_RuleModel
DM_expClasModel DM_ClasModel
DM_expClusModel DM_ClusteringModel
DM_expRegModel DM_RegressionModel
Here is an example for exporting a Tree Classification model:

It is assumed that a Tree Classification model with MODELNAME='TreClaModel1' was built and exists in the table IDMMX.CLASSIFMODELS. Specify the following command to export it into a plain PMML file:

db2 "EXPORT TO TreClaModel1.del OF del 
     LOBS to C:\mymodels 
     LOBFILE TreClaModel1 
     MODIFIED BY LOBSINFILE 
     SELECT 'MODELNAME', IDMMX.DM_expClasModel('MODEL') 
     FROM IDMMX.CLASSIFMODELS WHERE MODELNAME='TreClaModel1'"

This command exports the model into the plain PMML file TreClaModel1.001 in directory C:\mymodels. The model name and a reference to the model in file TreClaModel1.001 is written into the file C:\mymodels\TreClaModel1.del using the comma-separated-values format.

Working with test results

This section describes how to work with test results.

Retrieving information from test results

The mining test result type DM_ClasTestResult or DM_RegTestResult hold the results information from a test run computed for a Classification or Regression model.

The table function DM_getConfMatrix holds the confusion matrix and cost matrix information contained in a value of type DM_ClasTestResult or DM_ClasModel. If the value is of type DM_ClasModel, the confusion and cost matrix are returned from the validation result.

IM Modeling provides functions to enable you to work with test results. For example, the function:

Exporting test results

To export the test result, type:

This returns the test result in XML format as a character large object value. It reuses the syntax and elements of PMML models.

Reference

Overview of IM Modeling's database objects
Data types
Structured types
Distinct types
Mining field types
Mining data methods
Logical data specification methods
Specifying fields
Specifying categorical field properties
Specifying name mappings
Specifying taxonomies
Specifying numerical field properties
Mining settings methods
DM_RuleSettings
Specifying general Associations settings
Specifying item constraints
DM_ClasSettings
Specifying general Classification settings
Specifying a cost matrix
DM_ClusSettings
Specifying general Clustering settings
Specifying similarity matrices
Specifying field-specific settings
DM_RegSettings
Specifying general Regression settings
Specifying field specific settings
Methods for all DM_*Settings types
Mining tasks methods
DM_ClasBldTask
DM_ClasTestTask
DM_RegTestTask
DM_ClusBldTask
DM_RuleBldTask
DM_RegBldTask
Methods for all DM_*Task types
Stored procedures for building mining models
Stored procedures for testing mining models
Functions for analyzing mining models and test results
Functions for analyzing model type DM_RuleModel
Functions for analyzing model type DM_ClasModel
Functions for analyzing model type DM_ClusteringModel
Functions for analyzing model type DM_RegressionModel
Functions for analyzing test results
Functions for type DM_ClasTestResult
Functions for type DM_RegTestResult
Functions for working with mining models
Functions for working with model type DM_RuleModel
Functions for working with model type DM_ClasModel
Functions for working with model type DM_ClusteringModel
Functions for working with model type DM_RegressionModel
Functions for working with test results
Functions for type DM_ClasTestResult
Functions for type DM_RegTestResult
Stored procedures used for administrative and informational tasks
Naming conventions and parameter sizes
Naming conventions
Parameter sizes
Methods reference
DM_addConItem
DM_addDataSpecFld
DM_addNmp
DM_addSimMat
DM_addTax
DM_addTaxMap
DM_defClasBldTask
DM_defClasTestTask
DM_defClusBldTask
DM_defMiningData
DM_defRegBldTask
DM_defRegTestTask
DM_defRuleBldTask
DM_expClasSettings
DM_expClasTask
DM_expClasTestTask
DM_expClusSettings
DM_expClusTask
DM_expDataSpec
DM_expMiningData
DM_expRegSettings
DM_expRegTask
DM_expRegTestTask
DM_expRuleSettings
DM_expRuleTask
DM_genDataSpec
DM_getClasCost
DM_getClasCostRate
DM_getClasDataSpec
DM_getClasMdlCol
DM_getClasMdlID
DM_getClasMdlIDCol
DM_getClasMdlTab
DM_getClasSettings
DM_getClasTarget
DM_getClasTestData
DM_getClasTrnData
DM_getClasValData
DM_getClusDataSpec
DM_getClusSettings
DM_getClusTrnData
DM_getColumnName
DM_getConItem
DM_getConType
DM_getCostMatAV
DM_getCostMatPV
DM_getCostMatTab
DM_getCostMatWGT
DM_getDClusFldPar
DM_getDClusPar
DM_getErrorTab
DM_getExecTime
DM_getFldAlias
DM_getFldName
DM_getFldNmp
DM_getFldOutlLimLo
DM_getFldOutlLimUp
DM_getFldOutlTreat
DM_getFldSimMat
DM_getFldSimScale
DM_getFldTax
DM_getFldType
DM_getFldUsageType
DM_getFldWeight
DM_getGroup
DM_getItemFld
DM_getItemFormat
DM_getMaxLen
DM_getMaxNumClus
DM_getMinConf
DM_getMinData
DM_getMinSupport
DM_getNmpMapValCol
DM_getNmpName
DM_getNmpTabName
DM_getNmpValCol
DM_getNumColumns
DM_getNumConItem
DM_getNumFields
DM_getNumNmp
DM_getNumSimMat
DM_getNumTax
DM_getNumTaxMap
DM_getPowerOptions
DM_getProgTab
DM_getRegDataSpec
DM_getRegMdlCol
DM_getRegMdlID
DM_getRegMdlIDCol
DM_getRegMdlTab
DM_getRegRSquared
DM_getRegSettings
DM_getRegTarget
DM_getRegTestData
DM_getRegTrnData
DM_getRegValData
DM_getRuleDataSpec
DM_getRuleSettings
DM_getRuleTrnData
DM_getSimMatName
DM_getSimMatSim
DM_getSimMatTab
DM_getSimMatVal1
DM_getSimMatVal2
DM_getTableName
DM_getTaxChildCol
DM_getTaxMapType
DM_getTaxName
DM_getTaxParentCol
DM_getTaxParentNmp
DM_getTaxTabName
DM_getTreeClasPar
DM_getWhereClause
DM_impClasSettings
DM_impClasTask
DM_impClasTestTask
DM_impClusSettings
DM_impClusTask
DM_impDataSpec
DM_impMiningData
DM_impRegSettings
DM_impRegTask
DM_impRegTestTask
DM_impRuleSettings
DM_impRuleTask
DM_isCompatible
DM_remConItem
DM_remDataSpecFld
DM_remNmp
DM_remSimMat
DM_remTax
DM_remTaxMap
DM_setClasCost
DM_setClasCostRate
DM_setClasTarget
DM_setColumns
DM_setConType
DM_setCostMat
DM_setDClusFldPar
DM_setDClusPar
DM_setErrorTab
DM_setExecTime
Return value for clustering
Return value for regression
DM_setFldAlias
DM_setFldNmp
DM_setFldOutlLim
DM_setFldOutlTreat
DM_setFldSimMat
DM_setFldSimScale
DM_setFldTax
DM_setFldType
DM_setFldUsageType
DM_setFldWeight
DM_setGroup
DM_setItemFld
DM_setItemFormat
DM_setMaxLen
DM_setMaxNumClus
DM_setMinConf
DM_setMinData
DM_setMinSupport
DM_setPowerOptions
DM_setProgTab
DM_setRegRSquared
DM_setRegTarget
DM_setTreeClasPar
DM_setWhereClause
DM_useClasDataSpec
DM_useClusDataSpec
DM_useRegDataSpec
DM_useRuleDataSpec
Functions reference
DM_expClasModel
DM_expClasTestRes
DM_expClusModel
DM_expRegTestRes
DM_expRegModel
DM_expRuleModel
DM_getClasCostRate
DM_getClasError
DM_getClasMdlName
DM_getClasMdlSpec
DM_getClasTarget
DM_getClasTask
DM_getClusMdlName
DM_getClusMdlSpec
DM_getClusTask
DM_getClusterName
DM_getClusters
DM_getConfMatrix
DM_getCorrelations
DM_getErrors(rowcount)
DM_getFields
DM_getFields(miningData)
DM_getGainsChart
Return value for regression
Return value for classification
DM_getMdlQuality
DM_getNumClusters
DM_getNumRules
DM_getNumTransacts
DM_getPredAccuracy
Return value for regression
Return value for classification
DM_getPredError
DM_getRankQuality
Return value for regression
Return value for classification
DM_getRegMdlName
DM_getRegMdlSpec
DM_getRegRSquared
DM_getRegTarget
DM_getRegTask
DM_getReliability
Return value for regression
Return value for classification
DM_getRMSE
DM_getRuleBodies
DM_getRuleMdlName
DM_getRules
DM_getRuleTask
DM_getTreeRules
DM_isValidated
Stored procedures reference
DM_buildClasModel,
DM_buildClasModelCmd
DM_buildClusModel,
DM_buildClusModelCmd
DM_buildRegModel,
DM_buildRegModelCmd
DM_buildRuleModel,
DM_buildRuleModelCmd
DM_cancelTask
DM_getEnv
DM_getMiningData
DM_setEnv
DM_testClasModelD (using mining data),
DM_testClasModelCmdD
DM_testClasModelT (using a test task),
DM_testClasModelCmdT
DM_testRegModelD (using mining data),
DM_testRegModelCmdD
DM_testRegModelT (using a test task),
DM_testRegModelCmdT
Command reference
The idmcheckdb command
The idmdisabledb command
The idmenabledb command
The idminstfunc command
The idmuninstfunc command
The idmlevel command
The idmlicm command

Overview of IM Modeling's database objects

This chapter provides reference lists of all the database objects supplied with IM Modeling, together with a short description of each.

These database objects reside in the schema IDMMX.

Each short description in this chapter includes a reference to where you can find the full description.

Where relevant, each description here also has an indication of whether the database object is part of the SQL/MM standard. For information about this standard, see Standards conformance.

For more information refer to Introducing database objects and data mining in SQL and Naming conventions and parameter sizes.

Data types

The user-defined data types of IM Modeling are introduced in User-defined data types. They store the following values:

Structured types

Structured types are introduced in User-defined data types.

Table 22. Structured data types
Type name Attribute's source data type Comment SQL/MM data type
DM_ClasBldTask CLOB Contains all the information that constitutes a Classification task, in particular the input data and the parameter settings Y
DM_ClasSettings CLOB Contains the settings that are used to generate a Classification model Y
DM_ClasTestTask CLOB Contains all the information that constitutes a Classification test task, in particular the input data, the logical data specification, and a location for a Classification model Y
DM_ClusBldTask CLOB Contains all the information that constitutes a Clustering task, in particular the input data and the parameter settings Y
DM_ClusSettings CLOB Contains the settings that are used to generate a Clustering model Y
DM_LogicalDataSpec CLOB Contains the field name and field type definitions of the mining fields that are part of the input data used to build models and test models Y
DM_MiningData CLOB Contains the definition of the input data used to build models and test models Y
DM_RegBldTask CLOB Contains all information that constitutes a Regression task, in particular the input data and the parameter settings Y
DM_RegSettings CLOB Contains the settings that are used to generate a Regression model Y
DM_RegTestTask CLOB Contains all information that constitutes a Regression test task, in particular the input data, logical data specification and a location of a Regression model Y
DM_RuleBldTask CLOB Contains all the information about a search for association rules, in particular the input data and the parameter settings Y
DM_RuleSettings CLOB Contains the settings that are used to generate an Associations model Y

Distinct types

Distinct types are introduced in User-defined data types.

Table 23. Distinct data types
Type name Source data type Comment SQL/MM data type
DM_ClasModel BLOB Represents a Classification model Y
DM_ClusteringModel BLOB Represents a Clustering model Y
DM_RuleModel BLOB Represents an Associations model Y
DM_RegressionModel BLOB Represents a Regression model Y
DM_ClasTestResult BLOB Contains the result of a test run of a Classification model Y
DM_RegTestResult BLOB Contains the result of a test run of a Regression model Y

Mining field types

The DM_LogicalDataSpec data type defines the input fields used by training runs. An input field is defined by a name and a type. The type defines how a mining algorithm handles that field. Possible types are DM_Categorical or DM_Numerical, and these types map by default to the DB2 source data types listed here.

Table 24. Mining field types
Mining data field type name Mining field type value Source data type
DM_Categorical 0 CHAR, VARCHAR, LONG VARCHAR
DM_Numerical 1 SMALLINT, INTEGER, DOUBLE, FLOAT, DECIMAL, BIGINT, REAL, TIME, DATE, TIMESTAMP
Note:
The fields of source data type TIME, DATE, or TIMESTAMP uses the field type DM_Numerical by default. The numeric value of such fields is calculated as follows:

Mining data methods

These methods act on a value of type DM_MiningData. The value holds information about the source data for which you want to build a mining model. With these methods, you can create a value, specify the names of columns in the source data, and generate a logical data specification. You can also do other modifications to the DM_MiningData value and retrieve information about it.

For a general introduction refer to Defining mining settings.

Table 25. Methods for type DM_MiningData
Method Purpose SQL/MM method See:
DM_defMiningData Defines a DM_MiningData value from a given source table name Y DM_defMiningData
DM_expMiningData Exports the DM_MiningData value as a CLOB value N DM_expMiningData
DM_genDataSpec Generates a value of type DM_LogicalDataSpec from a DM_MiningData value Y DM_genDataSpec
DM_getColumnName Returns the column name at a specified position.
Note:
This method is deprecated. Use the table function DM_getFields instead, as described in DM_getFields(miningData).
N DM_getColumnName
DM_getFields(miningData) Returns a table of the fields contained in a value of type DM_MiningData.
Note:
DM_getFields(miningData) is a table function.
N DM_getFields(miningData)
DM_getFldAlias Returns the alias name that corresponds to the specified column name.
Note:
This method is deprecated. Use the table function DM_getFields instead, as described in DM_getFields(miningData).
N DM_getFldAlias
DM_getNumColumns Returns the number of columns specified in the DM_MiningData value.
Note:
This method is deprecated. Use the table function DM_getFields instead, as described in DM_getFields(miningData).
N DM_getNumColumns
DM_getTableName Returns the name of the base table or view, or the nickname specified in a value of type DM_MiningData N DM_getTableName
DM_getWhereClause Returns a specified WHERE clause N DM_getWhereClause
DM_impMiningData Imports a previously exported DM_MiningData value N DM_impMiningData
DM_setColumns Specifies the names of the columns in a source table by means of an XML string.
Note:
This method is no longer required, because DM_defMiningData automatically sets column information.
N DM_setColumns
DM_setFldAlias Defines an alias name for a field contained in a DM_MiningData value Y DM_setFldAlias
DM_setWhereClause Sets a WHERE clause to filter the data N DM_setWhereClause

Logical data specification methods

These methods act on a value of type DM_LogicalDataSpec. Use these methods to modify and to query the logical data specification value.

You can create a value of type DM_LogicalDataSpec from a value of type DM_MiningData by using the data mining method DM_genDataSpec. This sets the logical data specification to default values. You can use the methods described here to modify this logical data specification.

You can also use these methods to create a logical data specification from scratch, to specify taxonomies, and to do other specification tasks.

A general introduction is provided in Defining logical data specifications

Specifying fields

Table 26. Methods for type DM_LogicalDataSpec: Specifying fields
Method Purpose SQL/MM method See:
DM_addDataSpecFld Adds a field with a specified name to a value of type DM_LogicalDataSpec Y DM_addDataSpecFld
DM_expDataSpec Exports a DM_LogicalDataSpec value as a CLOB value N DM_expDataSpec
DM_getFldName Returns the name of a field at a specified position in a value of type DM_LogicalDataSpec Y DM_getFldName
DM_getFldType Returns the mining field type of a specified field contained in a value of type DM_LogicalDataSpec Y DM_getFldType
DM_getNumFields Returns the number of fields contained in a value of type DM_LogicalDataSpec Y DM_getNumFields
DM_impDataSpec Imports a previously exported DM_LogicalDataSpec value N DM_impDataSpec
DM_isCompatible Checks whether the field entry specifications in the first argument are a subset of the specifications in the second argument Y DM_isCompatible
DM_remDataSpecFld Removes a field with a specified name from a value of type DM_LogicalDataSpec Y DM_remDataSpecFld
DM_setFldType Sets the data mining field type for a specified field in a value of type DM_LogicalDataSpec Y DM_setFldType
Note:
There are no field specific definitions for a DM_RegSettings object.

Specifying categorical field properties

Table 27. Methods for type DM_LogicalDataSpec: Specifying categorical field properties
Method Purpose SQL/MM method See:
DM_getFldNmp Gets the name mapping specified for a field N DM_getFldNmp
DM_getFldTax Gets the taxonomy specified for a field N DM_getFldTax
DM_setFldNmp Sets a name mapping for a specified field N DM_setFldNmp
DM_setFldTax Sets a taxonomy for a specified field N DM_setFldTax

Specifying name mappings

Table 28. Methods for type DM_LogicalDataSpec: Specifying name mappings
Method Purpose SQL/MM method See:
DM_addNmp Adds a specification of a name mapping consisting of the name, table name, and column names for the original value and the mapped name N DM_addNmp
DM_getNmpMapValCol Returns the name of the column containing the mapped name in a name mapping N DM_getNmpMapValCol
DM_getNmpName Returns the name of the name mapping at a specified position N DM_getNmpName
DM_getNmpTabName Returns the name of the table containing the name mapping N DM_getNmpTabName
DM_getNmpValCol Returns the name of the column containing the value that is to be mapped by means of a name mapping N DM_getNmpValCol
DM_getNumNmp Returns the number of name mapping specifications in the logical data specification N DM_getNumNmp
DM_remNmp Removes a name mapping from the logical data specification N DM_remNmp

Specifying taxonomies

Table 29. Methods for type DM_LogicalDataSpec: Specifying taxonomies
Method Purpose SQL/MM method See:
DM_addTax Adds a taxonomy specification, consisting of a name and a first category map, to the logical data specification N DM_addTax
DM_addTaxMap Adds a category map to the existing taxonomy specified by its name. A category map consists of a table name and column names for the child and parent columns. It can optionally contain a name mapping for the parent column, and a type value that specifies whether the category map is recursive or non-recursive. N DM_addTaxMap
DM_getNumTax Returns the number of taxonomies specified in the logical data specification N DM_getNumTax
DM_getNumTaxMap Returns the number of category maps that belong to a taxonomy N DM_getNumTaxMap
DM_getTaxChildCol Returns the name of the column that contains the child values of a category map N DM_getTaxChildCol
DM_getTaxMapType Returns the type (recursive/non-recursive) of the category map N DM_getTaxMapType
DM_getTaxName Returns the name of the taxonomy at the specified position N DM_getTaxName
DM_getTaxParentCol Returns the name of the column that contains the parent values of a category map N DM_getTaxParentCol
DM_getTaxParentNmp Returns the name mapping of the parent column of a category map N DM_getTaxParentNmp
DM_getTaxTabName Returns the table name of a specified category map N DM_getTaxTabName
DM_remTax Removes a taxonomy from a logical data specification N DM_remTax
DM_remTaxMap Removes a category map from a taxonomy N DM_remTaxMap

Specifying numerical field properties

Table 30. Methods for type DM_LogicalDataSpec: Specifying numerical field properties
Method Purpose SQL/MM method See:
DM_getFldOutlLimLo Returns the lower bound value for a field N DM_getFldOutlLimLo
DM_getFldOutlLimUp Returns the upper bound value for a field N DM_getFldOutlLimUp
DM_setFldOutlLim Sets the lower and upper bound values for a field N DM_setFldOutlLim

Mining settings methods

The mining settings methods act on values of the settings type. These values hold the settings specific to the various mining functions used in training runs.

Use these methods after you have created the logical data specification, and before you build the mining task for the mining function that you are using.

A general description is provided in Defining mining settings.

DM_RuleSettings

These methods act on a value of type DM_RuleSettings. The value holds the settings for an Associations training run.

Use these methods after you have created the logical data specification as a value of type DM_LogicalDataSpec, and before you build the Associations mining task.

With these methods, you can specify general rule settings and item constraints.

Specifying general Associations settings

Table 31. Methods for type DM_RuleSettings: Specifying general rule settings
Method Purpose SQL/MM method See:
DM_expRuleSettings Exports the settings as a CLOB value N DM_expRuleSettings
DM_getFldUsageType Returns the field usage type of a field N DM_getFldUsageType
DM_getGroup Returns the group field that is contained in a value of type DM_RuleSettings Y DM_getGroup
DM_getItemFld Returns the specified item field N DM_getItemFld
DM_getItemFormat Returns how the item names are built N DM_getItemFormat
DM_getMaxLen Returns the specified maximum length of a rule Y DM_getMaxLen
DM_getMinConf Returns the specified minimum confidence Y DM_getMinConf
DM_getMinSupport Returns the minimum support that was specified in a value of type DM_RuleSettings Y DM_getMinSupport
DM_getRuleDataSpec Returns the DM_LogicalDataSpec value defined for a value of DM_RuleSettings Y DM_getRuleDataSpec
DM_impRuleSettings Imports previously exported settings N DM_impRuleSettings
DM_setGroup Specifies the field used to identify the group Y DM_setGroup
DM_setItemFld Specifies the field used to identify the item N DM_setItemFld
DM_setItemFormat Defines how the item names are built from the field value and the field name N DM_setItemFormat
DM_setFldUsageType Sets the usage type for the specified field or all fields Y DM_setFldUsageType
DM_setMaxLen Sets the maximum length of a rule Y DM_setMaxLen
DM_setMinConf Sets the minimum confidence Y DM_setMinConf
DM_setMinSupport Sets the minimum support for a value of type DM_RuleSettings Y DM_setMinSupport
DM_useRuleDataSpec Specifies a DM_LogicalDataSpec value for a DM_RuleSettings value Y DM_useRuleDataSpec

Specifying item constraints

Table 32. Methods for type DM_RuleSettings: Specifying item constraints
Method Purpose SQL/MM method See:
DM_addConItem Adds an item to the list of item constraints N DM_addConItem
DM_getConItem Gets the item at the specified position N DM_getConItem
DM_getConType Gets the item constraint type N DM_getConType
DM_getNumConItem Gets the number of items in the list of item constraints N DM_getNumConItem
DM_remConItem Removes an item from the list of item constraints N DM_remConItem
DM_setConType Sets the item constraint type N DM_setConType

DM_ClasSettings

These methods act on a value of type DM_ClasSettings. The value holds the settings for a Classification training run.

Use these methods after you have created the logical data specification as a value of type DM_LogicalDataSpec, and before you build the Classification mining task.

With these methods, you can specify general Classification settings and a cost matrix.

Specifying general Classification settings

Table 33. Methods for type DM_ClasSettings: Specifying general Classification settings
Method Purpose SQL/MM method See:
DM_expClasSettings Exports the settings as a CLOB value N DM_expClasSettings
DM_getClasCostRate Returns the maximum percentage of misclassifications that are tolerated during validation Y DM_getClasCostRate
DM_getClasCost Returns the cost of predicting a specific class label value for a specific actual class label value Y DM_getClasCost
DM_getClasDataSpec Returns the DM_LogicalDataSpec value defined for a value of DM_ClasSettings Y DM_getClasDataSpec
DM_getClasTarget Returns the target field that is contained in a value of type DM_ClasSettings Y DM_getClasTarget
DM_getFldUsageType Returns the field usage type of a field N DM_getFldUsageType
DM_getTreeClasPar Gets a parameter that is specific to the Tree Classification algorithm N DM_getTreeClasPar
DM_impClasSettings Imports previously exported settings N DM_impClasSettings
DM_setClasCost Returns a specified value of type DM_ClasSettings Y DM_setClasCost
DM_setClasCostRate Sets the maximum percentage of misclassifications that are tolerated during validation Y DM_setClasCostRate
DM_setClasTarget Specifies the target field for a value of DM_ClasSettings Y DM_setClasTarget
DM_setFldUsageType Sets the usage type for the specified field or all fields Y DM_setFldUsageType
DM_setTreeClasPar Sets different settings parameters that are specific to the Tree Classification algorithm N DM_setTreeClasPar
DM_useClasDataSpec Specifies a DM_LogicalDataSpec value for a DM_ClasSettings value Y DM_useClasDataSpec

Specifying a cost matrix

Table 34. Methods for type DM_ClasSettings: Specifying a cost matrix
Method Purpose SQL/MM method See:
DM_getCostMatAV Returns the column name containing the actual value of the cost matrix N DM_getCostMatAV
DM_getCostMatPV Returns the column name containing the predicted value of the cost matrix N DM_getCostMatPV
DM_getCostMatTab Returns the name of the table containing the cost matrix N DM_getCostMatTab
DM_getCostMatWGT Returns the column name containing the weight of the cost matrix N DM_getCostMatWGT
DM_setCostMat Sets a cost matrix N DM_setCostMat

DM_ClusSettings

These methods act on a value of type DM_ClusSettings. This value holds the settings for a Clustering training run.

Use these methods after you have created the logical data specification as a value of type DM_LogicalDataSpec, and before you build the Clustering mining task.

With these methods, you can specify general Clustering settings, similarity matrices, and field-specific settings.

Specifying general Clustering settings

Table 35. Methods for type DM_ClusSettings: Specifying general Clustering settings
Method Purpose SQL/MM method See:
DM_expClusSettings Exports the settings as a CLOB value N DM_expClusSettings
DM_getClusDataSpec Returns the DM_LogicalDataSpec value defined for a value of DM_ClusSettings Y DM_getClusDataSpec
DM_getDClusPar Gets a parameter that is specific to the Distribution-based Clustering algorithm N DM_getDClusPar
DM_getExecTime Returns the maximum execution time N DM_getExecTime
DM_getMaxNumClus Returns the maximum number of clusters contained in a value of type DM_ClusSettings Y DM_getMaxNumClus
DM_getMinData Returns the specified minimum percentage of data N DM_getMinData
DM_impClusSettings Imports previously exported settings N DM_impClusSettings
DM_setDClusPar Sets different parameters that are specific to the Distribution-based Clustering algorithm N DM_setDClusPar
DM_setExecTime Sets the maximum execution time N DM_setExecTime
DM_setMaxNumClus Specifies the maximum number of clusters for a value of type DM_ClusSettings Y DM_setMaxNumClus
DM_setMinData Sets the minimum percentage of data that must be processed N DM_setMinData
DM_useClusDataSpec Specifies a DM_LogicalDataSpec value for a DM_ClusSettings value Y DM_useClusDataSpec
DM_setFldUsageType Sets the usage type for the specified field or all fields Y DM_setFldUsageType

Specifying similarity matrices

Table 36. Methods for type DM_ClusSettings: Specifying similarity matrices
Method Purpose SQL/MM method See:
DM_addSimMat Adds a similarity matrix to the Clustering settings N DM_addSimMat
DM_getNumSimMat Returns the number of similarity matrices that are specified N DM_getNumSimMat
DM_getSimMatName Returns the name of the similarity matrix at the specified position N DM_getSimMatName
DM_getSimMatSim Returns the column containing the similarity value N DM_getSimMatSim
DM_getSimMatTab Returns the name of the table containing the similarity matrix N DM_getSimMatTab
DM_getSimMatVal1 Returns the column containing the first value in a similarity matrix N DM_getSimMatVal1
DM_getSimMatVal2 Returns the column containing the second value in a similarity matrix N DM_getSimMatVal2
DM_remSimMat Removes a similarity matrix from the Clustering settings N DM_remSimMat

Specifying field-specific settings

Table 37. Methods for type DM_ClusSettings: Specifying field-specific settings
Method Purpose SQL/MM method See:
DM_getDClusFldPar Gets a field parameter that is specific to the Distribution-based Clustering algorithm N DM_getDClusFldPar
DM_getFldOutlTreat Returns the kind of outlier treatment for a field N DM_getFldOutlTreat
DM_getFldSimMat Returns the similarity matrix of a field N DM_getFldSimMat
DM_getFldSimScale Returns the similarity scale of a field Y DM_getFldSimScale
DM_getFldUsageType Returns the field usage type of a field N DM_getFldUsageType
DM_getFldWeight Returns the field weight of a field Y DM_getFldWeight
DM_setDClusFldPar Sets different field parameters that are specific to the Distribution-based Clustering algorithm N DM_setDClusFldPar
DM_setFldOutlTreat Sets the kind of outlier treatment for a field N DM_setFldOutlTreat
DM_setFldSimMat Sets a similarity matrix for a field N DM_setFldSimMat
DM_setFldSimScale Sets the similarity scale for a field Y DM_setFldSimScale
DM_setFldUsageType Sets the usage type for the specified field or all fields N DM_setFldUsageType
DM_setFldWeight Sets the field weight of a field Y DM_setFldWeight

DM_RegSettings

These methods act on a value of type DM_RegSettings. The value holds the settings for a Regression training run.

Use these methods after you have created the logical data specification as a value of type DM_LogicalDataSpec, and before you build the Regression mining task.

With these values, you can specify general Regression settings, the maximum amount of time to be used for model training, and the maximum tolerated Pearson correlation (r2) between the predicted values and their errors.

Specifying general Regression settings

Table 38. Methods for type DM_RegSettings: Specifying general Regression settings
Method Purpose SQL/MM method See:
DM_expRegSettings Exports the current DM_RegSettings object into a CLOB Y DM_expRegSettings
DM_impRegSettings Imports a CLOB representing a DM_RegSettings object Y DM_impRegSettings
DM_useRegDataSpec Specifies a DM_LogicalDataSpec value for a DM_RegSettings value Y DM_useRegDataSpec
DM_getRegDataSpec Returns the DM_LogicalDataSpec value defined for a value of DM_RegSettings Y DM_getRegDataSpec
DM_setExecTime Sets the maximum execution time N DM_setExecTime
DM_getExecTime Returns the maximum execution time N DM_getExecTime
DM_setRegRSquared Sets the maximum tolerated squared Pearson correlation coefficient Y DM_setRegRSquared
DM_getRegRSquared Returns the maximum tolerated squared Pearson correlation coefficient Y DM_getRegRSquared

Specifying field specific settings

Table 39. Methods for type DM_RegSettings: Specifying field specific settings
Method Purpose SQL/MM method See:
DM_setFldUsageType Sets the usage type for the specified field or all fields N DM_setFldUsageType
DM_getFldUsageType Returns the field usage type of a field N DM_getFldUsageType
DM_setRegTarget Defines the target field for regression Y DM_setRegTarget
DM_getRegTarget Returns the target field of regression Y DM_getRegTarget

Methods for all DM_*Settings types

These methods act on values of all settings types. Use these methods to set and query power options, and to export and import settings values.

The setting types are as follows:

Note:
These methods also exist on DM_RegSettings objects, but they have no effect and will be ignored.
Table 40. Methods for all DM_*Settings types
Method Purpose SQL/MM method See:
DM_getPowerOptions Returns the specified power options for the appropriate settings definition N DM_getPowerOptions
DM_setPowerOptions Sets the power options for the appropriate settings definition N DM_setPowerOptions

Mining tasks methods

Values of the mining task type specify tasks for training runs. Task values combine settings values with a representation of the data source.

Use these methods after you have defined the mining data, and after you have specified the appropriate settings for the mining function that you are using. Use these methods before you build and store a mining model.

A general introduction is provided in Defining mining tasks

DM_ClasBldTask

These methods create or act on a value of type DM_ClasBldTask. The value specifies a task for a Classification training run. The value holds the settings for the run, and also a representation of the data source.

Before you use these methods, you must do the following:

  1. Define the mining data (as a value of type DM_MiningData)
  2. Specify the settings for the Classification mining model (as a value of type DM_ClasSettings)

Use these methods before you build and store a Classification mining model.

With these methods, you can specify the settings and input data representation, and retrieve information about them from a value of type DM_ClasBldTask.

Table 41. Methods for type DM_ClasBldTask
Method Purpose SQL/MM method See:
DM_defClasBldTask Defines a DM_ClasBldTask value from a training DM_MiningData value, a validation DM_MiningData value, and a DM_ClasSettings value Y DM_defClasBldTask
DM_expClasTask Exports a task value as a CLOB value N DM_expClasTask
DM_getClasSettings Returns a DM_ClasSettings value representing the settings for a Classification task Y DM_getClasSettings
DM_getClasTrnData Returns a DM_MiningData value representing the training data Y DM_getClasTrnData
DM_getClasValData Returns a DM_MiningData value representing the validation data Y DM_getClasValData
DM_impClasTask Imports a previously exported task value N DM_impClasTask

DM_ClasTestTask

These methods create or act on a value of type DM_ClasTestTask. The value specifies a task for a test run of a Classification model. The value holds the location for the model. Use these methods after you have created a Classification model.

These methods enable you to create the test task, or to retrieve information about the input data or the model to be tested.

Table 42. Methods for type DM_ClasTestTask
Method Purpose SQL/MM method See:
DM_defClasTestTask Defines a DM_ClasTestTask value from a DM_MiningData value and a location of an input model to be tested N DM_defClasTestTask
DM_expClasTestTask Exports a task value as a CLOB value N DM_expClasTestTask
DM_getClasMdlCol Returns the name of the column containing the input model.
Note:
SQL/MM instead has one method DM_getClasTestMdl.
N DM_getClasMdlCol
DM_getClasMdlID Returns the identifier of the input model.
Note:
SQL/MM instead has one method DM_getClasTestMdl.
N DM_getClasMdlID
DM_getClasMdlIDCol Returns the name of the column containing the identifier of the input model.
Note:
SQL/MM instead has one method DM_getClasTestMdl.
N DM_getClasMdlIDCol
DM_getClasMdlTab Returns the source table name containing the input model.
Note:
SQL/MM instead has one method DM_getClasTestMdl.
N DM_getClasMdlTab
DM_getClasTestData Returns the DM_MiningData value N DM_getClasTestData
DM_impClasTestTask Imports a previously exported task value N DM_impClasTestTask

DM_RegTestTask

These methods create or act on a value of type DM_RegTestTask. The value specifies a task for a test run of a Regression model. The value holds the location for the model. Use these methods after you have created a Regression model.

These methods enable you to create the test task, or to retrieve information about the input data or the model to be tested.

Table 43. Methods for type DM_RegTestTask
Method Purpose SQL/MM method See:
DM_defRegTestTask Defines a DM_RegTestTask value out of a DM_MiningData and a location of a DM_RegressionModel to be tested Y DM_defRegTestTask
DM_getRegTestData Returns the DM_MiningData value representing the test data Y DM_getRegTestData
DM_getRegMdlTab Returns the source table name containing the input model.
Note:
SQL/MM instead has one method DM_getRegTestMdl.
N DM_getRegMdlTab
DM_getRegMdlCol Returns the name of the column containing the input model.
Note:
SQL/MM instead has one method DM_getRegTestMdl.
N DM_getRegMdlCol
DM_getRegMdlId Returns the identifier of the input model.
Note:
SQL/MM instead has one method DM_getRegTestMdl.
N DM_getRegMdlID
DM_getRegMdlIdCol Returns the name of the column containing the identifier of the input model.
Note:
SQL/MM instead has one method DM_getRegTestMdl.
N DM_getClasMdlIDCol
DM_expRegTestTask Exports a test task value as a CLOB value N DM_expRegTask
DM_impRegTestTask Imports a previously exported task value N DM_impRegTestTask

DM_ClusBldTask

These methods create or act on a value of type DM_ClusBldTask. The value specifies a task for a Clustering training run. The value holds the settings for the run, and also a representation of the data source.

Before you use these methods, you must do the following:

  1. Define the mining data (as a value of type DM_MiningData)
  2. Specify the settings for a Clustering mining model (as a value of type DM_ClusSettings)

Use these methods before you build and store a Clustering mining model.

With these methods, you can specify the settings and input data representation for a Clustering mining task. You can also use them to retrieve information from a value of type DM_ClusBldTask.

Table 44. Methods for type DM_ClusBldTask
Method Purpose SQL/MM method See:
DM_defClusBldTask Defines a DM_ClusBldTask value from a DM_MiningData value and a DM_ClusSettings value Y DM_defClusBldTask
DM_expClusTask Exports a task value as a CLOB value N DM_expClusTask
DM_getClusSettings Returns a DM_ClusSettings value representing the settings definition for a Clustering task Y DM_getClusSettings
DM_getClusTrnData Returns a DM_MiningData value representing the training data Y DM_getClusTrnData
DM_impClusTask Imports a previously exported task value N DM_impClusTask

DM_RuleBldTask

These methods create or act on a value of type DM_RuleBldTask. The value specifies a task for an Associations training run. The value holds the settings for the run, and also a representation of the data source.

Before you use these methods, you must do the following:

  1. Define the mining data (as a value of type DM_MiningData)
  2. Specify the settings for the Associations mining model (as a value of type DM_RuleSettings)

Use these methods before you build and store an Associations mining model.

With these methods, you can specify the settings and input data representation, and retrieve information about them from a value of type DM_RuleBldTask.

Table 45. Methods for type DM_RuleBldTask
Method Purpose SQL/MM method See:
DM_defRuleBldTask Defines a DM_RuleBldTask value from a DM_MiningData value and a DM_RuleSettings value Y DM_defRuleBldTask
DM_expRuleTask Exports a task value as a CLOB value N DM_expRuleTask
DM_getRuleSettings Returns a DM_RuleSettings value representing the settings for an Associations task Y DM_getRuleSettings
DM_getRuleTrnData Returns a DM_MiningData value representing the training data Y DM_getRuleTrnData
DM_impRuleTask Imports a previously exported task value N DM_impRuleTask

DM_RegBldTask

These methods create or act on a value of type DM_RegBldTask. The value specifies a task for a Regression training run. The value holds the settings for the run, and also a representation of the data source.

Before you use these methods, you must do the following:

  1. Define the mining data (as a value of type DM_MiningData)
  2. Specify the settings for the Regression mining model (as a value of type DM_RegressionModel)

Use these methods before you build and store a Regression mining model.

With these methods, you can specify the settings and input data representation, and retrieve information about them from a value of type DM_RegBldTask.

Table 46. Methods for type DM_RegBldTask
Method Purpose SQL/MM method See:
DM_defRegBldTask Defines a DM_RegBldTask value from a training DM_MiningData value, a validation DM_MiningData value, and a DM_RegSettings value Y DM_defRegBldTask
DM_expRegTask Converts a value of type DM_RegBldTask or DM_RegTestTask to a CLOB value and returns it Y DM_expRegTask
DM_getRegTrnData Returns a DM_MiningData value representing the training data Y DM_getRegTrnData
DM_getRegValData Returns a DM_MiningData value representing the validation data Y DM_getRegValData
DM_getRegSettings Returns a DM_RegSettings value representing the settings of a classification task Y DM_getRegSettings
DM_impRegTask Converts a CLOB value to a value of type DM_RegBldTask Y DM_impRegTask

Methods for all DM_*Task types

These methods act on values of all task types. Use these methods to import or export task information, and to define sources for error and progress information.

The task types are as follows:

Table 47. Methods for all DM_*Task types
Method Purpose SQL/MM method See:
DM_getErrorTab Returns the specified error table N DM_getErrorTab
DM_getProgTab Returns the specified progress table N DM_getProgTab
DM_setErrorTab Sets the error table to be used N DM_setErrorTab
DM_setProgTab Sets the progress table to be used N DM_setProgTab

Stored procedures for building mining models

You use stored procedures to build mining models from specified mining tasks and to store the models in specified database tables. Use these procedures after you have specified mining tasks.

For a general description refer to Building and storing mining models.

Table 48. Procedures for building mining models
Procedure Purpose See:
DM_buildRuleModel
DM_buildRuleModelCmd
Searches for association rules, and stores a value of type DM_RuleModel in a specified table DM_buildRuleModel,
DM_buildRuleModelCmd
DM_buildClasModel
DM_buildClasModelCmd
Does a Classification training run, and stores a value of type DM_ClasModel in a specified table DM_buildClasModel,
DM_buildClasModelCmd
DM_buildClusModel
DM_buildClusModelCmd
Does a Clustering training run, and stores a value of type DM_ClusteringModel in a specified table DM_buildClusModel,
DM_buildClusModelCmd
DM_buildRegModel
DM_buildRegModelCmd
Does a regression training run and stores a value of type DM_RegressionModel in a specified table DM_buildRegModel,
DM_buildRegModelCmd

Stored procedures for testing mining models

You use stored procedures to test Classification or Regression models. Use these procedures after you have specified a Classification or Regression test task.

Table 49. Procedures for testing mining models
Procedure Purpose See:
DM_testClasModelD
DM_testClasModelT
DM_testClasModelCmdD
DM_testClasModelCmdT
Does a Classification test run DM_testClasModelT (using a test task), DM_testClasModelCmdT , DM_testClasModelD (using mining data), DM_testClasModelCmdD
DM_testRegModelD
DM_testRegModelT
DM_testRegModelCmdD
DM_testRegModelCmdT
Does a Regression test run DM_testRegModelT (using a test task), DM_testRegModelCmdT , DM_testRegModelD (using mining data), DM_testRegModelCmdD

Functions for analyzing mining models and test results

These functions act on values that contain mining models or test results.

A general introduction is provided in Analyzing the model quality.

Functions for analyzing model type DM_RuleModel

Table 50. Functions for type DM_RuleModel
Function Purpose SQL/MM function See:
DM_getMdlQuality Returns a value between 0 and 1 which indicates the model's quality as it has been determined in a preceding validation or test step N DM_getMdlQuality

Functions for analyzing model type DM_ClasModel

Table 51. Functions for type DM_ClasModel
Function Purpose SQL/MM function See:
DM_getConfMatrix Returns a table holding the confusion matrix and cost matrix information contained in a value of type DM_ClasTestResult or DM_ClasModel Y DM_getConfMatrix
DM_getGainsChart Returns a table containing gains chart information from a Classification or Regression model Y DM_getGainsChart
DM_getMdlQuality Returns a value between 0 and 1 which indicates the model's quality as it has been determined in a preceding validation or test step N DM_getMdlQuality
DM_getPredAccuracy Returns a value between 0 and 1 which provides the probability that a prediction of the specified value is correct N DM_getPredAccuracy
DM_getRankQuality Returns the ranking precision of the model (a quality measure indicating how good the model is in ordering the test records with respect to the target field value) N DM_getRankQuality
DM_getReliability Returns a value between 0 and 1 which describes how good the model performs when applied to test or validation data (which were not used for training before) compared to the model's performance on the training data N DM_getReliability

Functions for analyzing model type DM_ClusteringModel

Table 52. Functions for type DM_ClusteringModel
Function Purpose SQL/MM function See:
DM_getMdlQuality Returns a value between 0 and 1 which indicates the model's quality as it has been determined in a preceding validation or test step N DM_getMdlQuality

Functions for analyzing model type DM_RegressionModel

Table 53. Functions for type DM_RegressionModel
Function Purpose SQL/MM function See:
DM_getGainsChart Returns a table containing gains chart information from a Classification or Regression model Y DM_getGainsChart
DM_getMdlQuality Returns a value between 0 and 1 which indicates the model's quality as it has been determined in a preceding validation or test step N DM_getMdlQuality
DM_getPredAccuracy Returns a value between 0 and 1 which indicates whether the model produces systematic deviations between predicted values and actual target values. A value of 1 means that the model produces no systematic error, a value of 0 means that the model produces a systematic error as large as that one produced by always predicting the mean target field value. N DM_getPredAccuracy
DM_getRankQuality Returns a value between 0 and 1 which corresponds to the ratio between the area under this model's gains chart curve and the area under the best possible gains chart curve (for given test or validation data) N DM_getRankQuality
DM_getRegRSquared Returns the squared Pearson correlation coefficient contained in a value of type DM_RegressionModel Y DM_getRegRSquared
DM_getReliability Returns a value between 0 and 1 which describes how good the model performs when applied to test or validation data (which were not used for training before) compared to the model's performance on the training data N DM_getReliability
DM_getRMSE Returns the root mean squared error (calculated from actual versus predicted target field values of the validation data) N DM_getRMSE

Functions for analyzing test results

Use these functions after you have done a test run on a Classification or Regression model.

Functions for type DM_ClasTestResult

These functions act on a value of type DM_ClasTestResult. The value holds the result of a Classification test run.

Use these functions to access the results of the test run, or to transform the test result to a CLOB value.

Table 54. Functions for type DM_ClasTestResult
Function Purpose SQL/MM function See:
DM_getGainsChart Returns a table containing gains chart information from a Classification or Regression model Y DM_getGainsChart
DM_getMdlQuality Returns a value between 0 and 1 which indicates the model's quality as it has been determined in a preceding validation or test step N DM_getMdlQuality
DM_getPredAccuracy Returns a value between 0 and 1 which provides the probability that a prediction of the specified value is correct N DM_getPredAccuracy
DM_getRankQuality Returns the ranking precision of the model (a quality measure indicating how good the model is in ordering the test records with respect to the target field value) N DM_getRankQuality
DM_getReliability Returns the reliability (or robustness) of the model (a quality number indicating how well the model performs on non-training data compared to training data) N DM_getReliability

Functions for type DM_RegTestResult

These functions act on a value of type DM_RegTestResult. The value holds the result of a Regression test run.

Use these functions to access the results of the test run, or to transform the test result to a CLOB value.

Table 55. Functions for type DM_RegTestResult
Function Purpose SQL/MM function See:
DM_getGainsChart Returns a table containing gains chart information from a Classification or Regression model Y DM_getGainsChart
DM_getMdlQuality Returns a value between 0 and 1 which indicates the model's quality as it has been determined in a preceding validation or test step N DM_getMdlQuality
DM_getPredAccuracy Returns a value between 0 and 1 which indicates whether the model produces systematic deviations between predicted values and actual target values. A value of 1 means that the model produces no systematic error, a value of 0 means that the model produces a systematic error as large as that one produced by always predicting the mean target field value. N DM_getPredAccuracy
DM_getRankQuality Returns the ranking precision of the model (a quality measure indicating how good the model is in ordering the test records with respect to the target field value) N DM_getRankQuality
DM_getReliability Returns the reliability (or robustness) of the model (a quality number indicating how well the model performs on non-training data compared to training data) N DM_getReliability
DM_getRMSE Returns the root mean squared error (calculated from actual versus predicted target field values of the test data) Y DM_getRMSE

Functions for working with mining models

These functions act on values that contain mining models.

Use these functions to access a mining model as a character large object data type for further processing, and to retrieve information about mining models.

Functions for working with model type DM_RuleModel

Table 56. Functions for type DM_RuleModel
Function Purpose SQL/MM function See:
DM_expRuleModel Returns a character large object representation of a value of type DM_RuleModel Y DM_expRuleModel
DM_getCorrelations Returns a table containing the correlations between fields with respect to a data mining model Y DM_getCorrelations
DM_getFields Returns a table that contains the signature of a model Y DM_getFields
DM_getNumRules Returns the number of rules contained in a value of type DM_RuleModel Y DM_getNumRules
DM_getNumTransacts Returns the number of transactions contained in the dataset used to build the model of type DM_RuleModel Y DM_getNumTransacts
DM_getRuleBodies Returns a table containing the bodies of rules in a value of type DM_RuleModel Y DM_getRuleBodies
DM_getRuleMdlName Gets the name of the rule model N DM_getRuleMdlName
DM_getRules Returns a table containing the rules in a value of type DM_RuleModel Y DM_getRules
DM_getRuleTask Returns the DM_RuleBldTask value used to create the association rules Y DM_getRuleTask

Functions for working with model type DM_ClasModel

Table 57. Functions for type DM_ClasModel
Function Purpose SQL/MM function See:
DM_expClasModel Returns a character large object representation of a value of type DM_ClasModel Y DM_expClasModel
DM_getClasCostRate Returns the cost rate contained in a value of type DM_ClasModel Y DM_getClasCostRate
DM_getClasError Returns the Classification error value contained in a DM_ClasTestResult value Y DM_getClasCostRate
DM_getClasMdlName Gets the name of the Classification model N DM_getClasMdlName
DM_getClasTarget Returns the target field contained in a value of type DM_ClasModel Y DM_getClasTarget
DM_getClasTask Returns the DM_ClasBldTask value used to create the model Y DM_getClasTask
DM_getConfMatrix Returns the confusion matrix and cost matrix information contained in a value of type DM_ClasTestResult or DM_ClasModel Y DM_getConfMatrix
DM_getCorrelations Returns a table containing the correlations between fields with respect to a data mining model Y DM_getCorrelations
DM_getFields Returns a table that contains the signature of a model Y DM_getFields
DM_getTreeRules Returns a table that contains one record for each node of a Tree Classification model Y DM_getTreeRules
DM_isValidated Indicates if validation data is used during the training phase Y DM_isValidated

Functions for working with model type DM_ClusteringModel

Table 58. Functions for type DM_ClusteringModel
Function Purpose SQL/MM function See:
DM_expClusModel Returns a character large object representation of a value of type DM_ClusteringModel Y DM_expClusModel
DM_getClusMdlName Gets the name of the Clustering model N DM_getClusMdlName
DM_getClusTask Returns the DM_ClusBldTask value used to create the model Y DM_getClusTask
DM_getClusters Returns a table that contains the clusters of a Clustering model Y DM_getClusters
DM_getCorrelations Returns a table containing the correlations between fields with respect to a data mining model Y DM_getCorrelations
DM_getFields Returns a table that contains the signature of a model Y DM_getFields
DM_getNumClusters Returns the number of clusters contained in a value of type DM_ClusteringModel Y DM_getNumClusters

Functions for working with model type DM_RegressionModel

Table 59. Functions for type DM_RegressionModel
Function Purpose SQL/MM function See:
DM_expRegModel Returns a character large object representation of a value of type DM_RegressionModel Y DM_expRegModel
DM_getCorrelations Returns a table containing the correlations between fields with respect to a data mining model Y DM_getFields
DM_getFields Returns a table that contains the signature of a model Y DM_getFields
DM_getRegRSquared Returns the squared Pearson correlation coefficient of the Regression model computed during the training phase using the validation data specified in the DM_RegBldTask value used to generate the model Y DM_getRegRSquared
DM_getRegTarget Returns the name of the target field used when training the Regression model Y DM_getRegTarget
DM_getRegTask Returns the DM_RegBldTask value used to create this model Y DM_getRegTask
DM_getRegMdlName Gets the name of the regression model. For more information refer to Intelligent Miner Scoring: Administration and Programming for DB2. N DM_getRegMdlName
DM_isValidated Indicates if validation data is used during the training phase Y DM_isValidated

Functions for working with test results

Use these functions after you have done a test run on a Classification or Regression model.

Functions for type DM_ClasTestResult

These functions act on a value of type DM_ClasTestResult. The value holds the result of a Classification test run.

Use these functions to access the results of the test run, or to transform the test result to a CLOB value.

Table 60. Functions for type DM_ClasTestResult
Function Purpose SQL/MM function See:
DM_expClasTestRes Returns a character large object representation of a value of type DM_ClasTestResult N DM_expClasTestRes
DM_getClasError Returns the Classification error value contained in the DM_ClasTestResult value Y DM_getClasError
DM_getConfMatrix Returns a table holding the confusion matrix and cost matrix information contained in a value of type DM_ClasTestResult or DM_ClasModel Y DM_getConfMatrix

Functions for type DM_RegTestResult

These functions act on a value of type DM_RegTestResult. The value holds the result of a Regression test run.

Use these functions to access the results of the test run, or to transform the test result to a CLOB value.

Table 61. Functions for type DM_RegTestResult
Function Purpose SQL/MM function See:
DM_expRegTestRes Returns a character large object representation of a value of type DM_ClasTestResult N DM_expRegTestRes
DM_getPredError Returns the prediction error value contained in the DM_RegTestResult value Y DM_getPredError

Stored procedures used for administrative and informational tasks

Use these stored procedures to do administrative tasks connected with training runs, and to retrieve column information about source data tables.

Table 62. Stored procedures for administrative and informational tasks
Procedure Purpose See:
DM_cancelTask Cancels a mining run. See Canceling mining runs. DM_cancelTask
DM_getEnv Gets the environment variables that were set for a process. See Setting environment variables (for error and trace). DM_getEnv
DM_getErrors Retrieves complete error messages. DM_getErrors(rowcount)
DM_getMiningData Returns the column names and column types of the specified table in an XML format. DM_getMiningData
DM_setEnv Sets environment variables for a process. See Setting environment variables (for error and trace). DM_setEnv

Naming conventions and parameter sizes

This chapter contains descriptions of the following:

Full descriptions of all the database objects supplied with IM Modeling appear in the chapters that follow.

Naming conventions

Conventions for parameters
Special conventions are defined for some input parameters to methods, functions, or stored procedures.
Table names
The following rules exist when you specify a table name to a method, function, or stored procedure:
Note:
If you specify table names that do not conform to the naming conventions, an error condition occurs.

Parameter sizes

The sizes of the input and output parameters of the methods, functions, and procedures are as follows:

Default sizes:
For more information refer to The idmenabledb command.

Methods reference

This chapter contains full descriptions of all the methods provided with IM Modeling. They are presented in alphabetical order of the method names. For a listing in the order of the data types that they act on, see Overview of IM Modeling's database objects.

For instructions on how to use the database objects presented here, see Using IM Modeling.

DM_addConItem

This method adds an item to the list of item constraints contained in a DM_RuleSettings value. If a constraint type has not been set already, it is set to the default constraint type 'inclusive'.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-ruleSettings..DM_addConItem--(--item--)---------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_addConItem--(--ruleSettings--,--item--)------------------><

Parameters

ruleSettings
A value of type DM_RuleSettings
item
A value of type VARCHAR

Return value

Related concepts

Rule length and item constraints

Usage

Setting item constraints

DM_addDataSpecFld

This method adds a field with the specified name to a value of type DM_LogicalDataSpec.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_addDataSpecFld--(--fieldName--)------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_addDataSpecFld--(--fields--,--fieldName--)---------------><

Parameters

fields
A value of type DM_LogicalDataSpec
fieldName
The name of the new field you want to add, of type VARCHAR

Return value

Usage

DM_addNmp

This method adds a name mapping to a value of type DM_LogicalDataSpec. The name mapping is defined by a reference to a table and to two columns, one containing the original data value and the other the mapped name.

The table is not read when this method is called. Reading the table and checking whether it exists happen during the training run.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_addNmp--(--name--,--tableName--,--dataValueCol--,--mappedValueCol--)-><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_addNmp--(--fields--,--name--,--tableName--,--dataValueCol--,--mappedValueCol--)-><

Parameters

fields
A value of type DM_LogicalDataSpec
name
The name of the name mapping, of type VARCHAR
tableName
The name of the table that contains the name mapping, of type VARCHAR
dataValueCol
The column that contains possible data values, of type VARCHAR
mappedValueCol
The column that contains the mapped names, of type VARCHAR

Return value

Related concepts

Name mappings

Usage

Defining a name mapping in the logical data specification

DM_addSimMat

This method defines a similarity matrix for a DM_ClusSettings value. The similarity matrix is a reference to a table. The table contains the similarity definitions to be used for the training runs. The table is not read when this method is called. Reading the table and checking whether the table exists happen during the run time of the training run.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusSettings..DM_addSimMat--(--simMatrixName--,--tableName--,--colNameValue1--,-->

>--colNameValue2--,--colNameSimilarity--)----------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_addSimMat--(--clusSettings--,--simMatrixName--,--tableName--,--colNameValue1--,-->

>--colNameValue2--,--colNameSimilarity--)----------------------><

Parameters

clusSettings
A value of type DM_ClusSettings
simMatrixName
A value of type VARCHAR
tableName
A value of type VARCHAR
colNameValue1
A value of type VARCHAR
colNameValue2
A value of type VARCHAR
colNameSimilarity
A value of type VARCHAR

Return value

DM_addTax

This method adds a taxonomy to a value of type DM_LogicalDataSpec.

A taxonomy consists of a name and at least one category map. The first category is specified with this method. A category map consists of a reference to a table and to two columns containing child and parent values. It can optionally contain a name mapping for the parent values, and a type value that specifies whether the category map is recursive or non-recursive.

The table is not read when this method is called. Reading the table and checking whether it exists happen during the training run.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_addTax--(--name--,--tabName--,--childCol--,--parentCol--,-->

>--parentNameMap--,--mapType--)--------------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_addTax--(--fields--,--name--,--tabName--,--childCol--,--parentCol--,-->

>--parentNameMap--,--mapType--)--------------------------------><

Parameters

fields
A value of type DM_LogicalDataSpec
name
The name of the taxonomy, of type VARCHAR
tabName
The fully qualified name of the table containing the category map, of type VARCHAR
childCol
The name of the column containing the child values of the category map, of type VARCHAR
parentCol
The name of the column containing the parent values of the category map, of type VARCHAR
parentNameMap
The name of the name mapping for the parent values, of type VARCHAR, or NULL. If a name mapping is specified, it must already exist in the DM_LogicalDataSpec value.
mapType
The type of the category map as an INTEGER value.

Possible values are:

0
Non-recursive
1
Recursive

Return value

Related concepts

Taxonomies

Usage

Defining a taxonomy in the logical data specification

DM_addTaxMap

This method adds a category map to an existing taxonomy in a value of type DM_LogicalDataSpec.

The category map consists of a reference to a table and to two column names containing the child and parent values of the category map. It can optionally contain a name mapping for the parent values, and a type value that specifies whether the category map is recursive or non-recursive.

The table is not read when this method is called. Reading the table and checking whether it exists happen during the training run.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_addTaxMap--(--name--,--tabName--,--childCol--,--parentCol--,-->

>--parentNameMap--,--mapType--)--------------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_addTaxMap--(--fields--,--name--,--tabName--,--childCol--,--parentCol--,-->

>--parentNameMap--,--mapType--)--------------------------------><

Parameters

fields
A value of type DM_LogicalDataSpec
name
The name of the taxonomy, of type VARCHAR
tabName
The fully qualified name of the table containing the category map, of type VARCHAR
childCol
The name of the column containing the child values of the category map, of type VARCHAR
parentCol
The name of the column containing the parent values of the category map, of type VARCHAR
nameMap
The name (as type VARCHAR) of the name mapping for the parent values, or NULL. If a name mapping is specified, it must already exist in the DM_LogicalDataSpec value.
mapType
The type of the category map as an INTEGER value.

Possible values are:

0
Non-recursive
1
Recursive

Return value

Related concepts

Category maps

Usage

Adding and removing category maps

DM_defClasBldTask

This method returns a DM_ClasBldTask value determined by the given DM_MiningData values for training and validation, and the given DM_ClasSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-DM_ClasBldTask()..DM_defClasBldTask--(--trainData--,--validationData--,--clasSettings--)-><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_defClasBldTask--(--DM_ClasBldTask()--,--trainData--,--validationData--,--clasSettings--)-><

Parameters

trainData
A value of type DM_MiningData containing the input source table definitions used for a Classification training run
validationData
A value of type DM_MiningData containing the input source table definitions used for a Classification test run
clasSettings
A value of type DM_ClasSettings containing the Classification settings

Return value

The DM_defClasBldTask method constructs a value of type DM_ClasBldTask with the given DM_MiningData and DM_ClasSettings values. If DM_defClasBldTask is called on an existing DM_ClasBldTask value, content is overwritten.

DM_defClasTestTask

This method returns a DM_ClasTestTask value. The value is determined by the DM_MiningData value specified for the test, and a database location of the input model to be used for validation.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clasTestTask..DM_defClasTestTask--(--miningData--,--tableName--,--colNameModel--,-->

>--colNameID--,--modelName--)----------------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_defClasTestTask--(--clasTestTask--,--miningData--,--tableName--,--colNameModel--,-->

>--colNameID--,--modelName--)----------------------------------><

Parameters

clasTestTask
A value of type DM_ClasTestTask
miningData
A value of type DM_MiningData
tableName
A value of type VARCHAR specifying the fully qualified name of a table that consists of at least two columns. One column is of the type DM_ClasModel, and another is of the categorical type.
colNameModel
A value of type VARCHAR specifying the column that contains the model. The column must be of the DM_ClasModel data type.
colNameID
A value of type VARCHAR specifying the column that contains the ID or name of the model. The column must be of the categorical data type.
modelName
A value of type VARCHAR specifying the ID or name of the model. This value is used to identify the row in the specified table.

Return value

The DM_defClasTestTask method constructs a value of type DM_ClasTestTask with the given DM_MiningData and the database location of the input model. If DM_defClasTestTask is called on an existing DM_ClasTestTask value, content is overwritten.

DM_defClusBldTask

This method returns the DM_ClusBldTask value determined by both a specified DM_MiningData value and a specified DM_ClusSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-DM_ClusBldTask()..DM_defClusBldTask--(--trainData--,--settings--)-><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_defClusBldTask--(--DM_ClusBldTask()--,--trainData--,--settings--)-><

Parameters

trainData
A value of type DM_MiningData containing the input source table definitions used for a Clustering training run
settings
A value of type DM_ClusSettings containing the parameter settings

Return value

The DM_defClusBldTask method constructs a value of type DM_ClusBldTask with the given DM_MiningData and DM_ClusSettings values. If DM_defClusBldTask is called on an existing DM_ClusBldTask value, content is overwritten.

DM_defMiningData

This method creates a DM_MiningData value consisting of the name of the source table and column information. The source table must be a base table, a view, or a nickname.

Note:
This method automatically retrieves the column information of the given source table. That is why the definition of the DM_getMiningData stored procedure and the DM_setColumns method is no longer required.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-DM_MiningData()..DM_defMiningData--(--sourceTableName--)----><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_defMiningData--(--DM_MiningData()--,--sourceTableName--)-><

Parameters

sourceTableName
The name of a base table, a view, or a nickname, as type VARCHAR

Return value

DM_defRegBldTask

This method returns a DM_RegBldTask value determined by both, the given DM_MiningData values for training and validation, and the given DM_RegSettings value. If valiData is NULL, the kernel determines internally which part to use from the training data as validation data.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-DM_RegBldTask()..DM_defRegBldTask--(--trainData--,--valiData--,--settings--)-><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_defRegBldTask--(--DM_RegBldTask()--,--trainData--,--valiData--,--settings--)-><

Parameters

trainData
A value of type DM_MiningData containing the input source table definitions used for a Regression training run as training data
valiData
A value of type DM_MiningData containing the input source table definitions used for a Regression training run as validation data
settings
A value of type DM_RegSettings containing the parameter settings

Return value

The DM_defRegBldTask method constructs a value of type DM_RegBldTask with the given DM_MiningData and DM_RegSettings values. If DM_defRegBldTask is called on an existing DM_RegBldTask value, its content is overwritten.

DM_defRegTestTask

This method defines a complete task for a test run for regression. Specify mining data and the input model to be used by the mining run to test the model.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-regTestTask..DM_defRegTestTask--(--miningData--,--tableName--,-->

>--colNameModel--,--colNameID--,--modelName--)-----------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_defRegBldTask--(--regTestTask--,--miningData--,--tableName--,-->

>--colNameModel--,--colNameID--,--modelName--)-----------------><

Parameters

regTestTask
A value of type DM_RegTestTask
miningData
A value of type DM_MiningData
tableName
A value of type VARCHAR
colNameModel
A value of type VARCHAR
colNameID
A value of type VARCHAR
modelName
A value of type VARCHAR

Return value

The DM_defRegTestTask method constructs a value of type DM_RegTestTask with the given DM_MiningData and the database location of the input model. If DM_defRegTestTask is called on an existing DM_RegTestTask value, content is overwritten.

DM_defRuleBldTask

This method returns a DM_RuleBldTask value determined by both a specified DM_MiningData value and a specified DM_RuleSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-DM_RuleBldTask()..DM_defRuleBldTask--(--trainData--,--settings--)-><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_defRuleBldTask--(--DM_RuleBldTask()--,--trainData--,--settings--)-><

Parameters

trainData
A value of type DM_MiningData containing the input source table definitions used for an Associations training run
settings
A value of type DM_RuleSettings containing the parameter settings

Return value

The DM_defRuleBldTask method constructs a value of type DM_RuleBldTask with the given DM_MiningData and DM_RuleSettings values. If DM_defRuleBldTask is called on an existing DM_RuleBldTask value, content is overwritten.

DM_expClasSettings

This method converts a value of type DM_ClasSettings to a CLOB value, and returns it. Export functions are helpful when you want to store values in an external media, for example, as a backup.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-settings..DM_expClasSettings--(--)--------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_expClasSettings--(--settings--)--------------------------><

Parameters

settings
A value of type DM_ClasSettings

Return value

The return value is a CLOB value converted from settings.

Examples

Exporting mining models

DM_expClasTask

This method converts a value of type DM_ClasBldTask to a CLOB value, and returns it. Use this method if you want to pass the value as a CLOB value to a stored procedure.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-task..DM_expClasTask--(--)----------------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_expClasTask--(--task--)----------------------------------><

Parameters

task
A value of type DM_ClasBldTask

Return value

The return value is a CLOB value converted from task.

DM_expClasTestTask

This method converts a value of type DM_ClasTestTask to a CLOB value, and returns it. Use this method if you want to pass the value as a CLOB value to a stored procedure.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-task..DM_expClasTestTask--(--)------------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_expClasTestTask--(--task--)------------------------------><

Parameters

task
A value of type DM_ClasTestTask

Return value

The return value is a CLOB value converted from task.

Usage

Executing a test run on the test task

DM_expClusSettings

This method converts a value of type DM_ClusSettings to a CLOB value, and returns it. Export functions are helpful when you want to store values in an external media, for example, as a backup.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-settings..DM_expClusSettings--(--)--------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_expClusSettings--(--settings--)--------------------------><

Parameters

settings
A value of type DM_ClusSettings

Return value

The return value is a CLOB value converted from settings.

Examples

Exporting mining models

DM_expClusTask

This method converts a value of type DM_ClusBldTask to a CLOB value, and returns it. Use this method if you want to pass the value as a CLOB value to a stored procedure.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-task..DM_expClusTask--(--)----------------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_expClusTask--(--task--)----------------------------------><

Parameters

task
A value of type DM_ClusBldTask

Return value

The return value is a CLOB value converted from task.

DM_expDataSpec

This method converts a value of type DM_LogicalDataSpec to a CLOB value, and returns it. Export functions are helpful when you want to store values in an external media, for example, as a backup.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_expDataSpec--(--)--------------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_expDataSpec--(--fields--)--------------------------------><

Parameters

fields
A value of type DM_LogicalDataSpec

Return value

The return value is a CLOB value converted from fields.

DM_expMiningData

This method exports the DM_MiningData value as a CLOB value. Use this method if you want to pass the value as a CLOB value to a stored procedure.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-miningData..DM_expMiningData--(--)--------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_expMiningData--(--miningData--)--------------------------><

Parameters

miningData
A value of type DM_MiningData

Return value

The return value is the content of the DM_MiningData value as a CLOB value.

DM_expRegSettings

This method exports the DM_RegSettings value as a CLOB value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-regSettings..DM_expRegSettings--(--)------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_expRegSettings--(--regSettings--)------------------------><

Parameters

regSettings
A value of type DM_RegSettings

Return value

The content of DM_RegSettings value is returned as a CLOB value.

DM_expRegTask

This method converts a value of type DM_RegBldTask or DM_RegTestTask to a CLOB value and returns it.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-task..DM_expRegTask--(--)-----------------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_expRegTask--(--task--)-----------------------------------><

Parameters

task
A value of type DM_RegBldTask or DM_RegTestTask

Return value

A CLOB value converted from task is returned.

DM_expRegTestTask

This method converts a value of type DM_RegTestTask to a CLOB value, and returns it. Use this method if you want to pass the value as a CLOB value to a stored procedure.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-task..DM_expRegTestTask--(--)-------------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_expRegTestTask--(--task--)-------------------------------><

Parameters

task
A value of type DM_RegTestTask

Return value

The return value is a CLOB value converted from task.

DM_expRuleSettings

This method converts a value of type DM_RuleSettings to a CLOB value, and returns it. Export functions are helpful when you want to store values in an external media, for example, as a backup.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-settings..DM_expRuleSettings--(--)--------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_expRuleSettings--(--settings--)--------------------------><

Parameters

settings
A value of type DM_RuleSettings

Return value

The return value is a CLOB value converted from settings.

DM_expRuleTask

This method converts a value of type DM_RuleBldTask to a CLOB value, and returns it. Use this method if you want to pass the value as a CLOB value to a stored procedure.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-task..DM_expRuleTask--(--)----------------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_expRuleTask--(--task--)----------------------------------><

Parameters

task
A value of type DM_RuleBldTask

Return value

The return value is a CLOB value converted from task.

DM_genDataSpec

This method generates a value of type DM_LogicalDataSpec from the field definitions contained in a value of DM_MiningData.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-miningData..DM_genDataSpec--(--)----------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_genDataSpec--(--miningData--)----------------------------><

Parameters

miningData
A value of type DM_MiningData already containing field definitions

Return value

Usage

Deriving a logical data specification from a mining data value

DM_getClasCost

This method returns the cost of predicting a specific class label value for a specific actual class label value. Repeated calls of this method can be used to retrieve a cost matrix from a classification settings value.

Notes:
  1. This method does not retrieve values from an external cost matrix specified via DM_setCostMat.
  2. You must not combine the following methods: DM_getClasCost and DM_setCostMat. If DM_ClasSettings was created using DM_setCostMat, you cannot use DM_getClasCost to retrieve a cost matrix from the classification settings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clasSettings..DM_getClasCost--(--actualClass--,--predictedClass--)-><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClasCost--(--clasSettings--,--actualClass--,--predictedClass--)-><

Parameters

clasSettings
A value of type DM_ClasSettings
actualClass
Is a CHARACTER VARYING(256) value
predictedClass
Is a CHARACTER VARYING(256) value

Return value

The result of the invocation DM_getClasCost (actualClass, predictedClass) is determined as follows:

Examples

An example:

CREATE METHOD DM_getClasCost
	(actualClass CHARACTER VARYING (256)
   predictedClass CHARACTER VARYING(256))
	RETURNS DOUBLE PRECISION
	FOR DM_ClasSettings
	BEGIN
		--
		--
	END

Another example: The following example first creates the DM_ClasSettings object (TreClaHrtCM) and stores it in IDMMX.ClasSettings. Later on DM_getClasCost is called on this persistent object.

INSERT INTO  IDMMX.ClasSettings (ID, SETTINGS)
WITH  MyData (MyDataCol) AS (VALUES(
IDMMX.DM_MiningData()
..DM_defMiningData('HEART')
))
SELECT 'TreClaHrtCM',
IDMMX.DM_ClasSettings()
..DM_useClasDataSpec(MyDataCol
..DM_genDataSpec()
)
..DM_setClasTarget('DISEASED')
..DM_setClasCost('2', '1', 5.0)
FROM MyData;

WITH MySettings (MySettingsCol) AS 
(SELECT SETTINGS FROM IDMMX.ClasSettings where ID='TreClaHrtCM')

SELECT 
MySettingsCol..DM_getClasCost('2', '1')
FROM MySettings;

DM_getClasCostRate

This method returns the cost rate defined in a DM_ClasSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clasSettings..DM_getClasCostRate--(--clasSettings--)--------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClasCostRate--(--clasSettings--)----------------------><

Parameters

clasSettings
A value of type DM_ClasSettings

Return value

DM_getClasDataSpec

This method returns the logical data specification defined for a DM_ClasSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clasSettings..DM_getClasDataSpec--(--)----------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClasDataSpec--(--clasSettings--)----------------------><

Parameters

clasSettings
A value of type DM_ClasSettings

Return value

DM_getClasMdlCol

This method returns the model column name defined in a DM_ClasTestTask value. The column must be of the type DM_ClasModel; it contains a Classification model that you want to validate in a test run.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clasTestTask..DM_getClasMdlCol--(--)------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClasMdlCol--(--clasTestTask--)------------------------><

Parameters

clasTestTask
A value of type DM_ClasTestTask

Return value

DM_getClasMdlID

This method returns the model name defined in a DM_ClasTestTask value. The model name is used to identify in a table the Classification model that you want to validate in a test run. The name refers to the modelName value found in the modelId column in the table containing the model.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clasTestTask..DM_getClasMdlID--(--)-------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClasMdlID--(--clasTestTask--)-------------------------><

Parameters

clasTestTask
A value of type DM_ClasTestTask

Return value

DM_getClasMdlIDCol

This method returns the column name containing the name of a Classification model defined in a DM_ClasTestTask value. The column name, together with the model name, is used to identify in a table the Classification model that you want to validate in a test run.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clasTestTask..DM_getClasMdlIDCol--(--)----------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClasMdlIDCol--(--clasTestTask--)----------------------><

Parameters

clasTestTask
A value of type DM_ClasTestTask

Return value

DM_getClasMdlTab

This method returns the name of the table defined in a DM_ClasTestTask value. The table contains the Classification model that is validated in a Classification test run.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clasTestTask..DM_getClasMdlTab--(--)------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClasMdlTab--(--clasTestTask--)------------------------><

Parameters

clasTestTask
A value of type DM_ClasTestTask

Return value

DM_getClasSettings

This method returns a value of type DM_ClasSettings representing the settings for a DM_ClasBldTask value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clasTask..DM_getClasSettings--(--)--------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClasSettings--(--clasTask--)--------------------------><

Parameters

clasTask
A value of type DM_ClasBldTask

Return value

DM_getClasTarget

This method returns the target field name defined in a DM_ClasSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clasSettings..DM_getClasTarget--(--clasSettings--)----------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClasTarget--(--clasSettings--)------------------------><

Parameters

clasSettings
A value of type DM_ClasSettings

Return value

DM_getClasTestData

This method returns the mining data defined in a DM_ClasTestTask value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clasTestTask..DM_getClasTestData--(--)----------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClasTestData--(--clasTestTask--)----------------------><

Parameters

clasTestTask
A value of type DM_ClasTestTask

Return value

DM_getClasTrnData

This method returns a value of type DM_MiningData representing the training data for a DM_ClasBldTask value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clasTask..DM_getClasTrnData--(--)---------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClasTrnData--(--clasTask--)---------------------------><

Parameters

clasTask
A value of type DM_ClasBldTask

Return value

DM_getClasValData

This method returns a value of type DM_MiningData representing the validation data for a DM_ClasBldTask value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clasTask..DM_getClasValData--(--)---------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClasValData--(--clasTask--)---------------------------><

Parameters

clasTask
A value of type DM_ClasBldTask

Return value

DM_getClusDataSpec

This method returns the DM_LogicalDataSpec value that is defined in a DM_ClusSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusSettings..DM_getClusDataSpec--(--)----------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClusDataSpec--(--clusSettings--)----------------------><

Parameters

clusSettings
A value of type DM_ClusSettings

Return value

DM_getClusSettings

This method returns a value of type DM_ClusSettings representing the settings in a DM_ClusBldTask value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusTask..DM_getClusSettings--(--)--------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClusSettings--(--clusTask--)--------------------------><

Parameters

clusTask
A value of type DM_ClusBldTask

Return value

DM_getClusTrnData

This method returns a value of type DM_MiningData representing the training data in a DM_ClusBldTask value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusTask..DM_getClusTrnData--(--)---------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClusTrnData--(--clusTask--)---------------------------><

Parameters

clusTask
A value of type DM_ClusBldTask

Return value

DM_getColumnName

This method returns the name of a column at a specified position in a value of type DM_MiningData.

Note:
This method is deprecated. Use the table function DM_getFields instead, as described in DM_getFields(miningData).

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-miningData..DM_getColumnName--(--position--)----------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getColumnName--(--miningData--,--position--)-------------><

Parameters

miningData
A value of type DM_MiningData
position
An INTEGER value, ranging from 1 to the number of columns, that specifies the position

Return value

DM_getConItem

This method returns the name of an item at a specified position in the list of item constraints in a DM_RuleSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-ruleSettings..DM_getConItem--(--position--)-----------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getConItem--(--ruleSettings--,--position--)--------------><

Parameters

ruleSettings
A value of type DM_RuleSettings
position
A value of type INTEGER specifying the position of the item, ranging from 1 to the number of items

Return value

Related concepts

Rule length and item constraints

Usage

Setting item constraints

DM_getConType

This method returns the constraint type for mining association rules contained in a DM_RuleSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-ruleSettings..DM_getConType--(--)---------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getConType--(--ruleSettings--)---------------------------><

Parameters

ruleSettings
A value of type DM_RuleSettings

Return value

For information about the possible values that are returned, see DM_setConType.

Related concepts

Rule length and item constraints

Usage

Setting item constraints

DM_getCostMatAV

This method returns the column name for the column containing the actual value of the cost matrix in the DM_ClasSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clasSettings..DM_getCostMatAV--(--)-------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getCostMatAV--(--clasSettings--)-------------------------><

Parameters

clasSettings
A value of type DM_ClasSettings

Return value

DM_getCostMatPV

This method returns the column name for the column containing the predicted value of the cost matrix in a DM_ClasSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clasSettings..DM_getCostMatPV--(--)-------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getCostMatPV--(--clasSettings--)-------------------------><

Parameters

clasSettings
A value of type DM_ClasSettings

Return value

DM_getCostMatTab

This method returns the table name containing the cost matrix in the DM_ClasSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clasSettings..DM_getCostMatTab--(--)------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getCostMatTab--(--clasSettings--)------------------------><

Parameters

clasSettings
A value of type DM_ClasSettings

Return value

DM_getCostMatWGT

This method returns the column name for the column containing the weight value of the cost matrix in a DM_ClasSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clasSettings..DM_getCostMatWGT--(--)------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getCostMatWGT--(--clasSettings--)------------------------><

Parameters

clasSettings
A value of type DM_ClasSettings

Return value

DM_getDClusFldPar

This method gets, from a DM_ClusSettings value, the value of a settings parameter for a specified field that is specific to the Distribution-based Clustering algorithm.

Use the input parameter to the method to specify the particular field from which the settings parameter value is returned.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusSettings..DM_getDClusFldPar--(--fieldname--,--keyword--)-><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getDClusFldPar--(--clusSettings--,--fieldname--,--keyword--)-><

Parameters

clusSettings
A value of type DM_ClusSettings
fieldname
A value of type VARCHAR containing the name of a field
keyword
The name of the settings parameter, as type VARCHAR, for which you want to get the value.

Permitted value for keyword: ValueWeighting.

Return value

DM_getDClusPar

This method gets, from a DM_ClusSettings value, the value of a settings parameter that is specific to the Distribution-based Clustering algorithm.

Use the method's input parameter to specify the particular settings parameter whose value is returned.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusSettings..DM_getDClusPar--(--keyword--)-----------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getDClusPar--(--clusSettings--,--keyword--)--------------><

Parameters

clusSettings
A value of type DM_ClusSettings
keyword
The name of the settings parameter, as type VARCHAR, whose value you want to be returned.

Permitted value for keyword: SimThr.

Return value

DM_getErrorTab

This method returns the name of the error table specified in a task value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-task..DM_getErrorTab--(--)----------------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getErrorTab--(--task--)----------------------------------><

Parameters

task
A value of type:
  • DM_RuleBldTask
  • DM_ClasBldTask
  • DM_ClusBldTask
  • DM_RegBldTask
  • DM_ClasTestTask
  • DM_RegTestTask

Return value

The return value is a value of type VARCHAR.

The return value is determined by checking the following conditions in the given sequence:

DM_getExecTime

This method returns the maximum execution time (in minutes) from a DM_ClusSettings value or a DM_RegSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-settings..DM_getExecTime--(--)------------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getExecTime--(--settings--)------------------------------><

Parameters

settings
A value of type DM_ClusSettings or DM_RegSettings

Return value

DM_getFldAlias

This method returns the alias name of a column in a value of type DM_MiningData.

Note:
This method is deprecated. Use the table function DM_getFields instead, as described in DM_getFields(miningData).

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-miningData..DM_getFldAlias--(--columnName--)----------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getFldAlias--(--miningData--,--columnName--)-------------><

Parameters

miningData
A value of type DM_MiningData
columnName
A VARCHAR value that specifies the physical column name

Return value

DM_getFldName

This method returns the name of a field at a specified position in a value of type DM_LogicalDataSpec.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_getFldName--(--position--)-----------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getFldName--(--fields--,--position--)--------------------><

Parameters

fields
A value of type DM_LogicalDataSpec consisting of a set of fields
position
An INTEGER value, ranging from 1 to the number of fields, that specifies the position

Return value

Usage

Defining field types and properties

DM_getFldNmp

This method returns the name of a name mapping that is linked to a specified field contained in a DM_LogicalDataSpec value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_getFldNmp--(--fieldName--)-----------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getFldNmp--(--fields--,--fieldName--)--------------------><

Parameters

fields
A value of type DM_LogicalDataSpec consisting of a set of fields
fieldName
A field name of type VARCHAR that is already contained in fields

Return value

Related concepts

Name mappings

Usage

Activating a name mapping

DM_getFldOutlLimLo

This method returns the lower limit value of a numerical field contained in a DM_LogicalDataSpec value to be used for outlier treatment.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_getFldOutlLimLo--(--fieldName--)-----------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getFldOutlLimLo--(--fields--,--fieldName--)--------------><

Parameters

fields
A value of type DM_LogicalDataSpec consisting of a set of fields
fieldName
A field name of type VARCHAR that is already contained in fields

Return value

DM_getFldOutlLimUp

This method returns the upper limit value of a numerical field contained in a DM_LogicalDataSpec value to be used for outlier treatment.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_getFldOutlLimUp--(--fieldName--)-----------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getFldOutlLimUp--(--fields--,--fieldName--)--------------><

Parameters

fields
A value of type DM_LogicalDataSpec consisting of a set of fields
fieldName
A field name of type VARCHAR that is already contained in fields

Return value

DM_getFldOutlTreat

This method returns the outlier treatment for a specified field contained in a DM_ClusSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-settings..DM_getFldOutlTreat--(--fieldName--)---------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getFldOutlTreat--(--settings--,--fieldName--)------------><

Parameters

settings
A value of type DM_ClusSettings
fieldName
A value of type VARCHAR

Return value

If an outlier treatment is set for the specified field, the return value is the outlier treatment as type INTEGER. Valid values for outlierTreatment are:

0
Treat outliers as they are
1
Treat outliers as missing values
2
Treat outliers as extreme values

DM_getFldSimMat

This method returns the name of the similarity matrix that is linked to a specified field contained in a DM_ClusSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusSettings..DM_getFldSimMat--(--fieldName--)--------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getFldSimMat--(--clusSettings--,--fieldName--)-----------><

Parameters

clusSettings
A value of type DM_ClusSettings
fieldName
A value of type VARCHAR

Return value

Related concepts

Maximum number of clusters

Usage

Specifying the maximum number of clusters

Defaults

Specifying the maximum number of clusters

DM_getFldSimScale

This method returns the similarity scale for a specified field contained in a DM_ClusSettings value.

Similarity scale is a value that influences the calculation of the similarity measurement.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusSettings..DM_getFldSimScale--(--fieldName--)------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getFldSimScale--(--clusSettings--,--fieldName--)---------><

Parameters

clusSettings
A value of type DM_ClusSettings
fieldName
A value of type VARCHAR

Return value

DM_getFldTax

This method returns the name of a taxonomy that is linked to a specified field contained in a value of type DM_LogicalDataSpec.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_getFldTax--(--fieldName--)-----------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getFldTax--(--fields--,--fieldName--)--------------------><

Parameters

fields
A value of type DM_LogicalDataSpec consisting of a set of fields
fieldName
A field name of type VARCHAR that is already contained in fields

Return value

Related concepts

Taxonomies

Usage

Activating a taxonomy

DM_getFldType

This method returns the mining field type of a specified field that is contained in a value of type DM_LogicalDataSpec.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_getFldType--(--fieldName--)----------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getFldType--(--fields--,--fieldName--)-------------------><

Parameters

fields
A value of type DM_LogicalDataSpec consisting of a set of fields
fieldName
A field name of type VARCHAR that is already contained in fields

Return value

DM_getFldUsageType

This method returns the usage type for a specified field contained in a DM_RuleSettings, DM_ClasSettings, DM_ClusSettings, or DM_RegSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-settings..DM_getFldUsageType--(--fieldName--)---------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getFldUsageType--(--settings--,--fieldName--)------------><

Parameters

settings
A value of type:
  • DM_RuleSettings
  • DM_ClasSettings
  • DM_ClusSettings
  • DM_RegSettings
fieldName
A value of type VARCHAR

Return value

DM_getFldWeight

This method returns the field weight for a specified field contained in a DM_ClusSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusSettings..DM_getFldWeight--(--fieldName--)--------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getFldWeight--(--clusSettings--,--fieldName--)-----------><

Parameters

clusSettings
A value of type DM_ClusSettings
fieldName
A value of type VARCHAR

Return value

DM_getGroup

This method returns the name of the group field defined for a DM_RuleSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-ruleSettings..DM_getGroup--(--)-----------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getGroup--(--ruleSettings--)-----------------------------><

Parameters

ruleSettings
A value of type DM_RuleSettings

Return value

DM_getItemFld

This method returns the name of the field used to identify the items for mining association rules contained in a DM_RuleSettings value.

Note:
This method only returns a field name if exactly one field was explicitly specified as item field. If you have more than one item field use the method DM_getFldUsageType to find out which field is considered in your mining run.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-ruleSettings..DM_getItemFld--(--)---------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getItemFld--(--ruleSettings--)---------------------------><

Parameters

ruleSettings
A value of type DM_RuleSettings

Return value

DM_getItemFormat

This method returns how the item names are built.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-ruleSettings..DM_getItemFormat--(--)------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getItemFormat--(--ruleSettings--)------------------------><

Parameters

ruleSettings
A value of type DM_RuleSettings

Return value

The return value is the active item format as type INTEGER. The default item format is 0. For more information on item format refer to DM_setItemFormat.

DM_getMaxLen

This method returns the maximum rule length from a DM_RuleSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-ruleSettings..DM_getMaxLen--(--)----------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getMaxLen--(--ruleSettings--)----------------------------><

Parameters

ruleSettings
A value of type DM_RuleSettings

Return value

Related concepts

Usage

Specifying maximum rule length

DM_getMaxNumClus

This method returns the maximum number of clusters from the DM_ClusSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusSettings..DM_getMaxNumClus--(--)------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getMaxNumClus--(--clusSettings--)------------------------><

Parameters

clusSettings
A value of type DM_ClusSettings

Return value

DM_getMinConf

This method returns the 'minimum confidence' setting from a DM_RuleSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-ruleSettings..DM_getMinConf--(--)---------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getMinConf--(--ruleSettings--)---------------------------><

Parameters

ruleSettings
A value of type DM_RuleSettings

Return value

Related concepts

Confidence in an association rule

Defaults

Defining minimum confidence

DM_getMinData

This method returns, from a DM_ClusSettings value, the minimum percentage of data that the Clustering training run must read when the execution time is limited.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusSettings..DM_getMinData--(--)---------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getMinData--(--clusSettings--)---------------------------><

Parameters

clusSettings
A value of type DM_ClusSettings

Return value

DM_getMinSupport

This method returns the value of the 'minimum support' setting in a DM_RuleSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-ruleSettings..DM_getMinSupport--(--)------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getMinSupport--(--ruleSettings--)------------------------><

Parameters

ruleSettings
A value of type DM_RuleSettings

Return value

Related concepts

Support in an association rule

Usage

Defining minimum support

DM_getNmpMapValCol

This method returns the name of the column that contains the mapped name in a name mapping that is contained in a DM_LogicalDataSpec value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_getNmpMapValCol--(--nameMapping--)---------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getNmpMapValCol--(--fields--,--nameMapping--)------------><

Parameters

fields
A value of type DM_LogicalDataSpec
nameMapping
The name of the name mapping, of type VARCHAR

Return value

Related concepts

Name mappings

Usage

Retrieving information about a name mapping

DM_getNmpName

This method returns the name of a name mapping in a value of type DM_LogicalDataSpec at the specified position.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_getNmpName--(--position--)-----------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getNmpName--(--fields--,--position--)--------------------><

Parameters

fields
A value of type DM_LogicalDataSpec
position
An INTEGER value, ranging from 1 to the number of name mappings, that specifies the position

Return value

Related concepts

Name mappings

Usage

Retrieving information about a name mapping

DM_getNmpTabName

This method returns the table name of a name mapping in a DM_LogicalDataSpec value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_getNmpTabName--(--nameMapping--)-----------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getNmpTabName--(--fields--,--nameMapping--)--------------><

Parameters

fields
A value of type DM_LogicalDataSpec
nameMapping
The name of the name mapping, of type VARCHAR

Return value

Related concepts

Name mappings

Usage

Retrieving information about a name mapping

DM_getNmpValCol

This method returns the column name of the data value of a name mapping contained in a DM_LogicalDataSpec value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_getNmpValCol--(--nameMapping--)------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getNmpValCol--(--fields--,--nameMapping--)---------------><

Parameters

fields
A value of type DM_LogicalDataSpec
nameMapping
The name of the name mapping, of type VARCHAR

Return value

Related concepts

Name mappings

Usage

Retrieving information about a name mapping

DM_getNumColumns

This method returns the number of columns that are contained in a DM_MiningData value.

Note:
This method is deprecated. Use the table function DM_getFields instead, as described in DM_getFields(miningData).

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-miningData..DM_getNumColumns--(--)--------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getNumColumns--(--miningData--)--------------------------><

Parameters

miningData
A value of type DM_MiningData

Return value

The return value is the number of columns that are contained in miningData, as type INTEGER.

DM_getNumConItem

This method returns the number of items contained in the list of item constrains in the DM_RuleSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-ruleSettings..DM_getNumConItem--(--)------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getNumConItem--(--ruleSettings--)------------------------><

Parameters

ruleSettings
A value of type DM_RuleSettings

Return value

The return value is the number of items contained in the list of item constrains in the DM_RuleSettings value, as type INTEGER.

Related concepts

Rule length and item constraints

Usage

Setting item constraints

DM_getNumFields

This method returns the number of fields that are contained in a value of type DM_LogicalDataSpec.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_getNumFields--(--)-------------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getNumFields--(--fields--)-------------------------------><

Parameters

fields
A value of type DM_LogicalDataSpec consisting of a set of fields

Return value

The return value is the number of fields that are contained in fields, as type INTEGER.

Usage

Defining field types and properties

DM_getNumNmp

This method returns the number of name mappings that are contained in a value of type DM_LogicalDataSpec.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_getNumNmp--(--)----------------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getNumNmp--(--fields--)----------------------------------><

Parameters

fields
A value of type DM_LogicalDataSpec consisting of a set of fields

Return value

The return value is the number of name mappings that are contained in fields, as type INTEGER.

Related concepts

Name mappings

Usage

Retrieving information about a name mapping

DM_getNumSimMat

This method returns the number of similarity matrices contained in a DM_ClusSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusSettings..DM_getNumSimMat--(--)-------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getNumSimMat--(--clusSettings--)-------------------------><

Parameters

clusSettings
A value of type DM_ClusSettings

Return value

The return value is the number of similarity matrices, as an INTEGER value.

DM_getNumTax

This method returns the number of taxonomies that are contained in a value of type DM_LogicalDataSpec.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_getNumTax--(--)----------------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getNumTax--(--fields--)----------------------------------><

Parameters

fields
A value of type DM_LogicalDataSpec consisting of a set of fields

Return value

The return value is the number of taxonomies that are contained in fields, as type INTEGER.

Related concepts

Taxonomies

Usage

Retrieving information about a taxonomy

DM_getNumTaxMap

This method returns the number of category maps that belong to a specified taxonomy contained in a value of type DM_LogicalDataSpec.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-Fields..DM_getNumTaxMap--(--taxName--)----------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getNumTaxMap--(--fields--,--taxName--)-------------------><

Parameters

fields
A value of type DM_LogicalDataSpec consisting of a set of fields
taxName
The name of the taxonomy

Return value

Related concepts

Taxonomies

Usage

Retrieving information about a taxonomy

DM_getPowerOptions

This method returns the power options to be used for a training run.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-settings..DM_getPowerOptions--(--)--------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getPowerOptions--(--settings--)--------------------------><

Parameters

settings
A value of type DM_ClasSettings, DM_ClusSettings, or DM_RuleSettings

Return value

DM_getProgTab

This method returns the name of the progress table specified in a task value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-task..DM_getProgTab--(--)-----------------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getProgTab--(--task--)-----------------------------------><

Parameters

task
A value of type:
  • DM_RuleBldTask
  • DM_ClasBldTask
  • DM_ClusBldTask
  • DM_RegBldTask
  • DM_ClasTestTask
  • DM_RegTestTask

Return value

The return value is a value of type VARCHAR.

The return value is determined by checking the following conditions in the given sequence:

DM_getRegDataSpec

This method returns the logical data specification defined for a DM_RegSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-regSettings..DM_getRegDataSpec--(--)------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getRegDataSpec--(--regSettings--)------------------------><

Parameters

regSettings
A value of type DM_RegSettings

Return value

DM_getRegMdlCol

This method returns the column name of the column containing the input model.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-regTestTask..DM_getRegMdlCol--(--)--------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getRegMdlCol--(--regTestTask--)--------------------------><

Parameters

regTestTask
A value of type DM_RegTestTask

Return value

DM_getRegMdlID

This method returns the model name of the input model. This name refers to the modelName found in the modelId column in the table containing the model.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-regTestTask..DM_getRegMdlID--(--)---------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getRegMdlID--(--regTestTask--)---------------------------><

Parameters

regTestTask
A value of type DM_RegTestTask

Return value

DM_getRegMdlIDCol

This method returns the column name of the column containing the name of the input model.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-regTestTask..DM_getRegMdlIDCol--(--)------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getRegMdlIDCol--(--regTestTask--)------------------------><

Parameters

regTestTask
A value of type DM_RegTestTask

Return value

DM_getRegMdlTab

This method returns the table name of the table where the input model is stored.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-regTestTask..DM_getRegMdlTab--(--)--------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getRegMdlTab--(--regTestTask--)--------------------------><

Parameters

regTestTask
A value of type DM_RegTestTask

Return value

DM_getRegRSquared

This method returns the maximum tolerated squared Pearson correlation coefficient r2 (with 0 <= r2 <= 1) between the prediction error on verification data and the actual target values.

Note:
r2=0 means that the prediction error and the target field values are uncorrelated, r2=1 means that the two values are perfectly (positively or negatively) correlated.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-regSettings..DM_getRegRSquared--(--)------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getRegRSquared--(--regSettings--)------------------------><

Parameters

regSettings
A value of type DM_RegSettings

Return value

DM_getRegSettings

This method returns the value of type DM_RegSettings representing the settings of a regression task.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-regBldTask..DM_getRegSettings--(--)-------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getRegSettings--(--regBldTask--)-------------------------><

Parameters

regBldTask
A value of type DM_RegBldTask

Return value

DM_getRegTarget

This method specifies the target field for a DM_RegSettings value. The target field is the numerical field whose values are to be predicted.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-regSettings..DM_getRegTarget--(--)--------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getRegTarget--(--regSettings--)--------------------------><

Parameters

regSettings
A value of type DM_RegSettings

Return value

DM_getRegTestData

This method returns the mining data defined in the DM_RegTestTask value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-regTestTask..DM_getRegTestData--(--)------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getRegTestData--(--regTestTask--)------------------------><

Parameters

regTestTask
A value of type DM_RegTestTask

Return value

DM_getRegTrnData

This method returns a value of type DM_MiningData representing the training data for the regression build task.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-regBldTask..DM_getRegTrnData--(--)--------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getRegTrnData--(--regBldTask--)--------------------------><

Parameters

regBldTask
A value of type DM_RegBldTask

Return value

DM_getRegValData

This method returns a value of type DM_MiningData representing the validation data for the regression build task.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-regBldTask..DM_getRegValData--(--)--------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getRegValData--(--regBldTask--)--------------------------><

Parameters

regBldTask
A value of type DM_RegValTask

Return value

DM_getRuleDataSpec

This method returns the logical data specification defined for a DM_RuleSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-ruleSettings..DM_getRuleDataSpec--(--)----------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getRuleDataSpec--(--ruleSettings--)----------------------><

Parameters

ruleSettings
A value of type DM_RuleSettings

Return value

DM_getRuleSettings

This method returns a value of type DM_RuleSettings representing the settings for a DM_RuleBldTask value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-ruleTask..DM_getRuleSettings--(--)--------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getRuleSettings--(--ruleTask--)--------------------------><

Parameters

ruleTask
A value of type DM_RuleBldTask

Return value

DM_getRuleTrnData

This method returns a value of type DM_MiningData representing the input data for a DM_RuleBldTask value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-ruleTask..DM_getRuleTrnData--(--)---------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getRuleTrnData--(--ruleTask--)---------------------------><

Parameters

ruleTask
A value of type DM_RuleBldTask

Return value

DM_getSimMatName

This method returns the name of the similarity matrix at a specified position in a DM_ClusSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusSettings..DM_getSimMatName--(--position--)--------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getSimMatName--(--clusSettings--,--position--)-----------><

Parameters

clusSettings
A value of type DM_ClusSettings
position
A value of type INTEGER specifying the position of the similarity matrix to be returned, ranging from 1 to the number of similarity matrices

Return value

DM_getSimMatSim

This method returns the column name for the column containing the similarity value of the similarity matrix for a specified similarity matrix name in a DM_ClusSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusSettings..DM_getSimMatSim--(--simMatrixName--)----------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getSimMatSim--(--clusSettings--,--simMatrixName--)-------><

Parameters

clusSettings
A value of type DM_ClusSettings
simMatrixName
A value of type VARCHAR

Return value

DM_getSimMatTab

This method returns the table name containing a specified similarity matrix in a DM_ClusSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusSettings..DM_getSimMatTab--(--simMatrixName--)----------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getSimMatTab--(--clusSettings--,--simMatrixName--)-------><

Parameters

clusSettings
A value of type DM_ClusSettings
simMatrixName
A value of type VARCHAR

Return value

DM_getSimMatVal1

This method returns the column name for the column containing the first value of the similarity matrix for a specified similarity matrix name in a DM_ClusSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusSettings..DM_getSimMatVal1--(--simMatrixName--)---------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getSimMatVal1--(--clusSettings--,--simMatrixName--)------><

Parameters

clusSettings
A value of type DM_ClusSettings
simMatrixName
A value of type VARCHAR

Return value

DM_getSimMatVal2

This method returns the column name for the column containing the second value of the similarity matrix for a specified similarity matrix name in a DM_ClusSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusSettings..DM_getSimMatVal2--(--simMatrixName--)---------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getSimMatVal2--(--clusSettings--,--simMatrixName--)------><

Parameters

clusSettings
A value of type DM_ClusSettings
simMatrixName
A value of type VARCHAR

Return value

DM_getTableName

This method returns the name of the base table or view, or the nickname specified in a value of type DM_MiningData.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>- miningData..DM_getTableName--(--)--------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getTableName--(--miningData--)---------------------------><

Parameters

miningData
A value of type DM_MiningData

Return value

DM_getTaxChildCol

This method returns the name of the column that contains the child values of a category map in a taxonomy contained in DM_LogicalDataSpec value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_getTaxChildCol--(--taxName--,--position--)-------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getTaxChildCol--(--fields--,--taxName--,--position--)----><

Parameters

fields
A value of type DM_LogicalDataSpec
taxName
The name of the taxonomy, of type VARCHAR
position
The position of the category map within the taxonomy, ranging from 1 to the number of category maps in the taxonomy, as type INTEGER

Return value

Related concepts

Taxonomies

Usage

Retrieving information about a taxonomy

DM_getTaxMapType

This method returns the type of a category map of a taxonomy contained in a DM_LogicalDataSpec value. The type specifies whether the category map is recursive or non-recursive.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_getTaxMapType--(--taxName--,--position--)--------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getTaxMapType--(--fields--,--taxName--,--position--)-----><

Parameters

fields
A value of type DM_LogicalDataSpec
taxName
The name of the taxonomy, of type VARCHAR
position
The position of the category map within the taxonomy, ranging from 1 to the number of category maps in the taxonomy, as type INTEGER

Return value

Related concepts

Taxonomies

Usage

Retrieving information about a taxonomy

DM_getTaxName

This method returns the name of a taxonomy at a specified position in a value of type DM_LogicalDataSpec.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_getTaxName--(--position--)-----------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getTaxName--(--fields--,--position--)--------------------><

Parameters

fields
A value of type DM_LogicalDataSpec
position
An INTEGER value, ranging from 1 to the number of taxonomies, that specifies the position

Return value

Related concepts

Taxonomies

Usage

Retrieving information about a taxonomy

DM_getTaxParentCol

This method returns the name of the column that contains the parent values of a category map in a taxonomy contained in DM_LogicalDataSpec value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_getTaxParentCol--(--taxName--,--position--)------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getTaxParentCol--(--fields--,--taxName--,--position--)---><

Parameters

fields
A value of type DM_LogicalDataSpec
taxName
The name of the taxonomy, of type VARCHAR
position
The position of the category map within the taxonomy, ranging from 1 to the number of category maps in the taxonomy, as type INTEGER

Return value

Related concepts

Taxonomies

Usage

Retrieving information about a taxonomy

DM_getTaxParentNmp

This method returns the name mapping of the parent values of a category map in a taxonomy contained in DM_LogicalDataSpec value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_getTaxParentNmp--(--taxName--,--position--)------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getTaxParentNmp--(--fields--,--taxName--,--position--)---><

Parameters

fields
A value of type DM_LogicalDataSpec
taxName
The name of the taxonomy, of type VARCHAR
position
The position of the category map within the taxonomy, ranging from 1 to the number of category maps in the taxonomy, as type INTEGER

Return value

Related concepts

Taxonomies

Usage

Retrieving information about a taxonomy

DM_getTaxTabName

This method returns the table name of a category map of a taxonomy contained in a DM_LogicalDataSpec value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_getTaxTabName--(--taxName--,--position--)--------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getTaxTabName--(--fields--,--taxName--,--position--)-----><

Parameters

fields
A value of type DM_LogicalDataSpec
taxName
The name of the taxonomy, of type VARCHAR
position
The position of the category map within the taxonomy, ranging from 1 to the number of category maps in the taxonomy, as type INTEGER

Return value

Related concepts

Taxonomies

Usage

Retrieving information about a taxonomy

DM_getTreeClasPar

This method gets the value of a settings parameter that is specific to the Tree Classification algorithm from a DM_ClasSettings value.

Use the method's input parameter to specify the particular settings parameter that the value is returned from.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clasSettings..DM_getTreeClasPar--(--keyword--)--------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getTreeClasPar--(--clasSettings--,--keyword--)-----------><

Parameters

clasSettings
A value of type DM_ClasSettings
keyword
The name of the settings parameter, as type VARCHAR, whose value you want to get.

Permitted values for keyword:

  • MaxPur
  • MaxDth
  • MinRec

For information about the significance of these values, see DM_setTreeClasPar.

Return value

DM_getWhereClause

This method returns the WHERE clause from a value of DM_MiningData.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-miningData..DM_getWhereClause--(--)-------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getWhereClause--(--miningData--)-------------------------><

Parameters

miningData
A value of type DM_MiningData

Return value

DM_impClasSettings

This method converts a CLOB value to a value of type DM_ClasSettings.

The CLOB value must be a value that was previously exported by means of the DM_expClasSettings method.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-settings..DM_impClasSettings--(--clobSettings--)------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_impClasSettings--(--settings--,--clobSettings--)---------><

Parameters

settings
A value of type DM_ClasSettings
clobSettings
A CLOB value containing settings

Return value

DM_impClasTask

This method converts a CLOB value to a value of type DM_ClasBldTask. The CLOB value must be a value that was previously exported using the DM_expClasTask method.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-task..DM_impClasTask--(--clobTask--)------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_impClasTask--(--task--,--clobTask--)---------------------><

Parameters

task
A value of type DM_ClasBldTask
clobTask
A CLOB value containing a task

Return value

DM_impClasTestTask

This method converts a CLOB value to a value of type DM_ClasTestTask. The CLOB value must be a value that was previously exported using the DM_expClasTestTask method.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-task..DM_impClasTestTask--(--clobTask--)--------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_impClasTestTask--(--task--,--clobTask--)-----------------><

Parameters

task
A value of type DM_ClasTestTask
clobTask
A CLOB value containing a task

Return value

DM_impClusSettings

This method converts a CLOB value to a value of type DM_ClusSettings.

The CLOB value must be a value that was previously exported by means of the DM_expClusSettings method.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-settings..DM_impClusSettings--(--clobSettings--)------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_impClusSettings--(--settings--,--clobSettings--)---------><

Parameters

settings
A value of type DM_ClusSettings
clobSettings
A CLOB value containing settings

Return value

DM_impClusTask

This method converts a CLOB value to a value of type DM_ClusBldTask. The CLOB value must be a value that was previously exported using the DM_expClusTask method.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-task..DM_impClusTask--(--clobTask--)------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_impClusTask--(--task--,--clobTask--)---------------------><

Parameters

task
A value of type DM_ClusBldTask
clobTask
A CLOB value containing a task

Return value

DM_impDataSpec

This method converts a CLOB value to a value of type DM_LogicalDataSpec. The CLOB value must be a value that was previously exported using the DM_expDataSpec method.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_impDataSpec--(--logDataSpec--)-------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_impDataSpec--(--fields--,--logDataSpec--)----------------><

Parameters

fields
A value of type DM_LogicalDataSpec
logDataSpec
A CLOB value containing logical data specifications

Return value

The return value is fields containing the content of logDataSpec. Any existing definitions in fields are overwritten by the content of logDataSpec.

DM_impMiningData

This method converts a CLOB value to a value of type DM_MiningData. The CLOB value must be a value that was previously exported by means of the DM_expMiningData method or created by means of the DM_defMiningData method.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-miningData..DM_impMiningData--(--clobMiningData--)----------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_impMiningData--(--miningData--,--clobMiningData--)-------><

Parameters

miningData
A value of type DM_MiningData
clobMiningData
A CLOB value containing mining data

Return value

The return value is miningData, of type DM_MiningData, containing the content of clobMiningData. Any existing definitions in miningData are overwritten by the content of clobMiningData.

DM_impRegSettings

This method converts a CLOB value to a value of type DM_RegSettings. The CLOB value must be a value that was previously exported using the DM_expRegSettings method.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-regSettings..DM_impRegSettings--(--clobRegSettings--)-------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_impRegSettings--(--regSettings--,--clobRegSettings--)----><

Parameters

regSettings
A value of type DM_RegSettings
clobRegSettings
A CLOB value containing regression settings

Return value

This function returns regSettings containing the content of clobRegSettings. Any existing definitions in regSettings are overwritten by the content of clobRegSettings.

DM_impRegTask

This method converts a CLOB value to a value of type DM_RegBldTask.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-regBldTask..DM_impRegTask--(--clobRegBldTask--)-------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_impRegTask--(--regBldTask--,--clobRegBldTask--)----------><

Parameters

regBldTask
A value of type DM_RegBldTask
clobRegBldTask
A CLOB value containing DM_RegBldTask

Return value

regBldtask containing the content of clobRegBldTask. Any existing definitions in regBldtask are overwritten by the content of clobRegBldTask.

DM_impRegTestTask

This method converts a CLOB value to a value of type DM_RegTestTask. The CLOB value must be a value that was previously exported using the DM_impRegTestTask method.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-task..DM_impRegTestTask--(--clobTask--)---------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_impRegTestTask--(--task--,--clobTask--)------------------><

Parameters

task
A value of type DM_RegTestTask
clobTask
A CLOB value containing a task

Return value

DM_impRuleSettings

This method converts a CLOB value to a value of type DM_RuleSettings.

The CLOB value must be a value that was previously exported by means of the DM_expRuleSettings method.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-settings..DM_impRuleSettings--(--clobSettings--)------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_impRuleSettings--(--settings--,--clobSettings--)---------><

Parameters

settings
A value of type DM_RuleSettings
clobSettings
A CLOB value containing settings

Return value

DM_impRuleTask

This method converts a CLOB value to a value of type DM_RuleBldTask. The CLOB value must be a value that was previously exported using the DM_expRuleTask method.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-task..DM_impRuleTask--(--clobTask--)------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_impRuleTask--(--task--,--clobTask--)---------------------><

Parameters

task
A value of type DM_RuleBldTask
clobTask
A CLOB value containing a task

Return value

DM_isCompatible

This method determines whether a DM_LogicalDataSpec value is compatible with another DM_LogicalDataSpec value. It compares two logical data specifications, and returns TRUE if they are compatible. It can be used to check whether a certain table with test data provides valid input for a certain model.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-existLogDataSpec..DM_isCompatible--(--logDataSpec--)--------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_isCompatible--(--existLogDataSpec--,--logDataSpec--)-----><

Parameters

existLogDataSpec
A value of type DM_LogicalDataSpec consisting of a set of fields
logDataSpec
A value of type DM_LogicalDataSpec to be checked for compatibility

Return value

Note that calls to DM_isCompatible are not symmetric. A call DM_isCompatible(A,B) can return a result different from that returned by DM_isCompatible(B,A).

DM_remConItem

This method removes an item from the list of item constraints contained in a DM_RuleSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-ruleSettings..DM_remConItem--(--item--)---------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_remConItem--(--ruleSettings--,--item--)------------------><

Parameters

ruleSettings
A value of type DM_RuleSettings
item
A value of type VARCHAR

Return value

DM_remDataSpecFld

This method removes the field with the specified name from a value of type DM_LogicalDataSpec.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_remDataSpecFld--(--fieldName--)------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_remDataSpecFld--(--fields--,--fieldName--)---------------><

Parameters

fields
A value of type DM_LogicalDataSpec consisting of a set of fields
fieldName
The field name, of type VARCHAR, of the field that you want to remove from the DM_LogicalDataSpec value

Return value

DM_remNmp

This method removes the name mapping with the specified name from the fields contained in a value of type DM_LogicalDataSpec.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_remNmp--(--name--)-------------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_remNmp--(--fields--,--name--)----------------------------><

Parameters

fields
A value of type DM_LogicalDataSpec
name
The name, as type VARCHAR, of the name mapping to be removed from the DM_LogicalDataSpec value

Return value

Related concepts

Name mappings

Usage

Removing a name mapping

DM_remSimMat

This method removes the specified similarity matrix from the DM_ClusSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusSettings..DM_remSimMat--(--simMatrixName--)-------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_remSimMat--(--clusSettings--,--simMatrixName--)----------><

Parameters

clusSettings
A value of type DM_ClusSettings
simMatrixName
A value of type VARCHAR

Return value

DM_remTax

This method removes the taxonomy with the specified name from the fields contained in a value of type DM_LogicalDataSpec.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_remTax--(--taxName--)----------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_remTax--(--fields--,--taxName--)-------------------------><

Parameters

fields
A value of type DM_LogicalDataSpec
taxName
The name, as type VARCHAR, of the taxonomy to be removed from the DM_LogicalDataSpec value

Return value

Related concepts

Taxonomies

Usage

DM_remTaxMap

This method removes the category map identified by the specified position from the taxonomy contained in a DM_LogicalDataSpec value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_remTaxMap--(--taxName--,--position--)------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_remTaxMap--(--fields--,--taxName--,--position--)---------><

Parameters

fields
A value of type DM_LogicalDataSpec
taxName
The name, of type VARCHAR, of the taxonomy from which you want to remove a category map
position
The position of the category map within the taxonomy, ranging from 1 to the number of category maps in the taxonomy, as type INTEGER

Return value

Related concepts

Category maps

Usage

Adding and removing category maps

DM_setClasCost

This method returns a specified value of type DM_ClasSettings. Repeated calls are used to specify a cost matrix for a classification training run by providing individual cost values.

Notes:
  1. An alternative way to specify a cost matrix is available using DM_setCostMat.
  2. The way to define a cost matrix using the function DM_setCostMat should not be used in conjunction with the alternative approach using the function DM_setClasCost. If an application mixes these two approaches, the result is the following:
    ---------------------------------------------------------
    setClasCost(A,B,2.0)
    setCostMat(COSTTAB, ...)	// contains A,B,3 and A,C,5
       => ERROR
    getClasCost(A,B) = 2.0
    getClasCost(A,C) = 1.0		// the default value
    getCostMatTab()  = NULL
    ---------------------------------------------------------
    setClasCostMat(COSTTAB, ...)	// contains A,B,3 and A,C,5
    getClasCost(A,B)
       => ERROR
    setClasCost(A,C,3.0)
       => ERROR
    getClasCost(A,D)
       => ERROR
    getCostMatTab()  = COSTTAB
    ---------------------------------------------------------
    

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clasSettings..DM_setClasCost--(--actualClass--,--predictedClass--,--cost--)-><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setClasCost--(--clasSettings--,--actualClass--,--predictedClass--,--cost--)-><

Parameters

clasSettings
A value of type DM_ClasSettings
actualClass
Is a CHARACTER VARYING(256) value
predictedClass
Is a CHARACTER VARYING(256) value
cost
Is a DOUBLE PRECISION value

Return value

The result of the invocation DM_setClasCost is determined as follows:

Examples

An example is:

CREATE METHOD DM_setClasCost
	(actualClass CHARACTER VARYING(256)
   predictedClass CHARACTER VARYING(256)
   cost DOUBLE PRECISION)
	RETURNS DM_ClasSettings
	FOR DM_ClasSettings
	BEGIN
		--
		-- 
	END

DM_setClasCostRate

This method sets the cost rate value for a training run in a value of DM_ClasSettings.

The cost rate value specifies the percentage of incorrect predictions that can be tolerated in a Classification training run on validation data.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clasSettings..DM_setClasCostRate--(--percentage--)----------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setClasCostRate--(--clasSettings--,--percentage--)-------><

Parameters

clasSettings
A value of type DM_ClasSettings
percentage
A value, of type DOUBLE, between 0 and 100

Return value

Related concepts

Tolerated levels of incorrect predictions

Usage

Tolerated levels of incorrect predictions

Defaults

Specifying the tolerated level of incorrect predictions

DM_setClasTarget

This method specifies the target (class label) field for a DM_ClasSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clasSettings..DM_setClasTarget--(--targetField--)-----------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setClasTarget--(--clasSettings--,--targetField--)--------><

Parameters

clasSettings
A value of type DM_ClasSettings
targetField
The name of the target field, of type VARCHAR

Return value

Related concepts

Class label field

Usage

Specifying the class label field

DM_setColumns

This method defines a DM_MiningData value consisting of the names of the source table columns. The column names are specified in an input XML string.

Note:
This method is no longer required, because DM_defMiningData automatically sets column information. For more information refer to DM_defMiningData.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-miningData..DM_setColumns--(--columns--)--------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setColumns--(--miningData--,--columns--)-----------------><

Parameters

miningData
A value of type DM_MiningData
columns
An XML string as a VARCHAR value containing column definitions with names, aliases, and SQL types according to the following DTD:
<!ELEMENT Column EMPTY>
<!ATTLIST Column
        alias         CDATA#IMPLIED
        name          CDATA#REQUIRED
        sqlType	      CDATA#IMPLIED>

If the column name contains any of the characters ' " < > &, each character must be specified in the XML string using its escape string. The escape strings are as follows:

'  =  &apos;
"  =  &quot;
<  =  &lt;
>  =  &gt;
&  =  &amp;
The following SQL types are supported as the sqlType attribute in the XML string:
  • CHAR, VARCHAR, LONG VARCHAR, TIME, DATE, TIMESTAMP, SMALLINT, INTEGER, DOUBLE, FLOAT, DECIMAL, BIGINT, REAL

You can specify the XML string directly if you know the column names and column types.

Return value

DM_setConType

This method specifies, in a DM_RuleSettings value, the constraint type for mining association rules.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-ruleSettings..DM_setConType--(--type--)---------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setConType--(--ruleSettings--,--type--)------------------><

Parameters

ruleSettings
A value of type DM_RuleSettings
type
A value of type INTEGER

Valid values for type:

0
Exclusive
1
Inclusive

Return value

Related concepts

Rule length and item constraints

Usage

Setting item constraints

DM_setCostMat

This method defines a cost matrix for the target field in a DM_ClasSettings value.

The cost matrix is a reference to a table. The table contains the values to be used for the training runs. These values must be greater than or equal to zero. Since the cost matrix contains misclassification weights, these weights should be zero for the matrix diagonal.

The table is not read when this method is called. During the training run it is checked whether the table exists and the values are read from the table.

Note:
An alternative way to specify a cost matrix is available using DM_setClasCost. You must not use both methods together when defining a cost matrix.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clasSettings..DM_setCostMat--(--tableName--,--colNameActualValue--,-->

>--colNamePredValue--,--colNameWeight--)-----------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setCostMat--(--clasSettings--,--tableName--,--colNameActualValue--,-->

>--colNamePredValue--,--colNameWeight--)-----------------------><

Parameters

clasSettings
A value of type DM_ClasSettings
tableName
A value of type VARCHAR
colNameActualValue
A value of type VARCHAR
colNamePredValue
A value of type VARCHAR
colNameWeight
A value of type VARCHAR

Return value

Related concepts

Cost matrix

Usage

Defining a cost matrix

Defaults

DM_setDClusFldPar

This method defines settings parameters that are specific to the Distribution-based Clustering algorithm for a specified field in a DM_ClusSettings value.

Use the method's keyword parameter to specify the particular settings parameter that is set by the call to DM_setDClusPar.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusSettings..DM_setDClusFldPar--(--fieldname--,--keyword--,-->

>--keyword value--)--------------------------------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setDClusFldPar--(--clusSettings--,--fieldname--,--keyword--,-->

>--keyword value--)--------------------------------------------><

Parameters

clusSettings
A value of type DM_ClusSettings
fieldname
A value of type VARCHAR containing the name of a field
keyword
The name of the settings parameter, as type VARCHAR, for which you want to set a value
keyword value
The value that you want to set for the settings parameter specified in keyword, as type VARCHAR.

Permitted values for keyword and keyword value are:

ValueWeighting
Specify the keyword ValueWeighting to set the value weighting method for a Clustering training run.

Permitted values for keyword value are:

log
Logarithmic weighting
compLog
Logarithmic weighting with compensation
prob
Probabilistic weighting
compProb
Probabilistic weighting with compensation

Return value

Related concepts

Value weighting

Usage

Specifying value weighting

Defaults

Specifying value weighting

DM_setDClusPar

This method sets, in a DM_ClusSettings value, settings parameters that are specific to the Distribution-based Clustering algorithm.

Use the method's first parameter to specify the particular settings parameter that is set by the call to DM_setDClusPar.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusSettings..DM_setDClusPar--(--keyword--,--keyword value--)-><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setDClusPar--(--clusSettings--,--keyword--,--keyword value--)-><

Parameters

clusSettings
A value of type DM_ClusSettings
keyword
The name of the settings parameter, as type VARCHAR, for which you want to specify a value
keyword value
The value, as type DOUBLE, that you want to set for the settings parameter specified in keyword

Permitted values for keyword and keyword value are:

SimThr
Specify the keyword SimThr to set the similarity threshold for a Clustering training run. Permitted values are in the range from 0 to 1. The similarity threshold is a DOUBLE value.

Return value

Related concepts

Similarity threshold

Usage

Defaults

Defining the similarity threshold

DM_setErrorTab

This method sets the name of a table to be used for errors and warnings in a task value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-task..DM_setErrorTab--(--errorTableName--)------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setErrorTab--(--task--,--errorTableName--)---------------><

Parameters

task
A value of type:
  • DM_RuleBldTask
  • DM_ClasBldTask
  • DM_ClusBldTask
  • DM_RegBldTask
  • DM_ClasTestTask
  • DM_RegTestTask
errorTableName
The name for the error table, as type VARCHAR, optionally qualified by a schema name (schema.table). The name can also be NULL.

Return value

The return value of type task is determined by checking the following conditions in the given sequence:

DM_setExecTime

This method sets the execution time for a:

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-settings..DM_setExecTime--(--duration--)--------------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setExecTime--(--settings--,--duration--)-----------------><

Parameters

settings
A value of type DM_ClusSettings or DM_RegSettings
duration
A value of type INTEGER, specifying the execution time in minutes

Return value

Return value for clustering

Note:
The Clustering mining algorithm calculates the duration using the CPUSPEED parameter contained in the database manager configuration. Check whether the CPUSPEED parameter matches your machine configuration in order to let the algorithm calculate with the correct time values. You can check the database manager configuration by using the command db2 get dbm cfg.

Return value for regression

Related concepts

Usage

DM_setFldAlias

This method defines an alias name for a field contained in a DM_MiningData value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-miningData..DM_setFldAlias--(--dataFieldName--,--aliasName--)-><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setFldAlias--(--miningData--,--dataFieldName--,--aliasName--)-><

Parameters

miningData
A value of type DM_MiningData already containing field definitions
dataFieldName
The name of the field contained in miningData (as type VARCHAR) for which you want to define an alias name
aliasName
The new alias name, of type VARCHAR, for dataFieldName

Return value

DM_setFldNmp

This method makes a name mapping that exists in a DM_LogicalDataSpec value active by linking it to a field contained in the DM_LogicalDataSpec value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_setFldNmp--(--fieldName--,--nameMapping--)-------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setFldNmp--(--fields--,--fieldName--,--nameMapping--)----><

Parameters

fields
A value of type DM_LogicalDataSpec consisting of a set of fields
fieldName
A field name of type VARCHAR that is already contained in fields
nameMapping
A name mapping of type VARCHAR that is already contained in fields

Return value

Related concepts

Name mappings

Usage

Activating a name mapping

DM_setFldOutlLim

This method sets outlier limits for the specified field contained in a DM_LogicalDataSpec value. All values that fall outside of this range are treated as outliers. This applies only to numerical fields.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_setFldOutlLim--(--fieldName--,--lower--,--upper--)-><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setFldOutlLim--(--fields--,--fieldName--,--lower--,--upper--)-><

Parameters

fields
A value of type DM_LogicalDataSpec consisting of a set of fields
fieldName
A field name of type VARCHAR that is already contained in fields
lower
The lower bound value, of type DOUBLE, DATE, TIME, or TIMESTAMP according to the SQL type of the field
upper
The upper bound value, of type DOUBLE, DATE, TIME, or TIMESTAMP according to the SQL type of the field

Return value

Related concepts

Outlier treatment

Defaults

Treating outliers

Usage

Treating outliers

DM_setFldOutlTreat

This method sets the outlier treatment for a specified field in a DM_ClusSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusSettings..DM_setFldOutlTreat--(--fieldName--,--outlierTreatment--)-><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setFldOutlTreat--(--clusSettings--,--fieldName--,--outlierTreatment--)-><

Parameters

clusSettings
A value of type DM_ClusSettings
fieldName
A value of type VARCHAR
outlierTreatment
A value of type INTEGER

Valid values for outlierTreatment:

0
Treat outliers as they are
1
Treat outliers as missing values
2
Treat outliers as extreme values

Return value

DM_setFldSimMat

This method makes a similarity matrix contained in a DM_ClusSettings value active. It does this by linking the name of the similarity matrix with a field contained in the DM_ClusSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusSettings..DM_setFldSimMat--(--fieldName--,--simMatrixName--)-><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setFldSimMat--(--clusSettings--,--fieldName--,--simMatrixName--)-><

Parameters

clusSettings
A value of type DM_ClusSettings
fieldName
A value of type VARCHAR
simMatrixName
A value of type VARCHAR

Return value

Related concepts

Similarity matrices

Usage

Specifying similarity scale

Defaults

Specifying similarity scale

DM_setFldSimScale

This method sets the similarity scale for a specified field in a DM_ClusSettings value.

Similarity scale is a value that influences the calculation of the similarity measurement.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusSettings..DM_setFldSimScale--(--fieldName--,--similarityScale--)-><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setFldSimScale--(--clusSettings--,--fieldName--,--similarityScale--)-><

Parameters

clusSettings
A value of type DM_ClusSettings
fieldName
A value of type VARCHAR
similarityScale
A value of type DOUBLE>0

Return value

Related concepts

Similarity scale

Defaults

Specifying similarity scale

Usage

Specifying similarity scale

DM_setFldTax

This method makes a taxonomy that exists in a DM_LogicalDataSpec value active by linking it to a specified field contained in the DM_LogicalDataSpec value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_setFldTax--(--fieldName--,--taxonomy--)----------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setFldTax--(--fields--,--fieldName--,--taxonomy--)-------><

Parameters

fields
A value of type DM_LogicalDataSpec consisting of a set of fields
fieldName
A field name of type VARCHAR that is already contained in fields
taxonomy
A taxonomy of type VARCHAR that is already contained in fields

Return value

Related concepts

Taxonomies

Usage

Activating a taxonomy

DM_setFldType

This method sets the mining field type of a specified field that is already contained in a value of type DM_LogicalDataSpec.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-fields..DM_setFldType--(--fieldName--,--miningType--)-------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setFldType--(--fields--,--fieldName--,--miningType--)----><

Parameters

fields
A value of type DM_LogicalDataSpec consisting of a set of fields
fieldName
A field name of type VARCHAR that is already contained in fields
miningType
A mining field type as an INTEGER value. For more information on data types, see Mining field types.

Return value

Usage

Deriving a logical data specification from individual fields

DM_setFldUsageType

This method sets the usage type for the specified field or all fields in a value of type settings.

You can set the usage type for all fields at once. This is useful, for example, if you want to set all fields to usage type active to prevent automatic field usage type determination. For more information refer to Autonomic variable selection.

Note:
If you specify DM_setFldUsageType(fieldName,usageType), the usage type usageType is assigned to the field fieldName.

If you specify DM_setFldUsageType(usageType), the usage type usageType is assigned to all fields.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-settings..DM_setFldUsageType--(--+--------------+--usageType--)-><
                                    '-fieldname--,-'

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setFldUsageType--(--settings--,--+--------------+--usageType--)-><
                                       '-fieldname--,-'

Parameters

settings
A value of type:
  • DM_RuleSettings
  • DM_ClusSettings
  • DM_ClasSettings
  • DM_RegSettings
fieldname
A value of type VARCHAR.
Note:
To specify the usage type for all fields you must not specify a field name.
usageType
A value of type INTEGER.

Valid values for usageType:

1
Active: The field is used by the algorithm.
2
Inactive (for Associations, Classification, and Regression): The field is ignored when the model is built.

Supplementary (Clustering): The field is not taken into account when the clusters are determined. Nevertheless, the statistical information for this field on those clusters is collected and written into the model.

Return value

Usage notes

The routines of the autonomic variable selection check if the fields do not have a usage type and suggest to the kernel whether the field should be used or not. For example, obvious key fields, degenerated fields (only a single value), or unusable fields (all records have missing values for it) should be dropped.

Expert miners know which fields to use and set all the respective fields to active. If you are new to data mining, you can specify that fields do not have a usage type and let the routines of the autonomic variable selection check these fields. In most cases, users might have a number of fields which they want to use because from the business context they know their importance, but are not sure about others. They can use the routines of the autonomic variable selection.

In general, the autonomic variable selection:

The resulting models are rather simple and robust, and provide a quick overview.

Notes:
  1. It is recommended that you have runstats for the data available to speed up processing.
  2. If any records were added or modified since the last runstats were created, it is suggested to run them again, because they must be recent.
  3. In general, it is better to have no runstats at all than to have runstats that do not match the current data. This may mislead the algorithm.
  4. If there are no runstats, the missing information will be gathered by the algorithm.

Related concepts

Usage

DM_setFldWeight

This method sets the field weight for a specified field in a DM_ClusSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusSettings..DM_setFldWeight--(--fieldName--,--fieldWeight--)-><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setFldWeight--(--clusSettings--,--fieldName--,--fieldWeight--)-><

Parameters

clusSettings
A value of type DM_ClusSettings
fieldName
A value of type VARCHAR
fieldWeight
A value of type DOUBLE > 0

Return value

Related concepts

Field weighting

Usage

Specifying field weighting

Defaults

Specifying field weighting

DM_setGroup

This method specifies, in a DM_RuleSettings value, the field used to identify the group (for example, a purchase group) for mining association rules.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-ruleSettings..DM_setGroup--(--groupField--)-----------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setGroup--(--ruleSettings--,--groupField--)--------------><

Parameters

ruleSettings
A value of type DM_RuleSettings
groupField
The name of the group field as a VARCHAR value

Return value

Related concepts

Items and groups in tables

Usage

Defining the layout of the input table

DM_setItemFld

This method explicitly specifies, in a DM_RuleSettings value, the field used to identify the items for mining associations rules.

Notes:
  1. You can specify only one field as item field with this method. All other fields except of a group field are not considered in the mining run. If you have more than one item field you can explicitly specify your item fields using the method setFldUsageType. For more information refer to DM_setFldUsageType.
  2. If you use the method DM_setItemFld() to specify an item field the item format is chosen as 'field value'. See DM_setItemFormat for more information on item format.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-ruleSettings..DM_setItemFld--(--itemfield--)----------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setItemFld--(--ruleSettings--,--itemfield--)-------------><

Parameters

ruleSettings
A value of type DM_RuleSettings
itemfield
A value of type VARCHAR

Return value

DM_setItemFormat

This method defines how the item names are built from the field value and the field name. This method specifies the table layout that is used for the input data in a DM_RuleSettings value. The method acts on all input fields except of the field that was defined as group ID by the method DM_setGroup.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-DM_RuleSettings..DM_setItemFormat--(--itemFormat--)---------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setItemFormat--(--itemFormat--)--------------------------><

Parameters

itemFormat
A value of type INTEGER. The following values are valid:
0
Item name is chosen as [field name = field value].
This is the default value.
1
Item name is chosen as [field value].
2
Item name is chosen as [field name].

Return value

If itemFormat is:

Related concepts

Items and groups in tables

Usage

Defining the layout of the input table

DM_setMaxLen

This method sets the maximum rule length in a DM_RuleSettings value.

The maximum rule length determines the number of items in the rule, including the rule head.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-ruleSettings..DM_setMaxLen--(--maxRuleLen--)----------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setMaxLen--(--ruleSettings--,--maxRuleLen--)-------------><

Parameters

ruleSettings
A value of type DM_RuleSettings
maxRuleLen
A value of type INTEGER

Return value

Related concepts

Usage

Specifying maximum rule length

DM_setMaxNumClus

This method sets, in the DM_ClusSettings value, the maximum number of clusters to be created during a training run.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusSettings..DM_setMaxNumClus--(--number--)----------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setMaxNumClus--(--clusSettings--,--number--)-------------><

Parameters

clusSettings
A value of type DM_ClusSettings
number
A value of type INTEGER

Return value

Related concepts

Maximum number of clusters

Usage

Defaults

Maximum number of clusters

DM_setMinConf

This method creates the 'minimum confidence' setting in a DM_RuleSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-ruleSettings..DM_setMinConf--(--minConfidence--)------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setMinConf--(--ruleSettings--,--minConfidence--)---------><

Parameters

ruleSettings
A value of type DM_RuleSettings
minConfidence
A value of type DOUBLE in the range from 0 to 100

Return value

Related concepts

Items and groups in tables

Usage

Defining the layout of the input table

DM_setMinData

This method sets the minimum percentage of data that a Clustering training run must read in a DM_ClusSettings value. This parameter is considered only if the execution time is limited. If the execution time is not limited, the data is always processed in full. To set the execution time, use the method DM_setExecTime.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusSettings..DM_setMinData--(--percentage--)---------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setMinData--(--clusSettings--,--percentage--)------------><

Parameters

clusSettings
A value of type DM_ClusSettings
percentage
A value of type DOUBLE in the range from 0 to 100

Return value

Related concepts

Minimum percentage of data

Usage

Specifying the minimum percentage of data that is processed

Defaults

Specifying the minimum percentage of data that is processed

DM_setMinSupport

This method creates the 'minimum support' setting in a DM_RuleSettings value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-ruleSettings..DM_setMinSupport--(--minSupport--)------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setMinSupport--(--ruleSettings--,--minSupport--)---------><

Parameters

ruleSettings
A value of type DM_RuleSettings
minSupport
A value of type DOUBLE in the range from 0 to 100

Return value

Related concepts

Support in an association rule

Usage

Defining minimum support

DM_setPowerOptions

This method sets power options to be used for a training run. If you want to specify more than one option, concatenate the options.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-settings..DM_setPowerOptions--(--powerOption--)-------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setPowerOptions--(--settings--,--powerOption--)----------><

Parameters

settings
A value of type DM_ClasSettings, DM_RuleSettings, or DM_ClusSettings.
Note:
The power options do not have an effect on DM_RegSettings
powerOption
A value of type VARCHAR, specifying special settings for a training run. For a list of options refer to Specifying power options.

Return value

Examples

You can specify for example:

DM_setPowerOptions('-buf 256 -IDM_WORKING_DIRECTORY /tmp/MiningRuns')

A check is not made as to whether the power options are valid. If the mining algorithm knows the power options, they are used during the training run.

Related concepts

Specifying power options

Defaults

Specifying power options

DM_setProgTab

This method sets the name of a table to be used for writing progress information in a task value.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-task..DM_setProgTab--(--progressTableName--)----------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setProgTab--(--task--,--progressTableName--)-------------><

Parameters

task
A value of type:
  • DM_RuleBldTask
  • DM_ClasBldTask
  • DM_ClusBldTask
  • DM_RegBldTask
  • DM_ClasTestTask
  • DM_RegTestTask
progressTableName
The name for the progress information table, as type VARCHAR, optionally qualified by a schema name (schema.table). The name can also be NULL.

Return value

The return value is a value of type task.

The return value is determined by a check of the following conditions in the given sequence:

DM_setRegRSquared

This method sets the maximum tolerated squared Pearson correlation coefficient r2 (with 0 <= r2 <= 1) between the prediction error on verification data and the actual target values. Note: r2=0 means that the prediction error and the target field values are uncorrelated, r2=1 means that the two values are perfectly (positively or negatively) correlated. Therefore, setting an upper threshold for r2 means setting an upper limit for the acceptable systematic error of the model.

Note:
Setting a rSquared threshold is just a hint for the regression algorithm; it cannot be guaranteed that the constructed model really has a rSquared value below that threshold.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-regSettings..DM_setRegRSquared--(--rSquared--)--------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setRegRSquared--(--regSettings--,--rSquared--)-----------><

Parameters

regSettings
A value of type DM_RegSettings
rSquared
A value of type DOUBLE between 0 and 1

Return value

Related concepts

Usage

DM_setRegTarget

This method specifies the target field for a DM_RegSettings value. The target field is the field whose values are to be predicted.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-regSettings..DM_setRegTarget--(--targetField--)-------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setRegTarget--(--regSettings--,--targetField--)----------><

Parameters

regSettings
A value of type DM_RegSettings
targetField
The Name of the target field of type VARCHAR

Return value

Related concepts

Target field

Usage

Specifying the target field

DM_setTreeClasPar

This method defines settings parameters that are specific to the Tree Classification algorithm in a DM_ClasSettings value.

Use the method's first parameter to specify the particular settings parameter that is set by the call to DM_setTreeClasPar.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clasSettings..DM_setTreeClasPar--(--keyword--,--keyword value--)-><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setTreeClasPar--(--clasSettings--,--keyword--,--keyword value--)-><

Parameters

clasSettings
A value of type DM_ClasSettings
keyword
The name of the settings parameter, as type VARCHAR, for which you want to set a value
keyword value
The value, as type DOUBLE, that you want to set for the settings parameter specified in keyword.

Permitted values for keyword and keyword value are:

MaxPur
Specify the keyword MaxPur to set the maximum purity for a decision tree. Values are specified as a percentage, between 0 and 100. The percentage value is a FLOAT value.
MaxDth
Specify the keyword MaxDth to set the maximum depth of a tree. The tree depth is an INTEGER value.
MinRec
Specify the keyword MinRec to set the minimum number of records contained in a tree node. The minimum number of records is an INTEGER value.

Return value

Related concepts

Usage

Defaults

DM_setWhereClause

This method defines a WHERE clause in the DM_MiningData value to filter the specified data.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-miningData..DM_setWhereClause--(--whereClause--)------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setWhereClause--(--miningData--,--whereClause--)---------><

Parameters

miningData
A value of type DM_MiningData
whereClause
An SQL WHERE clause, as a VARCHAR value. The VARCHAR value must not contain or begin with the WHERE flag.

Return value

DM_useClasDataSpec

This method specifies a DM_LogicalDataSpec value for a DM_ClasSettings value.

The DM_LogicalDataSpec value determines the valid input data of type DM_MiningData that can be processed in a training run.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clasSettings..DM_useClasDataSpec--(--dataSpec--)------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_useClasDataSpec--(--clasSettings--,--dataSpec--)---------><

Parameters

clasSettings
A value of type DM_ClasSettings
dataSpec
A value of type DM_LogicalDataSpec

Return value

Usage

Adding a logical data specification to a settings value

DM_useClusDataSpec

This method specifies a DM_LogicalDataSpec value for the DM_ClusSettings value. The DM_LogicalDataSpec value determines the valid DM_MiningData values that can be processed in a training run.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-clusSettings..DM_useClusDataSpec--(--logDataSpec--)---------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_useClusDataSpec--(--clusSettings--,--logDataSpec--)------><

Parameters

clusSettings
A value of type DM_ClusSettings
logDataSpec
A value of type DM_LogicalDataSpec

Return value

Usage

DM_useRegDataSpec

This method specifies a DM_LogicalDataSpec value for a DM_RegSettings value. The DM_LogicalDataSpec value determines valid input data of type DM_MiningData which can be processed in a training run.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-regSettings..DM_useRegDataSpec--(--dataSpec--)--------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_useRegDataSpec--(--regSettings--,--dataSpec--)-----------><

Parameters

regSettings
A value of type DM_RegSettings
dataSpec
A value of type DM_LogicalDataSpec

Return value

Usage

Adding a logical data specification to a settings value

DM_useRuleDataSpec

This method specifies a DM_LogicalDataSpec value for a DM_RuleSettings value. The DM_LogicalDataSpec value determines the valid input data of type DM_MiningData that can be processed in a training run.

Syntax

Method syntax

Read syntax diagramSkip visual syntax diagram>>-ruleSettings..DM_useRuleDataSpec--(--dataSpec--)------------><

Function syntax

Read syntax diagramSkip visual syntax diagram>>-DM_useRuleDataSpec--(--ruleSettings--,--dataSpec--)---------><

Parameters

ruleSettings
A value of type DM_RuleSettings
dataSpec
A value of type DM_LogicalDataSpec

Return value

Related concepts

Items and groups in tables

Usage

Functions reference

This chapter contains full descriptions of all the functions provided with IM Modeling. They are presented in alphabetical order of the function names. For a listing in the order of the data types that they act on, see Overview of IM Modeling's database objects.

For instructions on how to use the database objects presented here, see Using IM Modeling.

DM_expClasModel

This function returns a character large object representing a PMML Classification model of type DM_ClasModel.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_expClasModel--(--classificationModel--)------------------><

Parameters

classificationModel
A value of type DM_ClasModel

Return value

The return value is a character large object representing the PMML Classification model in question. The CLOB XML string is encoded in database encoding (the code set specified when the database was created) regardless of the encoding specification found in the XML content.

Examples

Exporting mining models

DM_expClasTestRes

This function returns a character large object, representing a Classification test result of type DM_ClasTestResult. Export functions are helpful when you want to store values in an external media, for example, as a backup.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_expClasTestRes--(--classificationTestResult--)-----------><

Parameters

classificationTestResult
A value of type DM_ClasTestResult

Return value

The result of invoking this method is a character large object representing the Classification test result. The CLOB XML string is encoded in database encoding (the code set specified when the database was created) regardless of the encoding specification found in the XML content.

DM_expClusModel

This function returns a character large object representing the PMML Clustering model extracted from a value of type DM_ClusteringModel.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_expClusModel--(--clusteringModel--)----------------------><

Parameters

clusteringModel
A value of type DM_ClusteringModel

Return value

The return value is a character large object representing the Clustering model. The CLOB XML string is encoded in database encoding (the code set specified when the database was created) regardless of the encoding specification found in the XML content.

Examples

Exporting mining models

DM_expRegTestRes

This function returns a character large object representing the Regression test result of type DM_RegTestResult.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_expRegTestRes--(--regTestResult--)-----------------------><

Parameters

regTestResult
A value of type DM_RegTestResult

Return value

The result of the invocation DM_expRegTestRes is a CHARACTER LARGE OBJECT representing the regression test result.

DM_expRegModel

This function returns a character large object representing a PMML or XML Regression model of type DM_RegressionModel.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_expRegModel--(--regressionModel--)-----------------------><

Parameters

regressionModel
A value of type DM_RegressionModel

Return value

A character large object (CLOB) represents a Regression model, if it is a valid instance of the PMML-based regression DTD according to XML.

The return value is a character large object (CLOB) representing the Regression model. The CLOB XML string is encoded in the code set, which is specified when the database is created, regardless of the encoding specification found in the XML content.

Note:
XML Regression models created by IM Modeling are not fully PMML 2.1 compliant models. They use existing PMML 2.1 element names with several minor additions. These additions have been submitted to be part of the next PMML 3.0 standard.

Examples

Exporting mining models

DM_expRuleModel

This function returns a character large object representing an Associations model of type DM_RuleModel.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_expRuleModel--(--ruleModel--)----------------------------><

Parameters

ruleModel
A value of type DM_RuleModel

Return value

The result of invoking DM_expRuleModel is a character large object representing the Associations model. The CLOB XML string is encoded in database encoding (the code set specified when the database was created) regardless of the encoding specification found in the XML content.

DM_getClasCostRate

This function returns the classification cost rate of the Classification model computed in a validation phase during the training phase. It uses the validation data specified in the DM_ClasBldTask value used to generate the model.

For more information refer to DM_setClasCostRateDM_setClasCostRate.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClasCostRate--(--classificationModel--)---------------><

Parameters

classificationModel
A value of type DM_ClasModel

Return value

DM_getClasError

This function returns the Classification error value contained in a DM_ClasTestResult value.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClasError--(--clasTestResult--)-----------------------><

Parameters

clasTestResult
A value of type DM_ClasTestResult

Return value

DM_getClasMdlName

This function returns the name of a Classification model of type DM_ClasModel.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClasMdlName--(--classificationModel--)----------------><

Parameters

classificationModel
A Classification model of the type DM_ClasModel

Return value

The return value is the name of the Classification model as a VARCHAR value.

DM_getClasMdlSpec

This function returns the DM_LogicalDataSpec value representing the set of fields needed for an application of the Classification model.

To do a test of the model, you must also call the function DM_getClasTarget to complete the set of fields needed for a test run.

Note:
It is recommended that you use the DM_getFields function instead of this function as described in DM_getFields.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClasMdlSpec--(--classificationModel--)----------------><

Parameters

classificationModel
A value of type DM_ClasModel

Return value

The return value is the DM_LogicalDataSpec value representing the set of fields needed for an application of the Classification model.

Usage

Executing a test run on the mining model

DM_getClasTarget

This function returns the name of the target field of a Classification model.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClasTarget--(--classificationModel--)-----------------><

Parameters

classificationModel
A value of type DM_ClasModel

Return value

The return value is the target field name as a VARCHAR value.

Related references

DM_getFields

Usage

Executing a test run on the mining model

DM_getClasTask

This function returns the DM_ClasBldTask value used to create a specified model.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClasTask--(--classificationModel--)-------------------><

Parameters

classificationModel
A value of type DM_ClasModel

Return value

DM_getClusMdlName

This function returns the name of a Clustering model of type DM_ClusteringModel.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClusMdlName--(--clusteringModel--)--------------------><

Parameters

clusteringModel
A Clustering model of the type DM_ClusteringModel

Return value

The return value is the name of the Clustering model as a VARCHAR value.

DM_getClusMdlSpec

This function returns the DM_LogicalDataSpec value representing the set of fields needed for an application of the Clustering model.

Note:
It is recommended that you use the DM_getFields function instead of this function as described in DM_getFields.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClusMdlSpec--(--clusteringModel--)--------------------><

Parameters

clusteringModel
A value of type DM_ClusteringModel

Return value

The return value is the DM_LogicalDataSpec value representing the set of fields needed for an application of the Clustering model.

DM_getClusTask

This function returns the DM_ClusBldTask value used to create a specified model.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClusTask--(--clusteringModel--)-----------------------><

Parameters

clusteringModel
A value of type DM_ClusteringModel

Return value

The result of invoking this function is determined as follows:

DM_getClusterName

This function returns the name of a cluster at a specified position in a value of type DM_ClusteringModel.

Note:
It is recommended that you use the DM_getClusters function instead of a combination of this function together with DM_getClusterID and DM_getNumClusters.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClusterName--(--clusteringModel--,--position--)-------><

Parameters

clusteringModel
A value of type DM_ClusteringModel
position
A value, of type INTEGER, between 1 and the result of DM_getNumClusters. Here you can specify the value obtained by a call to DM_getClusterID.

Return value

DM_getClusters

This function returns a table that contains the clusters of a Clustering model. For each cluster, the size and homogeneity is given.

You can use this function for example to determine the smallest clusters for deviation detection. The cluster IDs can be used in result specification methods.

Note:
It is recommended that you use the DM_getClusters function instead of:

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getClusters--(--clusteringModel--)-----------------------><

Parameters

clusteringModel
A value of type DM_ClusteringModel

Return value

The result of invoking DM_getClusters is a table. Table 64 describes the data type and purpose of each column contained in this table.

Table 64. Result values for DM_getClusters
Column Data type Purpose
ID INTEGER Are the index values of the cluster in the model
NAME VARCHAR(128) Contains the names of the clusters
SIZE BIGINT Contains the number of records in the clusters
HOMOGENEITY REAL Contains a measure for the homogeneity of the records in the cluster. The value is between 0 (heterogeneous) and 1 (homogeneous, all records are identical)
DESCRIPTION VARCHAR(1024) Contains for each cluster a text description of the most important fields for characterizing the cluster.

The DESCRIPTION of a cluster is built up as follows:

The text of an individual field depends on the field type:

For categorical fields
The field value whose relative frequency in the cluster mostly differs from the relative frequency in the background is used:
  • If the difference is above 0.25, the text is:

    "<field alias> is much more/less often <value> than average"

  • If the difference is above 0.1, the text is:

    "<field alias> is more/less often <value> than average"

  • The relative frequencies in the cluster are preferred to the relative frequencies in the background.
  • Otherwise, no text is displayed for this field.
For numerical fields
The difference of the mean value between the cluster and the background is considered:
  • If the difference is above 1 time the standard deviation of the background, the text is:

    "<field alias> is much larger/smaller than average"

  • If the difference is above 0.5 time the standard deviation of the background, the text is:

    "<field alias> is larger/smaller than average"

  • If the difference is under 0.5 time the standard deviation of the background and the standard deviation in the cluster itself is larger/smaller than 50%, the text is:

    "<field alias> has a larger/smaller variance than input data"

  • Otherwise, no text is displayed for this field.
Note:
If no text is displayed for the five most important fields, the text is: "This cluster is overall similar to input data".

Table 65 shows an example for the table returned by DM_getClusters:

Table 65. Sample table returned by DM_getClusters
ID NAME SIZE HOMOGENEITY DESCRIPTION
1 lost customer 765 0.8 AGE is smaller than average, GENDER is more often FEMALE than average, INCOME is much larger than average
2 loyal customer 8156 0.4 This cluster is overall similar to input data
3| undecided customer 172 0.7 INCOME larger than average, GENDER is more often FEMALE than average, AGE is larger than average
4 potential customer 455 0.4 GENDER is much more often MALE than average, NUM_OF_INSURANCES is smaller than average, SICK_LEAVE is much smaller than average, CAR_INSURANCE is much less often YES, NUM_OF_CHILDREN is larger than average

DM_getConfMatrix

Returns a table that holds the confusion matrix and cost matrix information contained in a value of type DM_ClasTestResult or DM_ClasModel. If the value is of type DM_ClasModel, then the confusion and cost matrix are returned from the validation result.

If no validation result is contained in the model, then nothing is returned if you have not specified explicitly that the confusion and cost matrix of the Classification model should be returned. For each pair of class label values, the number of test rows is provided for which the first class label value was the actual value and the second the predicted value.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getConfMatrix--(--clasTestResult--)----------------------><

Read syntax diagramSkip visual syntax diagram>>-DM_getConfMatrix--(--classificationModel--)-----------------><

Read syntax diagramSkip visual syntax diagram>>-DM_getConfMatrix--(--classificationModel--,--useTrainingModel--)-><

Parameters

clasTestResult
A value of type DM_ClasTestResult
classificationModel
A value of type DM_ClasModel
useTrainingModel
A value of type SMALLINT

Return value

The result of invoking DM_getConfMatrix is a table. Table 66 describes the data type and purpose of each column contained in this table.

Table 66. Result values for DM_getConfMatrix
Column Data type Purpose
ACTUAL VARCHAR(256) Specifies the actual values
PREDICTED VARCHAR(256) Specifies the predicted values
COUNT BIGINT
  • Training values that never occur as actual values in the test data are contained in the confusion matrix with 0 COUNT.
  • Values that never occur as predicted values for rows in the test data are contained in the confusion matrix with 0 COUNT.
COST DOUBLE Specifies the cost weight (error weight) that is used when the model was created for misclassification of a record with an actual value as the predicted value.

If neither confusion matrix nor cost matrix information is contained in clasTestResult or classificationModel, then NULL is returned.

If any of the parameters is NULL, then NULL is returned.

If useTrainingModel is 1, then the confusion matrix contained in the Classification model is returned. If useTrainingModel is 0, then the confusion matrix contained in the validation result is returned. For any other value of useTrainingModel an error is returned that the parameter is out of range. If useTrainingModel is not specified and the function is called with classificationModel, then the confusion matrix of the validation result is returned. If neither confusion matrix nor cost matrix exists, NULL is returned.

If any of the class label values in clasTestResult or classificationModel is longer than 256 characters, this value is truncated to a length of 253, and three dot characters (...) are added at the end. For example the class label value:

'POSITIVE RESPONSE. This indicates that the person has checked one of "strongly agree", "agree", or "somewhat agree". The other options on the questionnaire were "somewhat disagree", "disagree" and "completely disagree". The answers were aggregated in order to simplify the evaluation to "positive" vs. "negative".'

This class label value is shortened to:

'POSITIVE RESPONSE. This indicates that the person has checked one of "strongly agree", "agree", or "somewhat agree". The other options on the questionnaire were "somewhat disagree", "disagree" and "completely disagree". The answers were aggregated in or...'.

Table 67 shows the table that might be returned.

Table 67. Sample table returned by DM_getConfMatrix
Column Name: ACTUAL PREDICTED COUNT COST
Column Type: VARCHAR(256) VARCHAR(256) BIGINT DOUBLE
... YES YES 205,381 0.0
example rows: YES NO 5,972 1.0
... YES PERHAPS 3 3.0
... NO YES 184,102 1.0
NO NO 7,389,092 0.0
NO PERHAPS 17 1.0
PERHAPS YES 0 1.0
PERHAPS NO 0 1.0
PERHAPS PERHAPS 0 0.0

Usage

Using the confusion and cost matrix of a Classification model

DM_getCorrelations

This function returns a table containing the correlations between fields with respect to a data mining model. For each pair of fields, their correlation is given.

Notes:
  1. Pairs of fields are missing from this table if no information about their correlation is contained in the model. This is equivalent to a row with CORRELATION value NULL. This is different from a CORRELATION of 0.0, where the correlation was computed to be 0.
  2. Rows with FIELDNAME1=FIELDNAME2 are not contained in the result.
  3. Correlation is symmetrical. Only one of the pairs (columnA,columnB),(columnB,columnA) is returned.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getCorrelations--(--+-ruleModel-----------+--)-----------><
                          +-regressionModel-----+
                          +-classificationModel-+
                          '-clusteringModel-----'

Parameters

ruleModel
A value of type DM_RuleModel
regressionModel
A value of type DM_RegressionModel
classificationModel
A value of type DM_ClasModel
clusteringModel
A value of type DM_ClusteringModel

Return value

The result of invoking DM_getCorrelations is a table. Table 68 describes the data type and purpose of each column contained in this table.

Table 68. Result values for DM_getCorrelations
Column Data type Purpose
FIELDNAME1 VARCHAR(128) Contains alias names as defined in the value of type DM_MiningData, which was used in the mining task
FIELDNAME2 VARCHAR(128) Contains alias names as defined in the value of type DM_MiningData, which was used in the mining task
CORRELATION REAL If field correlation information is contained in the input model, the CORRELATION column holds values between -1 and 1 describing the correlation between the fields in FIELDNAME1 and FIELDNAME2 with respect to the model or NULL, if the information is missing for that pair of fields. A value of:
1
Means that this pair of fields correlates completely.
0
Indicates that there is no correlation.
-1
Shows an inverse correlation, high values in one field correlate with low values in the other.
Note:
Pairs of fields may be missing from this table if no information about their correlation is contained in the model. This is equivalent to a row with CORRELATION value NULL.

The resulting virtual table has the following layout. In Table 69 the first row shows the column name, the second row shows the column type, and the following rows show examples.

Table 69. Sample table returned by DM_getCorrelations
FIELDNAME1 FIELDNAME2 CORRELATION
VARCHAR(128) VARCHAR(128) REAL
REVENUE churn_probability 0.22
age age 0.78
age REVENUE 0.78
CUSTOMER_AGE churn_probability - 0.31
Note:
For supervised models (classification or regression) the target field is not contained in the table. It can be retrieved using DM_getTarget.

Examples

If the model contains the information shown in Table 70:

Table 70. An example
Correlation AGE INCOME NO_CHILDREN
AGE 1.0 unknown (not computed) 0.6
INCOME unknown (not computed) 1.0 0.0
NO_CHILDREN 0.6 0.0 1.0

The following rows are returned as shown in Table 71:

Table 71. Sample table returned by DM_getCorrelations
FIELDNAME1 FIELDNAME2 CORRELATION
AGE NO_CHILDREN 0.6
INCOME NO_CHILDREN 0.0

DM_getErrors(rowcount)

This table function retrieves complete error messages.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getErrors--(--rowcount--)--------------------------------><

Parameters

rowcount
Returns a table containing the last rowcount error messages in the IM Scoring or IM Modeling error file.

If rowcount is NULL, all error messages are returned.

Return value

The result of invoking DM_getErrors is a table. Table 72 describes the data type and purpose of each column contained in this table.

Table 72. Result values for DM_getErrors
Column Data type Purpose
ROWCOUNT INTEGER Contains the row number (can be used to order)
ERRMSG VARCHAR(1024) Contains the complete error message
ERRDATE VARCHAR(12) Contains the date formatted as in error file (system locale)
ERRTIME VARCHAR(12) Contains the time formatted as in error file (system locale)
ERRTYPE CHAR(1)
E
for error
W
for warning
I
for information
S
for severe error
THREADID INTEGER Contains the thread ID of thread writing the error
EVENT INTEGER Contains the IM Scoring or IM Modeling reason code or event ID as documented in message reference

Examples

An example is:

SELECT * FROM TABLE (IDMMX.DM_GETERRORS(5)) AS ERRORS

DM_getFields

This function returns a table that contains the signature of a model. The signature of a model is the set of all input data fields which appear in the model's internal equations and whose values are therefore needed to apply the model. For each signature field, its importance for the model may also be contained in the table. It replaces and completes the following methods or functions:

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getFields--(--+-classificationModel-+--)-----------------><
                    +-clusteringModel-----+
                    +-regressionModel-----+
                    '-ruleModel-----------'

Parameters

classificationModel
A value of type DM_ClasModel
clusteringModel
A value of type DM_ClusteringModel
regressionModel
A value of type DM_RegressionModel
ruleModel
A value of type DM_RuleModel

Return value

The result of invoking DM_getFields is a table. Table 73 describes the data type and purpose of each column contained in this table.

Table 73. Result values for DM_getFields
Column Data type Purpose
COLNAME VARCHAR(128) Contains the original column names in the database table holding the training data.
FIELDNAME VARCHAR(128) Contains alias names as defined in the PMML attributes displayName. If no alias is defined, it contains the same value as the column COLNAME.
MININGTYPE SMALLINT Is 0 for categorical and 1 for numerical fields.
IMPORTANCE REAL If field importance information is contained in the input model, the IMPORTANCE column holds values between 0 and 1 describing the contribution of this input field to the model. A value of 1 means that this field contains all the model information by itself, a value of 0 indicates that the field has no influence on the model. Otherwise, all values are NULL.

The resulting virtual table has the following layout. In Table 74 the first row shows the column name, the second row shows the column type, and the following rows show examples.

Table 74. Sample table returned by DM_getFields
COLNAME FIELDNAME MININGTYPE IMPORTANCE
VARCHAR(128) VARCHAR(128) SMALLINT REAL
REVENUE REVENUE 1 0.753
ZIPCODE zip 0 0.018
EDUCATION EDUCATION 0 0.331
CUSTOMER_AGE age 1 0.240
Note:
For supervised models (classification or regression) the target field is not contained in the table. It can be retrieved using DM_getTarget.

DM_getFields(miningData)

This function returns a table of the fields contained in a value of type DM_MiningData. It contains the column names, their alias names, and their types.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getFields--(--miningData--)------------------------------><

Parameters

miningData
A value of type DM_MiningData

Return value

The result of invoking DM_getFields(miningData) is a table. Table 75 describes the data type and purpose of each column contained in this table.

Table 75. Result values for DM_getFields(miningData)
Column Data type Purpose
COLNAME VARCHAR(128) Contains the column names.
ALIAS VARCHAR(128) Contains alias names. If no alias name is contained in miningData for a column, the column name is used as the alias name.
TYPENAME VARCHAR(16) Is the name of the type.
Note:
If miningData has a value of NULL , then NULL is returned.

Table 76 shows the table that might be returned.

Table 76. Sample table returned by DM_getFields(miningData)
Column Name: COLNAME ALIAS TYPENAME
Column Type: VARCHAR(128) VARCHAR(128) VARCHAR(16)
... CUSTOMER_AGE age INTEGER
Example rows: CHURN CHURN CHAR
... REVENUE REVENUE DECIMAL
... ZIPCODE zip INTEGER

DM_getGainsChart

This function returns a table containing gains chart information from a Classification or Regression model.

Syntax

Syntax for regression

Read syntax diagramSkip visual syntax diagram>>-DM_getGainsChart--(--+-regressionModel-+--)-----------------><
                        '-regTestResult---'

Syntax for classification

Read syntax diagramSkip visual syntax diagram>>-DM_getGainsChart--(--+-classificationModel-+--,--targetValue--)-><
                        '-clasTestResult------'

Parameters

regressionModel
A value of type DM_RegressionModel
regTestResult
A value of type DM_RegTestResult
classificationModel
A value of type DM_ClasModel
clasTestResult
A value of type DM_ClasTestResult
targetValue
A value of type VARCHAR(1024) containing a class label for the target field.

If targetValue does not occur in input, an error is returned: "wrong target".

Return value

Return value for regression

The result of invoking DM_getGainsChart is a table. Table 77 describes the data type and purpose of each column contained in this table.

Table 77. Result values for DM_getGainsChart
Column Data type Purpose
ROWCOUNT BIGINT Each row in the output table represents a set of validation or test records. It is one of the subsets of all records containing ROWCOUNT records for which the sum of the predicted values is the maximum. Consider all the records ordered by predicted value in descending order and select the first ROWCOUNT records. The ROWCOUNT column contains the number of records in the subset.

The biggest value of ROWCOUNT is the size of the test or validation data.

SUMACTUAL DOUBLE Contains the sum of the actual target field values (on validation or test data)
THRESHOLD DOUBLE Contains the smallest predicted value for the subset
Note:
The table may be empty if the gains chart information is not contained in input.

The resulting virtual table has the following layout. In Table 78 the first row shows the column name, the second row shows the column type, and the following rows show examples.

Table 78. Sample table returned by DM_getGainsChart
ROWCOUNT SUMACTUAL THRESHOLD
BIGINT DOUBLE DOUBLE
10,000 1,000,000 81
20,000 1,800,000 72
40,000 2,800,000 38
80,000 2,600,000 -110

Return value for classification

The result of invoking DM_getGainsChart is a table. Table 79 describes the data type and purpose of each column contained in this table.

Table 79. Result values for DM_getGainsChart
Column Data type Purpose
ROWCOUNT BIGINT

Each row in the output table represents a set of validation or test records. It is one of the subsets of all records containing ROWCOUNT records for which the sum of confidences with respect to targetValue is the maximum. Consider all the records ordered by confidence in predicting targetValue in descending order and select the first ROWCOUNT records. The ROWCOUNT column contains the number of records in the subset.

The biggest value of ROWCOUNT is the size of the test or validation data.

SUMACTUAL DOUBLE Contains the number of records with actual value targetValue (on validation or test data)
THRESHOLD DOUBLE Contains the smallest confidence with respect to targetValue for the subset
Note:
The table may be empty if the gains chart information is not contained in input.

The resulting virtual table has the following layout. In Table 80 the first row shows the column name, the second row shows the column type, and the following rows show examples.

Table 80. Sample table returned by DM_getGainsChart
ROWCOUNT SUMACTUAL THRESHOLD
BIGINT DOUBLE DOUBLE
10,000 9,200 0.83
20,000 16,000 0.72
40,000 18,000 0.41
80,000 31,000 0

Usage

Checking gains chart information

DM_getMdlQuality

This function returns a value (0 <= value <= 1) that indicates the model's quality as it has been determined in a preceding validation or test run. A high value indicates a "good" model.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getMdlQuality--(--+-ruleModel-----------+--)-------------><
                        +-classificationModel-+
                        +-clusteringModel-----+
                        +-regressionModel-----+
                        +-clasTestResult------+
                        '-regTestResult-------'

Parameters

ruleModel
A value of type DM_RuleModel
classificationModel
A value of type DM_ClasModel
clusteringModel
A value of type DM_ClusteringModel
regressionModel
A value of type DM_RegressionModel
clasTestResult
A value of type DM_ClasTestResult
regTestResult
A value of type DM_RegTestResult

Return value

Related concepts

Quality concepts

Usage

Checking the overall quality

DM_getNumClusters

This function returns the number of clusters contained in a value of type DM_ClusteringModel.

Note:
It is recommended that you use the DM_getClusters function instead of a combination of this function together with DM_getClusterID and DM_getClusterName.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getNumClusters--(--clusteringModel--)--------------------><

Parameters

clusteringModel
A value of type DM_ClusteringModel

Return value

DM_getNumRules

This function returns the number of rules contained in a value of type DM_RuleModel.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getNumRules--(--ruleModel--)-----------------------------><

Parameters

ruleModel
A value of type DM_RuleModel

Return value

DM_getNumTransacts

This function returns the number of transactions contained in the dataset used to build the model of type DM_RuleModel. The number of transactions can be used to determine absolute support of individual rules in conjunction with DM_getRules.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getNumTransacts--(--ruleModel--)-------------------------><

Parameters

ruleModel
A value of type DM_RuleModel

Return value

The result of invoking DM_getNumTransacts is an INTEGER specifying the number of transactions contained in the dataset used to build ruleModel.

DM_getPredAccuracy

This function returns a value that describes for:

Regression
Whether the predicted values match the actual values of the target field within the incertitude due to statistical fluctuations and noise in the input data values.

It returns a value between 0 and 1 which indicates whether the model produces systematic deviations between predicted values and actual target values. A value of 1 means that the model produces no systematic error, a value of 0 means that the model produces a systematic error as large as that one produced by always predicting the mean target field value.

This function is related to DM_getRegRSquared and DM_getRMSE.

Classification
The model's accuracy to predict a specific value of the target field. The value returned is calculated by:
(number of correct prediction of the specified value) /
(number of all predictions of specified value)
This means that the accuracy value provides the probability that a prediction of the specified value is correct. For example, a value of 0.8 means that 80 percent of the records for which the specified value is predicted are correctly classified, 20 percent of those records actually have a value different from the value predicted.

This function is related to DM_getRegRSquared and DM_getRMSE.

Syntax

Syntax for regression

Read syntax diagramSkip visual syntax diagram>>-DM_getPredAccuracy--(--+-regressionModel-+--)---------------><
                          '-regTestResult---'

Syntax for classification

Read syntax diagramSkip visual syntax diagram>>-DM_getPredAccuracy--(--+-classificationModel-+--,--targetFieldValue--)-><
                          '-clasTestResult------'

Parameters

regressionModel
A value of type DM_RegressionModel
regTestResult
A value of type DM_RegTestResult
classificationModel
A value of type DM_ClasModel
clasTestResult
A value of type DM_ClasTestResult
targetFieldValue
A value of type VARCHAR indicating the value of the target field

Return value

Return value for regression

Return value for classification

Note:
The accuracy value depends not only on the model itself but also on the validation or test data used. Even for a high accuracy value, it can only be assumed that model application produces accurate results, if the application data is similar to the validation or test data used.

Related concepts

Quality concepts

Usage

Deviations between predicted values and actual target values

DM_getPredError

This function returns the prediction error value contained in the value of type DM_RegTestResult.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getPredError--(--regTestResult--)------------------------><

Parameters

regTestResult
A value of type DM_RegTestResult

Return value

The result of the invocation DM_getPredError is the DOUBLE PRECISION value representing the aggregated error computed during the test of a Regression model.

DM_getRankQuality

This function is available for:

Regression:
It returns a value between 0 and 1, which:
  • Compares the order of the validation data records, when sorted by the predicted values, with the order of the same data records when sorted by the actual values of the target field.
  • Corresponds to the ratio between the area under this model's gains chart curve and the area under the best possible gains chart curve (for given test or validation data).

This information can be used, for example, for selecting the top N customers in a campaign if the exact values are not important.

Classification:
It returns a value which compares the order of the training data records, when sorted by their confidence values, with a random order of the same data records for a specified value of the target field.

This information can be used, for example, to find out those customers in a mailing campaign who are the most likely to respond.

The formula to calculate this value is:

value = area(model) / area(optimum)

where:

area(model)
Is the area between the gains chart curve for the model and the straight line between the start point and the end point of the gains chart curve. Records are ranked by decreasing:
  • Predicted target values on the x-axis and the straight line corresponding to random ordering of the data records.
  • Confidence values on the x-axis and the straight line corresponding to random ordering of the data records.
area(optimum)
Is the same measure which arises if the data records are ranked by decreasing actual target values on the x-axis, starting with those records with the specified target value.

If area(optimum) equals 0, NULL is returned. This happens in a DM_ClasTestResult when all records tested have the same (actual) value.

The following values are possible:

1
Is assigned to an optimal model, by which the records are ordered exactly in the order of their actual values.
Positive values
Indicate that the model is better than random.
0
Is returned for models that work no better than random ordering.
Negative values
Indicate that the ordering is worse than random.
-1
Means that the order is inverse to the actual values.

Syntax

Syntax for regression

Read syntax diagramSkip visual syntax diagram>>-DM_getRankQuality--(--+-regressionModel-+--)----------------><
                         '-regTestResult---'

Syntax for classification

Read syntax diagramSkip visual syntax diagram>>-DM_getRankQuality--(--+-classificationModel-+--,--targetFieldValue--)-><
                         '-clasTestResult------'

Parameters

regressionModel
A value of type DM_RegressionModel
regTestResult
A value of type DM_RegTestResult
classificationModel
A value of type DM_ClasModel
clasTestModel
A value of type DM_ClasTestResult
targetFieldValue
A value of type VARCHAR indicating the value of the target field

Return value

Return value for regression

Return value for classification

Related concepts

Quality concepts

Usage

Comparing the order of data records

DM_getRegMdlName

This function returns the name of a Regression model of type DM_RegressionModel.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getRegMdlName--(--regressionModel--)---------------------><

Parameters

regressionModel
A Regression model of the type DM_RegressionModel

Return value

The return value is the name of the Regression model as a VARCHAR value.

DM_getRegMdlSpec

This function returns the DM_LogicalDataSpec value representing the set of fields needed for an application of the Regression model. The field names contained in the DM_LogicalDataSpec value are the field names of the DM_LogicalDataSpec value used for building the Regression model. To test the model, you must also call the function DM_getRegTarget to complete the set of fields needed for a test run.

Note:
It is recommended that you use the DM_getFields function instead of this function as described in DM_getFields.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getRegMdlSpec--(--regressionModel--)---------------------><

Parameters

regressionModel
A value of type DM_RegressionModel

Return value

The return value is the DM_LogicalDataSpec value representing the set of fields needed for an application of the Regression model.

Usage

Executing a test run on the mining model

DM_getRegRSquared

This function returns the squared Pearson correlation coefficient of the Regression model computed during the training phase using the validation data specified in the DM_RegBldTask value used to generate the model.

This coefficient measures the correlation between the prediction error on verification data and the actual target values.

Note:
r2=0 means that the prediction error and the target field values are uncorrelated, r2=1 means that the two values are perfectly (positively or negatively) correlated.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getRegRSquared--(--regressionModel--)--------------------><

Parameters

regressionModel
A value of type DM_RegressionModel

Return value

DM_getRegTarget

This function returns the name of the target field used when training the Regression model. The name is the appropriate column alias name of the DM_MiningData value used for building the model.

If the model was produced by means of IM Modeling, the target field name is the name that was set by means of the method DM_setRegTarget in the DM_RegSettings value.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getRegTarget--(--regressionModel--)----------------------><

Parameters

regressionModel
A value of type DM_RegressionModel

Return value

The target field name is returned as a value of type VARCHAR.

Usage

Executing a test run on the mining model

DM_getRegTask

This function returns the DM_RegBldTask value used to create this model.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getRegTask--(--regressionModel--)------------------------><

Parameters

regressionModel
A value of type DM_RegressionModel

Return value

The result of the invocation DM_getRegTask is determined as follows:

DM_getReliability

This function returns a value that indicates the model's estimated capability to correctly predict unknown data, compared to its prediction capability on the training data.

It can have a value between 0 and 1, which describes how well the model performs when applied to test or validation data (which was not used for training before) compared to the model's performance on the training data. Values considerably smaller than 1 indicate that the model is overtrained.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getReliability--(--+-model------+--)---------------------><
                         '-testResult-'

Parameters

model
A value of type DM_RegressionModel or DM_ClasModel
testResult
A value of type DM_RegTestResult or DM_ClasTestResult

Return value

Return value for regression

Note:
The reliability value does not only depend on the model itself, but also on the validation or test data used. Even for a high reliability value, it can only be assumed that model application produces reliable results if the application data is similar to the validation or test data used.

Return value for classification

Related concepts

Quality concepts

Usage

Capability to correctly predict unknown data

Examples

DM_getMdlQuality

DM_getRMSE

This function returns the root mean squared error between actual and predicted target field values on the test data. It returns a value in absolute units (comparable to the original range in the target field) to describe the expected deviation of a predicted value from the actual value.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getRMSE--(--+-regressionModel-+--)-----------------------><
                  '-regTestResult---'

Parameters

regressionModel
A value of type DM_RegressionModel
regTestResult
A value of type DM_RegTestResult

Return value

Note:
The root mean squared error does not only depend on the model itself but also on the validation or test data used. Even for a small value, it can only be assumed that model application produces accurate results if the application data is similar to the validation or test data used.

Related concepts

Quality concepts

Usage

Identifying the deviation between predicted and actual target values

DM_getRuleBodies

This function returns a table containing the bodies of rules in a value of type DM_RuleModel.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getRuleBodies--(--ruleModel--)---------------------------><

Parameters

ruleModel
A value of type DM_RuleModel

Return value

The result of invoking DM_getRuleBodies is a table. Table 81 describes the data type and purpose of each column contained in this table.

Table 81. Result values for DM_getRuleBodies
Column Data type Purpose
BODYID INTEGER Contains the ID of the body. Each value in BODYID appears in n rows, where n is the size of the item set. There is a distinct entry in BODYID for each item set appearing in a rule of ruleModel.
Note:
The table contains each BODYID that appears in a rule. However, not every BODYIDthat is contained in the table also appears in a rule.
ITEMNAME VARCHAR(1024) The item name after name mapping (if any)
ITEM VARCHAR(1024) The original item name before name mapping

Examples

An item set could be, for example:

[shoes][coat][hat]

The resulting virtual table has the following layout. In Table 82 the first row shows the body ID, the item name, and the item, and the following rows show examples.

Table 82. Sample table returned by DM_getRuleBodies
BODYID ITEMNAME ITEM
17 2576901 shoes
17 1288737 coat
17 1298130 hat

This example is related to the example shown in DM_getRules.

Note:
If any of the character values for items or item names in ruleModel is longer than 1024 characters, this value is truncated to 1021, and three dot characters (...) are added at the end.

DM_getRuleMdlName

This function returns the name of an Associations model of type DM_RuleModel.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getRuleMdlName--(--ruleModel--)--------------------------><

Parameters

ruleModel
An Associations model of type DM_RuleModel

Return value

The return value is the name of the Associations model as a VARCHAR value.

DM_getRules

This function returns a table containing the rules in a value of type DM_RuleModel.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getRules--(--ruleModel--)--------------------------------><

Parameters

ruleModel
A value of type DM_RuleModel

Return value

The result of invoking DM_getRules is a table. Table 83 describes the data type and purpose of each column contained in this table.

Table 83. Result values for DM_getRules
Column Data type Purpose
ID INTEGER Is a number generated to identify the rules.
HEADNAME VARCHAR(1024) Contains the head item of the rule after name mapping (if any).
HEAD VARCHAR(1024) Uses the original item before name mappings.
BODYID INTEGER Is a generated identifier to allow joining the resulting table with a table generated by DM_getRuleBodies.
Note:
Values of BODYID may appear in several rows, if there are rules with identical sets of items in their bodies.
BODYTEXT VARCHAR(4096) Is a concatenation of the names of all body items separated by the term 'AND'. The body items and their names can be determined using the table DM_getRuleBodies.
LENGTH SMALLINT Is a count of all items in the head and body.
SUPPORT REAL Is the rule support and contains percentage values between 0.0 and 100.0.

The support of an association rule is the percentage of groups that contain all of the items listed in that association rule.

CONFIDENCE REAL Is the rule confidence and contains percentage values between 0.0 and 100.0.

The confidence of an association rule is a percentage value that shows how frequently the rule head occurs among all the groups containing the rule body.

LIFT REAL Indicates how much more confidence the rule has as might be expected if the items were statistically independent; the value is given as a positive factor.

The lift of a rule is the ratio of confidence to the expected confidence. It indicates how much more confidence the rule has as might be expected if the items were statistically independent.

Notes:
  1. There is a row in the result table for each rule in model whose head consists of exactly one item. For these rules, the length (total number of items), as well as the support, confidence, and lift values, are available in the appropriate columns.
  2. For each complex rule (that is, a rule with more than one head item), there is one table entry per head item representing a simple derived rule with the same body but only one of the head items. In this case, the length is provided, but support, confidence, and lift have NULL values. All entries derived from the same complex rule will have the same rule ID.
  3. Most association algorithms do not generate rules with more than one head item. In particular the algorithm in DB2 IM Modeling and DB2 IM for Data do not generate complex rules.

Examples

If, for example, model contains the rules:

[shoes][coat][hat] ==> [scarf]

and

[shoes][coat][hat] ==> [scarf][blouse]

There will be three rows in the result table as shown in Table 84.

Table 84. Sample table returned by DM_getRules
ID HEADNAME HEAD BODYID BODYTEXT LENGTH SUPPORT CONFIDENCE LIFT
1 scarf 1271180 17 shoes AND coat AND hat 4 5.8 82.0 0.7
2 scarf 1271180 17 shoes AND coat AND hat 5 NULL NULL NULL
2 blouse 2222333 17 shoes AND coat AND hat 5 NULL NULL NULL

This example is related to the example shown in DM_getRuleBodies.

Note:
If any of the character values in ruleModel is larger than the number of characters allowed (1024 for head items and 4096 for the body text), this value will be truncated to the allowed length -3, and three dot characters (...) will be added at the end.

DM_getRuleTask

This function returns the DM_RuleBldTask value used to create a specified model.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getRuleTask--(--ruleModel--)-----------------------------><

Parameters

ruleModel
A value of type DM_RuleModel

Return value

DM_getTreeRules

This function returns a table that contains one record for each node of a Tree Classification model. Each record contains the node ID, as presented by the visualizer, and a textual description of the rule that defines the node. In addition to this, the predicted class, the confidence, and the depth of the node are provided.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getTreeRules--(----classificationModel----)--------------><

Parameters

classificationModel
A value of type DM_ClasModel

Return value

Examples

The layout of the virtual table is as follows. In Table 86 the first row shows the column name, the second row shows the column type, and the following rows show examples.

Table 86. Sample table returned by DM_getTreeRules
NODEID ISLEAF CLASS CONFIDENCE SIZE DEPTH CONDITION
VARCHAR(128) SMALLINT VARCHAR(256) REAL BIGINT SMALLINT VARCHAR(32K)
1 0 NO 0.51 512,606 1 TRUE
1.1 0 NO 0.62 248,384 2 age<=34
1.1.2 0 YES 0.55 123,811 3 age<=34 AND color IS IN (red, green)
1.1.2.1 0 YES 0.67 75,589 4 23<=age < 34 AND color IS IN (red, green)
1.1.2.1.2 0 YES 0.70 32,066 5 23<=age<34 AND color IS IN (red, green) AND income>23200
1.1.2.1.2.1 1 NO 0.73 15,754 6 23<=age<34 AND color=blue AND income>23200
1.1.2.1.2.2 1 YES 0.92 16,312 6 23<=age<34 AND color IS IN (red, green, blue) AND income>23200

DM_isValidated

This function indicates if validation data is used during the training phase.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_isValidated--(--+-classificationModel-+--)---------------><
                      '-regressionModel-----'

Parameters

classificationModel
A value of type DM_ClasModel
regressionModel
A value of type DM_RegressionModel

Return value

The function returns:

1
If validation data was used during the training phase.
0
Otherwise.

Stored procedures reference

This chapter contains full descriptions of all the stored procedures provided with IM Modeling. They are presented in alphabetical order of the procedure names. For a listing in the order of the data types that they act on, see Overview of IM Modeling's database objects.

For instructions on how to use the database objects presented here, see Using IM Modeling.

DM_buildClasModel,
DM_buildClasModelCmd

Each of the three versions of this procedure that are described here builds and stores a value of type DM_ClasModel in a specified table with a specified ID. If a model with the specified ID already exists in the table, it is overwritten. The table must already exist.

Syntax

Version 1

Read syntax diagramSkip visual syntax diagram>>-DM_buildClasModel--(--task_fullyQualifiedTableName--,--task_columnName--,-->

>--task_idColumnName--,--task_id--,--callid--,--fullyQualifiedTableName--,-->

>--modelColumnName--,--idColumnName--,--id--)------------------><

Version 2

Read syntax diagramSkip visual syntax diagram>>-DM_buildClasModelCmd--(--task_fullyQualifiedTableName--,--task_columnName--,-->

>--task_idColumnName--,--task_id--,--fullyQualifiedTableName--,--modelColumnName--,-->

>--idColumnName--,--id--)--------------------------------------><

Version 3

Read syntax diagramSkip visual syntax diagram>>-DM_buildClasModel--(--clasTask--,--callid--,--fullyQualifiedTableName--,-->

>--modelColumnName--,--idColumnName--,--id--)------------------><

Parameters

task_fullyQualifiedTableName
A value of type VARCHAR that specifies the fully-qualified name of the table from which you want to retrieve the task.
task_ColumnName
A value of type VARCHAR that specifies a column in the specified table. The column must be of the type DM_ClasBldTask.
task_idColumnName
A value of type VARCHAR that specifies a column in the specified table. The column must be of the character data type, and is used to retrieve the task using the specified task_id.
task_id
A value of type VARCHAR that specifies the identifier for the task.
clasTask
A value of type CLOB that was exported from a DM_ClasBldTask value.
callid
A value of type CHAR(19) FOR BIT DATA. Specify a value if you want to use a call ID for writing error and progress information. If you do not want to use a call ID, you must specify NULL.
fullyQualifiedTableName
A value, of type VARCHAR, that specifies the fully-qualified name of the table in which you want to store the built model.
modelColumnName
A value, of type VARCHAR, that specifies a column in the specified table. The column must be of the type DM_ClasModel.
idColumnName
A value, of type VARCHAR, that specifies a column in the specified table. The column must be of the character data type, and is used to contain an identifier for the model.
id
A value, of type VARCHAR, that specifies an identifier for the model.

Return value

Exceptions are raised in the following cases:

DM_buildClusModel,
DM_buildClusModelCmd

Each of the three versions of this procedure that are described here builds and stores a value of type DM_ClusteringModel in a specified table with a specified ID. If a model with the specified ID already exists in the table, it is overwritten. The table must already exist.

Syntax

Version 1

Read syntax diagramSkip visual syntax diagram>>-DM_buildClusModel--(--task_fullyQualifiedTableName--,--task_columnName--,-->

>--task_idColumnName--,--task_id--,--callid--,--fullyQualifiedTableName--,-->

>--modelColumnName--,--idColumnName--,--id--)------------------><

Version 2

Read syntax diagramSkip visual syntax diagram>>-DM_buildClusModelCmd--(--task_fullyQualifiedTableName--,--task_columnName--,-->

>--task_idColumnName--,--task_id--,--fullyQualifiedTableName--,--modelColumnName--,-->

>--idColumnName--,--id--)--------------------------------------><

Version 3

Read syntax diagramSkip visual syntax diagram>>-DM_buildClusModel--(--clusTask--,--callid--,--fullyQualifiedTableName--,-->

>--modelColumnName--,--idColumnName--,--id--)------------------><

Parameters

task_fullyQualifiedTableName
A value of type VARCHAR that specifies the fully-qualified name of the table from which you want to retrieve the task.
task_ColumnName
A value of type VARCHAR that specifies a column in the specified table. The column must be of the type DM_ClusBldTask.
task_idColumnName
A value of type VARCHAR that specifies a column in the specified table. The column must be of the character data type, and is used to retrieve the task using the specified task_id.
task_id
A value of type VARCHAR that specifies the identifier for the task.
clusTask
A value of type CLOB that was exported from a DM_ClusBldTask value.
callid
A value of type CHAR(19) FOR BIT DATA. Specify a value if you want to use a call ID for writing error and progress information. If you do not want to use a call ID, you must specify NULL.
fullyQualifiedTableName
A value, of type VARCHAR, that specifies the fully-qualified name of the table in which you want to store the built model.
modelColumnName
A value, of type VARCHAR, that specifies a column in the specified table. The column must be of the type DM_ClusteringModel.
idColumnName
A value, of type VARCHAR, that specifies a column in the specified table. The column must be of the character data type, and is used to contain an identifier for the model.
id
A value, of type VARCHAR, that specifies an identifier for the model.

Return value

Exceptions are raised in the following cases:

DM_buildRegModel,
DM_buildRegModelCmd

Each of the three versions of this procedure that are described here builds and stores a value of type DM_RegressionModel in a specified table with a specified ID. If a model with the specified ID already exists in the table, it is overwritten. The table must already exist.

Syntax

Version 1

Read syntax diagramSkip visual syntax diagram>>-DM_buildRegModel--(--task_fullyQualifiedTableName--,--task_columnName--,-->

>--task_idColumnName--,--task_id--,--callid--,--fullyQualifiedTableName--,-->

>--modelColumnName--,--idColumnName--,--id--)------------------><

Version 2

Read syntax diagramSkip visual syntax diagram>>-DM_buildRegModelCmd--(--task_fullyQualifiedTableName--,--task_columnName--,-->

>--task_idColumnName--,--task_id--,--fullyQualifiedTableName--,--modelColumnName--,-->

>--idColumnName--,--id--)--------------------------------------><

Version 3

Read syntax diagramSkip visual syntax diagram>>-DM_buildRegModel--(--regTask--,--callid--,--fullyQualifiedTableName--,-->

>--modelColumnName--,--idColumnName--,--id--)------------------><

Parameters

task_fullyQualifiedTableName
A value of type VARCHAR that specifies the fully-qualified name of the table from which you want to retrieve the task.
task_ColumnName
A value of type VARCHAR that specifies a column in the specified table. The column must be of the type DM_RegBldTask.
task_idColumnName
A value of type VARCHAR that specifies a column in the specified table. The column must be of the character data type, and is used to retrieve the task using the specified task_id.
task_id
A value of type VARCHAR that specifies the identifier for the task.
regTask
A value of type CLOB that was exported from a DM_RegBldTask value.
callid
A value of type CHAR(19) FOR BIT DATA. Specify a value if you want to use a call ID for writing error and progress information. If you do not want to use a call ID, you must specify NULL.
fullyQualifiedTableName
A value, of type VARCHAR, that specifies the fully-qualified name of the table in which you want to store the built model.
modelColumnName
A value, of type VARCHAR, that specifies a column in the specified table. The column must be of the type DM_RegressionModel.
idColumnName
A value, of type VARCHAR, that specifies a column in the specified table. The column must be of the character data type, and is used to contain an identifier for the model.
id
A value, of type VARCHAR, that specifies an identifier for the model.

Return value

Exceptions are raised in the following cases:

The following exceptions are raised for version 2 and version 3 if:

DM_buildRuleModel,
DM_buildRuleModelCmd

Each of the three versions of this procedure that are described here builds and stores a value of type DM_RuleModel in a specified table with a specified ID. If a model with the specified ID already exists in the table, it is overwritten. The table must already exist.

Syntax

Version 1

Read syntax diagramSkip visual syntax diagram>>-DM_buildRuleModel--(--task_fullyQualifiedTableName--,--task_columnName--,-->

>--task_idColumnName--,--task_id--,--callid--,--fullyQualifiedTableName--,-->

>--modelColumnName--,--idColumnName--,--id--)------------------><

Version 2

Read syntax diagramSkip visual syntax diagram>>-DM_buildRuleModelCmd--(--task_fullyQualifiedTableName--,--task_columnName--,-->

>--task_idColumnName--,--task_id--,--fullyQualifiedTableName--,--modelColumnName--,-->

>--idColumnName--,--id--)--------------------------------------><

Version 3

Read syntax diagramSkip visual syntax diagram>>-DM_buildRuleModel--(--ruleTask--,--callid--,--fullyQualifiedTableName--,-->

>--modelColumnName--,--idColumnName--,--id--)------------------><

Parameters

task_fullyQualifiedTableName
A value of type VARCHAR that specifies the fully-qualified name of the table from which you want to retrieve the task.
task_ColumnName
A value of type VARCHAR that specifies a column in the specified table. The column must be of the type DM_RuleBldTask.
task_idColumnName
A value of type VARCHAR that specifies a column in the specified table. The column must be of the character data type, and is used to retrieve the task using the specified task_id.
task_id
A value of type VARCHAR that specifies the identifier for the task.
ruleTask
A value of type CLOB that was exported from a DM_RuleBldTask value.
callid
A value of type CHAR(19) FOR BIT DATA. Specify a value if you want to use a call ID for writing error and progress information. If you do not want to use a call ID, you must specify NULL.
fullyQualifiedTableName
A value, of type VARCHAR, that specifies the fully-qualified name of the table in which you want to store the built model.
modelColumnName
A value, of type VARCHAR, that specifies a column in the specified table. The column must be of the type DM_RuleModel.
idColumnName
A value, of type VARCHAR, that specifies a column in the specified table. The column must be of the character data type, and is used to contain an identifier for the model.
id
A value, of type VARCHAR, that specifies an identifier for the model.

Return value

Exceptions are raised in the following cases:

DM_cancelTask

This stored procedure cancels a training or test run. Mining runs started by the following procedures can be canceled: A call ID and a progress information table must have been specified when one of the build or test stored procedures was being called.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_cancelTask--(--progressTableName--,--callId--)-----------><

Parameters

progressTableName
A value of type VARCHAR. This must be the same table name as the one specified in the task parameter of the corresponding build or test stored procedure.
callId
A value of type CHAR(19) FOR BIT DATA. This must be the same call ID as the one specified in the corresponding build or test stored procedure.

Return value

The stored procedure returns an error message if any of the following is true:

DM_getEnv

This procedure lists all the environment variables in the running agent process that have the IDM_ prefix.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getEnv--(--list--)---------------------------------------><

Parameters

list
The OUT parameter, of type VARCHAR

Return value

The return value is a string that concatenates all variable=value entries of the environment, separated by an end-of-line character. Only those variables that have the prefix IDM_ are selected.

Notes:
  1. DM_setEnv and DM_getEnv are intended to set environment variables in the DB2 db2fmp process. The database must have been enabled in fenced mode. For more information refer to The idmenabledb command. If the database was enabled in unfenced mode, calling these procedures may not have the intended effect.
  2. The database manager configuration variable keepfenced (DB2 V8) must be set to the default value yes.

Examples

To display the environment variables from the command line, enter this call:

CALL IDMMX.DM_getEnv(?)

If you did not set any of the environment variables recognized by IM Scoring or IM Modeling (IDM_MX_ERRORFILE, IDM_MX_TRACEFILE, IDM_MX_TRACELEVEL, IDM_MX_MAX_OPEN_MODELS) before, the resulting list of variables will be empty.

Note:
If you have installed IM for Data, you see some variables of IM for Data, however, these are not relevant for IM Scoring or IM Modeling.

DM_getMiningData

This procedure returns the column names and column types of a specified table in an XML string.

Note:
This function is no longer required because DM_defMiningData automatically retrieves column information. For more information refer to DM_defMiningData.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_getMiningData--(--fullyQualifiedTableName--,--XMLString--)-><

Parameters

fullyQualifiedTableName
A value, of type VARCHAR, that specifies the fully-qualified name of the table for which you want to get column information in an XML string
XMLString
An XML string, as a CLOB value, containing the table name, column definitions with names, aliases, and SQL types

The following SQL types are supported as the SqlType attribute in the XML string:

CHAR, VARCHAR, LONG VARCHAR, TIME, DATE, TIMESTAMP, SMALLINT, INTEGER, DOUBLE, FLOAT, DECIMAL, BIGINT, REAL

If columns are found in the table that have LOB or GRAPHIC data types in all variations, these columns are omitted in the XML string.

The alias is always set to the same name as the column name.

Return value

Exceptions are raised in the following cases:

DM_setEnv

This procedure sets environment variables that are used by IM Scoring and IM Modeling in the running agent process.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DM_setEnv--(--variable--,--value--)-------------------------><

Parameters

variable
The name of the variable to be defined, of type VARCHAR
value
The value of the variable (for example, an absolute path name), of type VARCHAR

Return value

The procedure checks that the variable name has the prefix IDM_. This ensures that you change only variables specific to IM Modeling or IM Scoring.

If value is NULL, the variable with the name variable is removed from the environment of the process.

Notes:
  1. DM_setEnv and DM_getEnv are intended to set environment variables in the DB2 db2fmp process. The database must have been enabled in fenced mode. For more information refer to The idmenabledb command. If the database was enabled in unfenced mode, calling these procedures may not have the intended effect.
  2. The database manager configuration variable keepfenced (DB2 V8) must be set to the default value yes.

Examples

The following call sets the name and directory of the error file:

CALL IDMMX.DM_setEnv('IDM_MX_ERRORFILE', '/tmp/myerrors.log')

The error file is set to its default value:

CALL IDMMX.DM_setEnv('IDM_MX_ERRORFILE', NULL)

DM_testClasModelD (using mining data),
DM_testClasModelCmdD

Each of the two versions of this procedure that are described here tests a Classification model on new data, and stores the result of the test, as a value of type DM_ClasTestResult, in a table with a specified ID. If a result with the specified ID already exists in the table, it is overwritten. The table must already exist.

Syntax

Version 1

Read syntax diagramSkip visual syntax diagram>>-DM_testClasModelCmdD--(--dataTableName--,--dataColumnName--,-->

>--dataIDColumnName--,--dataID--,--modelTableName--,--modelColumnName--,-->

>--modelIdColumnName--,--modelId--,--resultTableName--,--resultColumnName--,-->

>--resultIdColumnName--,--resultId--)--------------------------><

Version 2

Read syntax diagramSkip visual syntax diagram>>-DM_testClasModelD--(--miningData--,--modelTableName--,--modelColumnName--,-->

>--modelIdColumnName--,--modelId--,--resultTableName--,--resultColumnName--,-->

>--resultIdColumnName--,--resultId--)--------------------------><

Parameters

dataTableName
A value of type VARCHAR that specifies the fully-qualified name of the table that contains the DM_MiningData value. The DM_MiningData value specifies the physical data that should be used to test the model. The alias names in the DM_MiningData value must match field names that are contained in the Classification model.
dataColumnName
A value of type VARCHAR that specifies a column in dataTableName. The column must be of the type DM_MiningData; it contains the mining data that should be used to test the model.
dataIdColumnName
A value of type VARCHAR that specifies a column in dataTableName. The column must be of the character data type; it contains the identifier for the mining data value.
dataId
A value of type VARCHAR that specifies the identifier of the mining data.
miningData
A value of type CLOB that was exported from a DM_MiningData value. It specifies the physical data that should be used to test the model. The alias names in the DM_MiningData value must match field names that are contained in the classification model.
modelTableName
A value of type VARCHAR that specifies the fully-qualified name of the table that contains the Classification model.
modelColumnName
A value of type VARCHAR that specifies a column in modelTableName. The column must be of the type DM_ClasModel; it contains the Classification model to be tested.
modelIdColumnName
A value of type VARCHAR that specifies a column in modelTableName. The column must be of character data type; it contains the identifier for the Classification model.
modelId
A value of type VARCHAR that specifies the identifier of the Classification model.
resultTableName
A value of type VARCHAR that specifies the fully-qualified name of the table in which you want the test result to be written.
resultColumnName
A value of type VARCHAR that specifies a column in resultTableName. The column must be of the type DM_ClasTestResult; it contains the result of the test run after the stored procedure has finished.
resultIdColumnName
A value of type VARCHAR that specifies a column in resultTableName. The column must be of the character data type; it is used to store an identifier of the test result.
resultId
A value of type VARCHAR that specifies the identifier for the test result.

Return value

Exceptions are raised in the following cases:

Usage

Executing a test run on the mining model

DM_testClasModelT (using a test task),
DM_testClasModelCmdT

Each of the three versions of this procedure that are described here tests a Classification model, using a Classification test task. The procedure stores a value of type DM_ClasTestResult in a specified table with a specified ID. If a result with the specified ID already exists in the table, it is overwritten. The table must already exist.

Syntax

Version 1

Read syntax diagramSkip visual syntax diagram>>-DM_testClasModelT--(--task_fullyQualifiedTableName--,--task_columnName--,-->

>--task_idColumnName--,--task_id--,--callid--,--fullyQualifiedTableName--,-->

>--modelColumnName--,--idColumnName--,--id--)------------------><

Version 2

Read syntax diagramSkip visual syntax diagram>>-DM_testClasModelCmdT--(--task_fullyQualifiedTableName--,--task_columnName--,-->

>--task_idColumnName--,--task_id--,--fullyQualifiedTableName--,--modelColumnName--,-->

>--idColumnName--,--id--)--------------------------------------><

Version 3

Read syntax diagramSkip visual syntax diagram>>-DM_testClasModelT--(--clasTestTask--,--callid--,--fullyQualifiedTableName--,-->

>--modelColumnName--,--idColumnName--,--id--)------------------><

Parameters

task_fullyQualifiedTableName
A value of type VARCHAR that specifies the fully-qualified name of the table from which you want to retrieve the task.
task_ColumnName
A value of type VARCHAR that specifies a column in the specified table. The column must be of the type DM_ClasBldTask.
task_idColumnName
A value of type VARCHAR that specifies a column in the specified table. The column must be of the character data type, and is used to retrieve the task using the specified task_id.
task_id
A value of type VARCHAR that specifies the identifier for the task.
clasTestTask
A value of type CLOB that was exported from a DM_ClasTestTask value
callid
A value of type CHAR(19) FOR BIT DATA. Specify a value if you want to use a call ID for writing error and progress information. If you do not want to use a call ID, you must specify NULL.
fullyQualifiedTableName
A value, of type VARCHAR, that specifies the fully-qualified name of the table in which you want to store the result of the test run.
modelColumnName
A value, of type VARCHAR, that specifies a column in the specified table. The column must be of the type DM_ClasTestResult.
idColumnName
A value, of type VARCHAR, that specifies a column in the specified table. The column must be of the character data type, and is used to contain an identifier for the test result.
id
A value, of type VARCHAR, that specifies an identifier for the result.

Return value

Exceptions are raised in the following cases:

Usage

Executing a test run on the test task

DM_testRegModelD (using mining data),
DM_testRegModelCmdD

Each of the two versions of this procedure that are described here tests a Regression model on new data, and stores the result of the test, as a value of type DM_RegTestResult, in a table with a specified ID. If a result with the specified ID already exists in the table, it is overwritten. The table must already exist.

Syntax

Version 1

Read syntax diagramSkip visual syntax diagram>>-DM_testRegModelCmdD--(--dataTableName--,--dataColumnName--,-->

>--dataIDColumnName--,--dataID--,--modelTableName--,--modelColumnName--,-->

>--modelIdColumnName--,--modelId--,--resultTableName--,--resultColumnName--,-->

>--resultIdColumnName--,--resultId--)--------------------------><

Version 2

Read syntax diagramSkip visual syntax diagram>>-DM_testRegModelD--(--miningData--,--modelTableName--,--modelColumnName--,-->

>--modelIdColumnName--,--modelId--,--resultTableName--,--resultColumnName--,-->

>--resultIdColumnName--,--resultId--)--------------------------><

Parameters

dataTableName
A value of type VARCHAR that specifies the fully-qualified name of the table that contains the DM_MiningData value. The DM_MiningData value specifies the physical data that should be used to test the model. The alias names in the DM_MiningData value must match field names that are contained in the Regression model.
dataColumnName
A value of type VARCHAR that specifies a column in dataTableName. The column must be of the type DM_MiningData; it contains the mining data that should be used to test the model.
dataIdColumnName
A value of type VARCHAR that specifies a column in dataTableName. The column must be of the character data type; it contains the identifier for the mining data value.
dataId
A value of type VARCHAR that specifies the identifier of the mining data.
miningData
A value of type CLOB that was exported from a DM_MiningData value. It specifies the physical data that should be used to test the model. The alias names in the DM_MiningData value must match field names that are contained in the Regression model.
modelTableName
A value of type VARCHAR that specifies the fully-qualified name of the table that contains the Regression model.
modelColumnName
A value of type VARCHAR that specifies a column in modelTableName. The column must be of the type DM_RegressionModel; it contains the Regression model to be tested.
modelIdColumnName
A value of type VARCHAR that specifies a column in modelTableName. The column must be of character data type; it contains the identifier for the Regression model.
modelId
A value of type VARCHAR that specifies the identifier of the Regression model.
resultTableName
A value of type VARCHAR that specifies the fully-qualified name of the table in which you want the test result to be written.
resultColumnName
A value of type VARCHAR that specifies a column in resultTableName. The column must be of the type DM_RegTestResult; it contains the result of the test run after the stored procedure has finished.
resultIdColumnName
A value of type VARCHAR that specifies a column in resultTableName. The column must be of the character data type; it is used to store an identifier of the test result.
resultId
A value of type VARCHAR that specifies the identifier for the test result.

Return value

Exceptions are raised in the following cases:

Usage

Executing a test run on the mining model

DM_testRegModelT (using a test task),
DM_testRegModelCmdT

Each of the three versions of this procedure that are described here tests a Regression model, using a Regression test task. The procedure stores a value of type DM_RegTestResult in a specified table with a specified ID. If a result with the specified ID already exists in the table, it is overwritten. The table must already exist.

Syntax

Version 1

Read syntax diagramSkip visual syntax diagram>>-DM_testRegModelT--(--task_fullyQualifiedTableName--,--task_columnName--,-->

>--task_idColumnName--,--task_id--,--callid--,--fullyQualifiedTableName--,-->

>--modelColumnName--,--idColumnName--,--id--)------------------><

Version 2

Read syntax diagramSkip visual syntax diagram>>-DM_testRegModelCmdT--(--task_fullyQualifiedTableName--,--task_columnName--,-->

>--task_idColumnName--,--task_id--,--fullyQualifiedTableName--,--modelColumnName--,-->

>--idColumnName--,--id--)--------------------------------------><

Version 3

Read syntax diagramSkip visual syntax diagram>>-DM_testRegModelT--(--regTestTask--,--callid--,--fullyQualifiedTableName--,-->

>--modelColumnName--,--idColumnName--,--id--)------------------><

Parameters

task_fullyQualifiedTableName
A value of type VARCHAR that specifies the fully-qualified name of the table from which you want to retrieve the task.
task_ColumnName
A value of type VARCHAR that specifies a column in the specified table. The column must be of the type DM_RegBldTask.
task_idColumnName
A value of type VARCHAR that specifies a column in the specified table. The column must be of the character data type, and is used to retrieve the task using the specified task_id.
task_id
A value of type VARCHAR that specifies the identifier for the task.
regTestTask
A value of type CLOB that was exported from a DM_RegTestTask value.
callid
A value of type CHAR(19) FOR BIT DATA. Specify a value if you want to use a call ID for writing error and progress information. If you do not want to use a call ID, you must specify NULL.
fullyQualifiedTableName
A value, of type VARCHAR, that specifies the fully-qualified name of the table in which you want to store the result of the test run.
modelColumnName
A value, of type VARCHAR, that specifies a column in the specified table. The column must be of the type DM_RegTestResult.
idColumnName
A value, of type VARCHAR, that specifies a column in the specified table. The column must be of the character data type, and is used to contain an identifier for the test result.
id
A value, of type VARCHAR, that specifies an identifier for the result.

Return value

Exceptions are raised in the following cases:

Usage

Executing a test run on the test task

Command reference

This chapter contains full descriptions of the commands that are provided with IM Modeling. With these commands, you can do the following tasks:

You can find these commands in the bin directory of your IM Modeling installation.

The idmcheckdb command

The idmcheckdb command checks the parameters of a database. It identifies DB CFG parameters if they are not valid and tells you how to solve the problem. It also checks whether a specified database is enabled:

Syntax

Read syntax diagramSkip visual syntax diagram>>-idmcheckdb--dbname--+-------------+--+-------------------------------+-><
                       '-show detail-'  '-user--userID--using--password-'

Parameters

dbname
The name of the database that you want to check
show detail
If specified, a detailed report about all mining objects is shown. This list includes mining distinct and structured types, tables, indexes, user defined functions, user defined methods, and stored procedures.
user userid using password
The user ID for the database on the remote system and the appropriate password. If specified, you can check a cataloged database on a remote system. All mining specific types, tables, indexes, methods, functions, and stored procedures are listed.
Note:
You can check a remote database by specifying userid and password, however, the idmcheckdb command is only available on a database client if IM Modeling or IM Scoring is installed on the database client.

Return value

The idmcheckdb utility returns the following messages:

Table 87. The idmcheckdb messages
The database "mydb" is enabled for IM Modeling Version 8.2 and IM Scoring Version 8.2 in "fenced" mode.
The database "mydb" is enabled for IM Scoring Version 8.2 in "fenced" mode.
The database "mydb" is enabled for IM Modeling Version 8.2 in "fenced" mode.
The database "mydb" is not enabled for IM Modeling Version 8.2 or IM Scoring Version 8.2.

Examples

If the database was enabled with the current version of the product, idmcheckdb reports:

The database "sample" is enabled for IM Modeling Version 8.2 
and IM Scoring Version 8.2 in "fenced" mode.

If the database was enabled with the current version of the product using the Tablespace option, idmcheckdb sample reports:

The database "sample" is enabled for IM Modeling Version 8.2 
and IM Scoring Version 8.2 in "fenced" mode.

The following tables contain one or more columns with mining objects:
IDMMX.CLASSETTINGS (TABLESPACE USERSPACE2),
IDMMX.CLASSIFMODELS (TABLESPACE USERSPACE2),
IDMMX.CLASTASKS (TABLESPACE USERSPACE2),
IDMMX.CLASTESTRESULTS (TABLESPACE USERSPACE2),
IDMMX.CLASTESTTASKS (TABLESPACE USERSPACE2),
IDMMX.CLUSSETTINGS (TABLESPACE USERSPACE2),
IDMMX.CLUSTASKS (TABLESPACE USERSPACE2),
IDMMX.CLUSTERMODELS (TABLESPACE USERSPACE2),
IDMMX.LOGICALDATASPECS (TABLESPACE USERSPACE2),
IDMMX.MININGDATA (TABLESPACE USERSPACE2),
IDMMX.REGRESSIONMODELS (TABLESPACE USERSPACE2),
IDMMX.REGSETTINGS (TABLESPACE USERSPACE2),
IDMMX.REGTASKS (TABLESPACE USERSPACE2),
IDMMX.REGTESTRESULTS (TABLESPACE USERSPACE2),
IDMMX.REGTESTTASKS (TABLESPACE USERSPACE2),
IDMMX.RULEMODELS (TABLESPACE USERSPACE2),
IDMMX.RULESETTINGS (TABLESPACE USERSPACE2),
IDMMX.RULETASKS (TABLESPACE USERSPACE2)

If the database was enabled with a previous but compatible version of the product, idmcheckdb reports:

The database "sample" is enabled for IM Scoring Version 8.1.0.1 
in "fenced" mode. The database can be used with the current version 8.2. 
IBM recommends to migrate the database.
Use command idmenabledb to migrate your database.

If the database was enabled with a previous but incompatible version of the product, idmcheckdb reports:

The database "sample" is enabled for IM Modeling Version 8.1 
and IM Scoring Version 8.1 in "fenced" mode.
To use this database with the current version 8.2 you 
must migrate the database.
Use command idmenabledb to migrate your database. 

Another example using user ID and password: To check a cataloged database on a remote system, you can specify a user ID and a password, such as:

idmcheckdb sample user peter using mypassword
Note:
This example only works if IM Scoring or IM Modeling is installed on the client machine.

If a user has not installed IM Scoring or IM Modeling on the client, enter the following to get information about the status of the database enablement:

db2 "select * from IDMMX.VERSION"

The database is not enabled, if the following information is returned:

SQL0204N "IDMMX.VERSION" is an undefined name. SQLSTATE=42704

Otherwise, the following information is returned:

V_KEY                V_VALUE                        V_TIMESTAMP
-------------------- ------------------------------ --------------------------
IM Scoring           8.2                            2004-05-08-10.10.33.576001
IM Modeling          8.2                            2004-05-08-10.10.43.430001

To find out if a database is enabled in fenced or unfenced mode, you can use the following query:

db2 "select routinename,fenced from syscat.routines where 
            routineschema = 'IDMMX' and origin='E'"

The idmdisabledb command

The idmdisabledb command disables a database. It deletes the following mining objects from a specified database:

Syntax

Read syntax diagramSkip visual syntax diagram>>-idmdisabledb--dbname--+--------+----------------------------><
                         '-tables-'

Parameters

dbname
The name of the database that you want to disable
tables
If specified, the sample tables containing models are deleted.
Notes:
  1. Use the tables parameter with caution. Before you delete the sample tables, consider that you will also delete the models contained in these tables.
  2. If the sample tables are empty, they are deleted regardless whether the tables option is specified or not.
  3. If the sample tables are not empty, idmdisabledb asks the user whether to delete the sample tables.

The idmenabledb command

The idmenabledb command enable a database. It creates new database objects in the database and changes existing database objects if required.

Note:
You need not disable existing databases before using the idmenabledb command. However, the fenced or unfenced option must be the same as before, you can use idmcheckdb to check the existing database before enabling it again.

This command is shared between IM Modeling and IM Scoring. It detects which:

Syntax

Read syntax diagramSkip visual syntax diagram>>-idmenabledb--dbname--+----------+--+---------+--------------->
                        +-fenced---+  +-dbcfg---+
                        '-unfenced-'  '-nodbcfg-'

>--+------------------+--+------------------+------------------->
   '-ClasModelSize--n-'  '-RuleModelSize--n-'

>--+------------------+--+-----------------+-------------------->
   '-ClusModelSize--n-'  '-RegModelSize--n-'

>--+---------------+--+-----------------+--+---------------+---->
   '-StructSize--n-'  '-ApplDataSize--n-'  '-ResultSize--n-'

>--+-----------------------------+-----------------------------><
   '-Tablespace--tablespace-name-'

Parameters

dbname
Specifies the name of the database that you want to enable. This parameter is mandatory.
fenced
Specifies if the database is in fenced mode. Functions and methods are run in their own process. This is the default option.
unfenced
Specifies if the database is in unfenced mode. Functions and methods are run in the database process.
dbcfg or nodbcfg
If not specified, the user is prompted whether to change the database configuration.

If dbcfg is specified, the database configuration (DB CFG) is changed as recommended without prompting the user.

If nodbcfg is specified, only a warning message is displayed. The database configuration (DB CFG) is not changed.

ClasModelSize, RuleModelSize, ClusModelSize, RegModelSize n
Specify the:
  • BLOB size of the distinct types DM_ClasModel, DM_RuleModel, DM_ClusteringModel, and DM_RegressionModel for mining results.
  • CLOB parameter size of the associated import and export model functions.
Notes:
  1. When you have created database objects (for example, tables) using these types, you can no longer change the size of the types without dropping these database objects. It is recommended that you work with default sizes in a test environment and that you carefully consider the parameter sizes before moving to a production environment.

    If you want to change the parameter sizes after you have created models in your database, follow the instructions in Intelligent Miner Scoring: Administration and Programming for DB2.

  2. The default values are 10 MB in fenced mode and 50 MB in unfenced mode.
StructSize n
Specifies the CLOB size of structured type DM_LogicalDataSpec in megabytes. The default is 512 KB.
ApplDataSize n
Specifies the CLOB size of the data records for the distinct type DM_ApplicationData in megabytes. The default is 500 KB.
ResultSize n
Specifies the VARCHAR size for scoring results of the distinct types DM_ClasResult, DM_ClusResult, and DM_RegResult, and of the structured types DM_ClasResultSpec and DM_ClusResultSpec.

The default is 2 KB, which is suitable for all default results and for most of the results created according to a result specification with 10 additional results data. If you want to use a result specification that contains more or bigger results data, increase the size accordingly. The maximum size is 32 KB.

Tablespace tablespace-name
Specifies the table space to be used for the tables created by idmenabledb. If you do not specify this option, the mining tables are created in the default user tablespace selected by DB2.

Usage notes

Note:
Functions and methods are created as DETERMINISTIC NO EXTERNAL ACTION.

Examples

An example is:

idmenabledb testdb fenced ClasModelSize 5 RuleModelSize 7 RegModelSize 9 

where:

Note:
DM_RuleModel is a type introduced by IM Modeling. DM_RuleModel is not used by IM Scoring, but is mentioned here because idmenabledb is a shared command between IM Scoring and IM Modeling.

The idminstfunc command

The idminstfunc command enables the DB2 instance for the use of IM Modeling and IM Scoring. Enabling the DB2 instance means that shared libraries containing the implementation of the UDFs, UDMs, and stored procedures are linked into the sqllib/function directory of the DB2 instance.

Notes:
  1. This command must be called only on UNIX platforms. It can be called only by a user with SYSADM authority.
  2. If you invoke the idminstfunc script, the DB2INSTANCE environment variable depicts to which DB2 instance the changes will be applied.
  3. Each DB2 instance can only be used with one product version. The DB2 instance is associated with a product version when performing the instance configuration (idminstfunc).

Syntax

Read syntax diagramSkip visual syntax diagram>>-idminstfunc-------------------------------------------------><

Usage notes

The idminstfunc command is a shared command between IM Modeling and IM Scoring, and it must be called only once if both products are installed. If only one of the two products is installed, the command must be called again when the other product is added later on.

The idminstfunc command enables the instance that is specified in the DB2INSTANCE environment variable. This variable is automatically set when the respective db2profile script of the instance is executed. It automatically detects if it is a 32 or 64-bit instance. If you want to upgrade an instance from 32 to 64 bit, you must call idminstfunc again. The bin directory of the IM Scoring installation is added to the search path of the DB2 instance, so that further commands of IM Scoring can be called without specifying the full path.

Related concepts

Refer to DB2 Intelligent Miner Modeling, DB2 Intelligent Miner Scoring, DB2 Intelligent Miner Visualization: Installing the Intelligent Miner products.

The idmuninstfunc command

The idmuninstfunc command disables the DB2 instance for the use of IM Modeling and IM Scoring. Disabling the DB2 instance means that links to the shared libraries containing the implementation of the UDFs, UDMs, and stored procedures are removed from the sqllib/function directory of the DB2 instance.

This command must be called only on UNIX platforms, and it can be called only by a user with SYSADM authority.

Syntax

Read syntax diagramSkip visual syntax diagram>>-idmuninstfunc-----------------------------------------------><

Usage notes

The idmuninstfunc command is a shared command between IM Modeling and IM Scoring, and needs be called only once if both products are installed. It is not possible to disable the instance for the use of only one product if both products are installed.

After the idmuninstfunc command is called, IM Modeling and IM Scoring can no longer be used for that DB2 instance. To enable the DB2 instance again, call the idminstfunc command.

The idmlevel command

Use the command idmlevel to collect information about the software environment (operating system, DB2 version) and IM product version you are using.

Syntax

Read syntax diagramSkip visual syntax diagram>>-idmlevel--+---------+---------------------------------------><
             '-logfile-'

Parameters

logfile
Specifies the path and name of the file into which the result of the idmlevel command is written. If you do not specify a log file, the result is displayed on the screen. This parameter is optional.

Examples

The idmlicm command

Use the idmlicm command to check your license status. IM Scoring and IM Modeling use nodelocked license keys installed in a license file. The full product contains production license keys, which are installed during installation. The 'Try and Buy' version does not include a production license key. You can use the idmlicm command to generate a 'Try and Buy' license key.

Syntax

Read syntax diagramSkip visual syntax diagram>>-idmlicm-----------------------------------------------------><

Examples

The idmlicm command is located in the bin directory. It has no parameters. When invoked, idmlicm checks the license status.

Sample output with production license
The license for the product "DB2 Intelligent Miner Scoring" 
     was found in the file "nodelock_sc".
The license for the product "DB2 Intelligent Miner Modeling" 
     was found in the file "nodelock_mo".

If no production license is installed, idmlicm can generate a temporary license key the first time it is invoked.

Sample output with temporary license
W 2771: You are now using a temporary license. You need 
to enroll "DB2 Intelligent Miner Scoring" within "89" days 
in the license file "d:\IMinerX\bin\nodelock_sc".

If you invoke idmlicm when a temporary license is already installed, you get the following sample output:

Sample output with temporary license already installed
W 2772: The number of days left is "89". You are still using 
a temporary license. You need to enroll "DB2 Intelligent Miner Scoring" 
in the license file "d:\IMinerX\bin\nodelock_sc".

Administration

Setting environment variables (for error and trace)
Getting progress information
Getting error information
Error handling
Defining the error file and error table
Getting support
Problem identification worksheet
Getting product information
Getting trace information
Using the tracing facility on UNIX systems
Using the tracing facility on Windows systems
Getting DB2 diagnostic information
Canceling mining runs
Migrating from IM Modeling V8.1
Working with IM Modeling V8.1 and V8.2 in parallel
Migrating from DB2 Version 7
Migrating from IM Modeling Version 8.1
Migrating a DB2 instance (UNIX only)
Migrating databases (all platforms)
Database instance restart

Setting environment variables (for error and trace)

To inform the process that runs the stored procedures about new or changed environment variables, you can use a stored procedure that directly modifies environment variables in the running agent process instead of restarting the DB2 server. There is also a stored procedure to retrieve information about the current environment variables.

These stored procedures are as follows:

DM_setEnv
Use this procedure to directly modify environment variables in the running agent process. For a full description, see DM_setEnv.
DM_getEnv
Use this procedure to retrieve information about the current environment variables. For a full description, see DM_getEnv.
Notes:
  1. DM_setEnv and DM_getEnv are intended to set environment variables in the DB2 db2fmp process. The stored procedures are always executed within this process, but the UDFs can be executed within the db2fmp process or within the database itself. The latter is the case if you enable the database in unfenced mode for IM Scoring or IM Modeling. If the database was enabled in unfenced mode, a call to DM_SetEnv or DM_getEnv influences the stored procedures only, but for the UDFs it has no effect. For more information refer to:
  2. Stopping the database instance also deletes the db2fmp process, and environment variables set by DM_setEnv do not exist anymore. When you start the database instance again, you might want to reset those variables.
  3. If you have enabled your database in unfenced mode, or if you want to set variables permanently (even after a database instance restart), you should set the variables in the environment of the DB2 engine. Instructions follow on how to do this.
To set variables in the environment of the DB2 engine:

Getting progress information

The progress information that is generated by the mining algorithms during a training or test run can be written into the Progress Information Table (PIT). Progress information records are inserted into the PIT without issuing a COMMIT. This means that the table can be read from another connection only with isolation level UR (uncommitted read). There is no special function or procedure to enable the PIT to be read. You can create your own SELECT statements to query the information in the PIT.

You can specify the name of the PIT; see the description of the relevant method at DM_setProgTab. If the specified table does not exist, an error is written to the error file and to the error table. (For information to be written to the error table, the table must exist. For more information on error handling, see Getting error information.) The stored procedure then returns this error. It is also considered an error if the PIT exists but the required columns have not been defined correctly.

There is a separate sample SQL script for creating a PIT (createProgressTable.db2). You may change the name of the table in the script and you may add columns to the table in the script, but the actual column definitions must not be changed.

A PIT has the following columns:

Table 88. PIT columns
Column name SQL type Description
CALLID CHAR(19) FOR BIT DATA The call ID that identifies the training or test run. The call ID that was passed to the stored procedure for the mining run is written into this column. When a new mining run is started, first all records having the same call ID as that passed to the stored procedure are deleted from the PIT. This prevents confusion between old and new progress information records.
PROCNAME VARCHAR(100) The name of the stored procedure executing the mining run.
KERNELPHASEID INTEGER Each mining algorithm runs through one or more (kernel) phases. This ID identifies the phase. If the mining algorithms has not reported a phase so far, the value in this column is NULL.
KERNELPHASE VARCHAR(500) The name of the kernel phase, or a sentence that explains it. If the kernel has not reported a phase so far, or does not report a phase, the string is set to "---".
KERNELINFO CLOB(32K) At the beginning of their operation, the kernels report some basic information about their operation. This includes the list of phases they expect to run through, the type name of the sub-phases (iterations) that are counted by the ITERATIONNO value, and the maximum execution time. This information is stored in this column. However, the information is stored in this column only once by the kernels; subsequent records will have NULL in this column. The information is stored in an XML format.
ITERATIONNO INTEGER The number of the current pass over the data. The first pass is number 1.
PROGRESS REAL Progress is a value between 0 and 1. When a new iteration begins, the progress value is reset to 0.
QUALITYID INTEGER The quality ID identifies the quality measure used to evaluate the quality of building the model.
QUALITYMEASURE VARCHAR(500) The quality measure names the unit of evaluation for the quality of building the model.
QUALITYVALUE REAL The quality value gives a numerical value for the quality of building the model. The unit of this value is the quality measure.
TIMESTMP TIMESTAMP The time when the record was written to the PIT. Also, this column is the location where a start time record and an end time record for the mining run is written to the PIT. For start and end time records, all columns except TIMESTMP and CALLID are NULL.
MESSAGEID INTEGER This is an identifier for the MESSAGE stored in the next column.
MESSAGE VARCHAR(1000) A message describing the current status of the mining run.
CANCELREQUEST INTEGER Normally NULL. Set to 1 by the stored procedure DM_cancelTask. Reset to 0 when the mining run has taken note of the cancel request.

For instructions on how to specify a PIT and how to identify a mining run in the table, see Defining additional control parameters.

Getting error information

This section provides information on how IM Modeling handles error messages and on how you can define the error file and error message table (EMT).

For information on error message format and for a full reference resource to the error messages provided by IM Modeling, see DB2 Intelligent Miner Modeling, DB2 Intelligent Miner Scoring: Messages.

Error handling

IM Modeling writes all error messages and warnings to a file (as does IM Scoring). When a stored procedure is called, error information can additionally be written to an EMT. A new error message is appended to the file, and it is inserted into the EMT; this happens without a COMMIT instruction being issued. There is no special function or procedure that you can use to read the EMT. To query the information in the EMT, create your own SELECT statements.

Defining the error file and error table

The default error file is named idmMxError.log; it resides in the temporary directory of the system. You can change the error file name and directory by using the environment variable IDM_MX_ERRORFILE. If this variable is not set, the default error file is used. For information on setting this variable, see Setting environment variables (for error and trace).

To change the error file name:
To change the error file, set the variable to the absolute path name of the desired error file. To prevent IM Modeling from writing to the error file, set the environment variable to the special value NONE.
To specify an EMT:
You specify the name of the EMT by using the method DM_setErrorTab. If the defined table does not exist, an error is written to the error file, and the stored procedure returns this error. It is also considered an error if the EMT exists but the required columns have not been defined correctly.

There is a separate sample SQL script for creating an EMT (createErrorTable.db2). You can change the name of the table in the script and add columns to the table in the script; however, you must not change the actual column definitions.

An EMT has the following columns:

Table 89. EMT columns
Column name SQL type Description
CALLID CHAR(19) FOR BIT DATA The call ID that identifies the training or test run. The call ID that was passed to the stored procedure for the mining run is written into this column. When a new mining run is started, first all records having the same call ID as that passed to the stored procedure are deleted from the EMT. This prevents confusion between old and new error message records.
RC CHAR(1) The return code, which is one of the following:
  • E: Error
  • S: Severe error
  • W: Warning
  • I: Information
SQLSTATE CHAR(5) The five-digit SQLSTATE of the error. The SQLSTATE of the severest error that happened during the execution of the stored procedure is returned to DB2.
EXCID INTEGER The IM Modeling four-digit error event code.
PROCNAME VARCHAR(100) The name of the stored procedure executing the mining run.
COMPNAME VARCHAR(100) The name of the internal software component where the error or warning occurred.
TIMESTMP TIMESTAMP The time when the EMT record was written.
MESSAGE VARCHAR(1000) The text of the error or warning message.

For instructions on how to specify an EMT and how to identify a mining run in the error message table, see Defining additional control parameters.

Getting support

Before you contact IBM for support, check the information provided in the release.txt file that comes with the product. This file can be found in the installation directory.

To find the latest information about IM Modeling access the Intelligent Miner Web site.

When you contact IBM for support, prepare to answer the questions in the problem identification worksheet. Make yourself familiar with the instructions on how to collect trace information given at Getting trace information.

Problem identification worksheet

The IBM Software Support Guide contains the following problem identification worksheet.

Answer the questions in the worksheet before contacting IBM support.

 
              PROBLEM IDENTIFICATION WORKSHEET
 
Complete this form before calling Technical Support
 
This form helps you identify problems and assists IBM Technical Support in
finding solutions.

System Information

What is the failing product? _______________________________________________

What is the version and release number?_____________________________________

What machine model, operating system, and version are running?______________

Problem Description

What are the expected results?______________________________________________

What statement or command is being used? ___________________________________

What are the exact symptoms and syntax? ____________________________________
____________________________________________________________________________

What is or isn't happening, including exact error number and message text? 

____________________________________________________________________________

____________________________________________________________________________

Is anyone else experiencing the problem? ___________________________________

Is this the first time this operation has been attempted? __________________

Is this the first time this problem has occurred?___________________________

Environment

When did this activity work last? __________________________________________

What has changed since the activity last worked? ___________________________

_____ Hardware type/model         _____ Application

_____ Operating system/version    _____ Level of usage

_____ New product version/release _____ Maintenance applied

If the problem does not occur every time, under what conditions does the
problem not occur?

____________________________________________________________________________

____________________________________________________________________________

Is there any other software running on the system which may be conflicting 
with this product?

____________________________________________________________________________

____________________________________________________________________________

Problem Isolation

Identify the specific feature of the software causing the problem.__________

____________________________________________________________________________

Can the problem be reproduced? If so, please provide a reproducible test case
or instructions on how to reproduce the error condition.____________________

____________________________________________________________________________

____________________________________________________________________________

____________________________________________________________________________
 

Getting product information

Use the command idmlevel to collect information about the software environment (operating system, DB2 version) and IM product version you are using.

For more information on using this command on Windows or UNIX operating systems refer to The idmlevel command.

Note:
Attach the resulting log file to your problem description when you contact IBM support.

Getting trace information

The trace facility in IM Modeling helps IBM to locate an error by writing information about an error situation to a file. This information consists of trace messages.

The trace facility is configured by means of two environment variables. These are as follows:

IDM_MX_TRACELEVEL determines the filtering of trace messages. IDM_MX_TRACELEVEL is effectively an on/off switch for tracing.

Note:
If you do not set IDM_MX_TRACELEVEL to MINIMUM, the performance can decrease considerably.

Since trace messages are controlled by means of environment variables, concurrent mining runs write to the same trace file.

The trace message that is written to the trace file consists of:

Additionally, basic system information is written once per trace.

Using the tracing facility on UNIX systems

To work with the tracing facility, set the environment variable IDM_MX_TRACELEVEL, IDM_MX_TRACEFILE, or both. To switch the tracing facility on, set IDM_MX_TRACELEVEL to BASIC, MOST, or ALL. You can also optionally set IDM_MX_TRACEFILE to a file name including the whole path. If IDM_MX_TRACEFILE is not set explicitly, the trace information is written to the file /tmp/idmMxTrace.log by default.

For information on how to inform DB2 about these environment variables, see Setting environment variables (for error and trace).

Using the tracing facility on Windows systems

To work with the tracing facility, set the environment variable IDM_MX_TRACELEVEL, IDM_MX_TRACEFILE, or both. To switch the tracing facility on, set IDM_MX_TRACELEVEL to BASIC, MOST, or ALL. You can also optionally set IDM_MX_TRACEFILE to a file name including the whole path. If IDM_MX_TRACEFILE is not set explicitly, the trace information is written to the file idmMxTrace.log by default.

For information on how to inform DB2 about these environment variables, see Setting environment variables (for error and trace).

Getting DB2 diagnostic information

If you need to contact IBM support, you might also need to provide DB2 diagnostic information like DB2CLI trace or db2diag.log. For more information, see the DB2 Troubleshooting Guide.

Canceling mining runs

A mining run can take a very long time, hours or even days. Therefore, you need to be able to cancel a mining run.

To cancel a mining run, you issue a cancel request. You can make the request at any time during the mining run. If the mining run is close to its end, the mining function might not fulfill the cancel request. If it fulfills the request, it chooses the best time to cancel the run. This means that a cancel request does not immediately shut down the calculation. The request is a demand to the mining kernel to stop execution at the next possible point in time.

You call the stored procedure DM_cancelTask to start the cancellation process. Since the synchronous call of a mining run blocks the corresponding database connection, this procedure has to be called by means of a second connection. This can be the connection that is also used to read progress information.

For a full description of the stored procedure, see DM_cancelTask. The procedure takes two parameters, progressTableName and callId. These two parameters identify the mining run to be canceled. These parameters must be the same as those used when the task for the mining run was defined (see DM_setProgTab) and when the stored procedure was called. The stored procedure writes a cancel request indicator into the progress information table (that is, the column CANCELREQUEST in the progress information table is set to 1), as well as the passed callId. If callId is NULL, there should be no other concurrent mining run that uses this progress information table and has no callId. Otherwise, you would cancel the mining run that does not use a callId and that accesses the progress information table next, and the others would not be canceled. If the task for the mining run did not contain the name of a progress information table, the mining run cannot be canceled.

As soon as the cancel request is read by the mining algorithm, the cancel request indicator is reset (that is, the column CANCELREQUEST in the progress information table is set to 0) in order to acknowledge that the cancel request has been noted. However, when you call DM_cancelTask, you should be aware that there is no guarantee that the mining run will be canceled as requested. The mining algorithm that does the actual cancellation may, for example, decide not to react to the request because the mining run is close to its end.

Note that DM_cancelTask performs a COMMIT to make the record written to the progress information table readable for the mining run that is part of another transaction.

Migrating from IM Modeling V8.1

If you want to migrate from IM Modeling V8.1 to IM Modeling V8.2, in general you can start working with IM Modeling V8.2 after performing the following steps:

  1. Installing IM Modeling V8.2
  2. Performing the configuration steps
  3. Re-enabling your databases or enabling new databases
    Note:
    You need not disable your databases before you re-enable them.

Working with IM Modeling V8.1 and V8.2 in parallel

Windows platform:
You cannot work with both versions on one machine on the Windows platform. If you install IM Modeling V8.2 on a Windows machine and the installation finds IM Modeling V8.1, IM Modeling V8.1 is automatically uninstalled.
UNIX platforms:
IM Modeling V8.2 installs into a directory that is different from the one used for IM Modeling V8.1. This means that you can have both versions installed on one machine. However, it is recommended that you migrate to IM Modeling V8.2, because there is a high risk of user error if you use both versions.

If you want to perform scoring operations with both versions, the recommended way to do this is to use different DB2 instances. The reason for this is that an instance is enabled for a specific version of IM Modeling by means of the command idminstfunc. If you want to use the same DB2 instance for both products, disable and enable the DB2 instance first before you use the second product. For this scenario, it is recommended that you use different databases.

Migrating from DB2 Version 7

IM Scoring and IM Modeling support DB2 V8.

If you use DB2 Version 7 with previous versions of IM Scoring or IM Modeling, you must first migrate DB2 Version 7 to Version 8 as described in the DB2 documentation. Then proceed with the migration instructions for IM Scoring or IM Modeling.

Migrating from IM Modeling Version 8.1

Before you start the migration you must consider the following:

If you want to migrate from IM Modeling V8.1 to IM Modeling V8.2, in general you can start working with IM Modeling V8.2 after performing the following steps:

  1. Installing IM Modeling V8.2
  2. Performing the configuration steps
  3. Re-enabling your databases or enabling new databases
    Note:
    When you re-enable your databases, you do not need to have already disabled any databases.

Migrating a DB2 instance (UNIX only)

A DB2 instance must have access to the libraries containing the IM Modeling or IM Scoring functions to use IM from that instance. Some library names and installation paths have changed with Version 8.2. To migrate the DB2 instances to the new version of IM, use the command idminstfunc. For more information refer to The idminstfunc command.

Note:
You need not change database manager configuration parameters (DBM CFG) or DB2 registry settings.

Migrating databases (all platforms)

IM Modeling and IM Scoring work with database objects, such as user-defined types (UDT), user-defined functions (UDF), user-defined methods (UDM), and stored procedures (SP). These objects must be created in each DB2 database to be used with IM. This step is called "enabling the database". New database objects have been added in Version 8.2 and some database objects need to be updated.

Note:
It is not necessary to change database manager configuration parameters (DBM CFG) or DB2 registry settings.

To migrate existing database objects:

  1. List the databases for your database instance using the DB2 command:
    db2 list db directory 

    Sample output:

    System Database Directory
    
     Number of entries in the directory=2
    
    Database 1 entry:
    
     Database alias                       = SAMPLE
     Database name                        = SAMPLE
     Database drive                       = D:\DB2
     Database release level               = a.00
     Comment                              =
     Directory entry type                 = Indirect
     Catalog database partition number    = 0
    
    Database 2 entry:
    
     Database alias                       = IMDEMO
     Database name                        = IMDEMO
     Database drive                       = D:\DB2
     Database release level               = a.00
     Comment                              =
     Directory entry type                 = Indirect
     Catalog database partition number    = 0
  2. You must migrate each local database that has already been enabled with a previous version of IM. Check the status of existing databases, for example, to find out whether the existing database object is in fenced or unfenced mode:
    idmcheckdb dbname
    Sample output:
    E:\>idmcheckdb sample
    
    The database "sample" is enabled for
    IM Modeling Version 8.1 and IM Scoring Version 8.1 in "fenced" mode.
    To use this database with the current version 8.2 you must migrate
    the database. Use command idmenabledb to migrate your database.
    ...
    
  3. Call the following command to enable and migrate all databases that were enabled for previous versions:
    idmenabledb dbname
    For more information refer to The idmenabledb command.
    Note:
    You do not need to disable (idmdisabledb) a database before invoking idmenabledb.
    The idmenabledb tool creates new database objects in the database and changes existing database objects if required. For example, the names of some libraries implementing external C UDF/UDM/SP have changed and the DDL must be updated to reflect the new external symbol names:
  4. For more information on how to verify the successful migration refer to DB2 Intelligent Miner Modeling, DB2 Intelligent Miner Scoring, DB2 Intelligent Miner Visualization: Installing the Intelligent Miner products. The idmcheckdb command should now report the current version of the product:
    E:\>idmcheckdb sample
    The database "sample" is enabled for
    IM Modeling Version 8.2 and IM Scoring Version 8.2 in "fenced" mode.
    ...

Database instance restart

External libraries implementing UDF, UDM, or SP may remain loaded in DB2's processes until the DB2 instance is restarted. To avoid that DB2 uses older libraries of a previous version, the database instance should be restarted after migration. To restart the instance, use the commands:

db2stop
db2start 

For more information refer to the DB2 manuals.

Appendixes

Appendix A. Using interfaces

IM Modeling provides a set of user-defined methods, functions, and stored procedures to DB2. You invoke these database objects by using SQL statements. For applications that you want to use in connection with IM Modeling, the following interfaces are available:

Call Level Interface (CLI)
The DB2 CLI is a C and C++ application programming interface for database access that provides a standard set of functions to process SQL statements at run time. The DB2 CLI does not require you to precompile or bind applications.

For further information about the DB2 CLI, refer to the platform-specific guide and reference, for example, IBM DB2 Universal Database Call Level Interface Guide and Reference.

Java Database Connectivity (JDBC)
JDBC is an SQL application programming interface between Java application programs and database management systems like DB2. It manages the connection with a database, executes SQL statements, and retrieves their results.

You can find further information about JDBC on the JDBC Web site.

Open Database Connectivity (ODBC)
ODBC is a Microsoft database application programming interface for C that enables access to database management systems by using callable SQL. ODBC does not require the use of an SQL preprocessor. In addition, ODBC provides an architecture that lets users add modules called database drivers. These database drivers link the application to database management systems of their choice at run time.
Embedded SQL
Embedded SQL provides a way of including SQL code into application programming languages.

The use of embedded SQL requires precompilation and binding. Precompilation converts SQL statements into DB2 run-time API calls. Binding creates a package from a bind file, which contains information on the SQL statements in the application program.

For further information about embedded SQL, refer to the IBM DB2 UDB Application Development Guide.

DB2 command line
The DB2 command line lets you interactively enter SQL statements for immediate execution. You can use this interface to issue SQL statements with encapsulated IM Modeling method and function calls.

For further information about issuing SQL statements from the DB2 command line, refer to your SQL documentation, for example, IBM DB2 UDB Getting Started.

The DB2 SQL interface supports the development of data mining modeling applications in programming languages that support at least one of these interfaces.

The following sections briefly describe these interfaces, and give references to further information about them. Most of these interfaces are also described in greater detail in DB2 UDB SQL Reference.

Appendix B. Comparing IM Modeling with IM for Data

This appendix outlines the differences between IM Modeling and IM for Data. The differences lie in the following areas:

Note:
IM Modeling V8.2 can coexist with IM for Data V8.1.

Physical data specifications (DM_MiningData)

In IM for Data, the physical data specifications are done in a data object. IM for Data has no subdivision into physical data and logical data. This means that the specifications in a DM_MiningData value covers only a subset of the specifications that can be done in the IM for Data data object. Some of the IM for Data object specifications can be done in the logical data specifications. Examples are name mappings, and lower and upper bounds for continuous fields. Others are no longer available in IM Modeling, as follows:

Settings parameters

The following settings parameters in IM for Data are not supported in IM Modeling:

Optimizing the mining run
The mining run is always optimized for space in IM Modeling. It is not possible to optimize a mining run for time.
Filtering records
It is not possible to specify record filters as part of the settings specification. If you need to filter records, you must do one of the following:

Clustering

This section outlines how you can use IM Modeling to set parameters, as they appear in IM for Data, for the Clustering mining function.

The following table lists the parameters as they appeared in IM for Data and the corresponding SQL methods in IM Modeling that you can use to set them. The parameters no longer in use are in square brackets, for example, [comment]. The new parameters are written in italics, for example, desired execution time.

Table 90. Comparing IM Modeling with IM for Data: Clustering parameters
Section Parameter In SQL type With SQL set method
Mining function name -- --
[comment] -- --
[mining function] -- --
Input data input data DM_ClusBldTask DM_defClusBldTask
optimize for.. -- --
filter records DM_MiningData DM_setWhereClause
power options DM_ClusSettings DM_setPowerOptions
Mode parameters use mode -- --
maximum clusters DM_ClusSettings DM_setMaxNumClus
[accuracy improvement] -- --
similarity threshold DM_ClusSettings DM_setDClusPar
desired execution time DM_ClusSettings DM_setExecTime
minimum percentage data DM_ClusSettings DM_setMinData
Input fields active fields DM_ClusSettings DM_setFldUsageType
supplementary fields
Field parameters field weight DM_ClusSettings DM_setFldWeight
outlier treatment DM_ClusSettings DM_setFldOutlTreat
Value weighting DM_ClusSettings DM_setDClusFldPar
compensate
Additional field parameters distance unit DM_ClusSettings DM_setFldSimScale
Outlier treatment [outlier treatment]
Similarity matrix similarity matrix DM_ClusSettings DM_addSimMat, then DM_setFldSimMat
Parallel parameters [run the parallel mode of the function]
Output fields *
Output data *
Results *
Parameters in IM for Data that are no longer used
IM Modeling is intended to work sequentially, so that the parallel parameters in IM for Data are no longer used. Similarly, the output data and output fields defined in the parameters of IM for Data are no longer used. The reason is that they are specific to the Distribution-based Clustering application mode. Use IM Scoring for the application mode.

Classification

This section outlines how you can use IM Modeling to set parameters, as they appear in IM for Data, for the Classification mining function.

The following table lists the parameters as they appeared in IM for Data and the corresponding SQL methods in IM Modeling that you can use to set them.

Table 91. Comparing IM Modeling with IM for Data: Classification parameters
Section IM for Data related parameter IM Modeling related method or value of type
Mining function Classification - Tree DM_ClasBldTask DM_ClasTestTask
Input data Settings name DM_MiningData
Filter records condition DM_setWhereClause
Power options DM_setPowerOptions
Mode parameters Training mode DM_ClasBldTask
Test mode DM_ClasTestTask
Application mode (Use IM Scoring)
Input fields Available fields Not available
Input fields All fields from DM_LogicalDataSpec
Class labels Field set by means of DM_setClasTarget
Filter mask Not available
Field parameters Input fields --
Field weights --
Error matrix Available value mappings Not available
Settings name DM_setCostMat
Parallel parameters Run the serial mode of the function Not available
Run the parallel mode of the function --
Output fields Available fields Not available
Output fields --
Class ID field name --
Confidence field name --
Output data Available output data Not available
Settings name --
Results Available results Not available
Results name Result built and stored by means of DM_buildClusModel

Migration from IM for Data

There are no tools available to migrate from IM for Data to IM Modeling.

Appendix C. Coexistence with IM Scoring

Here you find an overview of the data or information that is shared between IM Modeling and IM Scoring.

Shared schema

The schema IDMMX is shared between IM Modeling and IM Scoring.

Shared data types

The following data types are shared between IM Modeling and IM Scoring:

Shared functions

The following functions are shared between IM Modeling and IM Scoring:

DM_RuleModel
DM_ClasModel
DM_ClusteringModel
DM_RegressionModel

Shared methods

The following methods are shared between IM Modeling and IM Scoring:

DM_LogicalDataSpec

Shared commands

The following commands are shared between IM Modeling and IM Scoring:

Appendix D. IM Modeling conformance to PMML

PMML is a markup language for data mining. Based on XML, PMML provides a standard that enables data mining models to be shared between the applications of different vendors. It provides a vendor-independent method of defining models. It allows you to exchange models between applications.

Note:
IM Scoring supports PMML up to V2.1. The term PMML throughout this book refers to PMML V2.1 and any previous versions of PMML, unless otherwise specified.

You can find more information about PMML on the Web site of the Data Mining Group (DMG).

Here you find information on how IM Scoring conforms to the PMML standard. The following naming conventions of the PMML standard are used:

IM Modeling complies with the PMML producer conformance clause of the PMML standard for association rules and decision trees.

IM Modeling also complies with the PMML producer conformance clause of the PMML standard for distribution-based clustering when value weighting is not used. See the definition of value weighting in Specifying value weighting, and its usage in DM_setDClusFldPar. However, if value weighting is used, IM Modeling produces non-conforming PMML models with a specific extension for value weighting. This extension can be read only by IM Scoring, which will use value weighting when scoring data on these models. Other PMML consumer tools will ignore the extension. However, they will read the model successfully, and will not consider value weighting when scoring data on these models.

IM Modeling does not comply with the PMML producer conformance clause of the PMML standard for regression. The complex Regression models produced by IM Modeling cannot be represented in PMML 2.1. Therefore, Regression models are written in a PMML-extended XML representation that has been submitted for approval to the Data Mining Group for the next PMML version.

Appendix E. Notices

IBM may not offer the products, services, or features discussed in this document in other countries. Consult your local IBM representative for information on the products and services currently available in your area. Any reference to an IBM product, program, or service is not intended to state or imply that only that IBM product, program, or service may be used. Any functionally equivalent product, program, or service that does not infringe any IBM intellectual property right may be used instead. However, it is the user's responsibility to evaluate and verify the operation of any non-IBM product, program, or service.

IBM may have patents or pending patent applications covering subject matter described in this document. The furnishing of this document does not give you any license to these patents. You can send license inquiries, in writing, to:

IBM Director of Licensing
IBM Corporation
North Castle Drive
Armonk, NY 10504-1785
U.S.A.

For license inquiries regarding double-byte (DBCS) information, contact the IBM Intellectual Property Department in your country or send inquiries, in writing, to:

IBM World Trade Asia Corporation
Licensing
2-31 Roppongi 3-chome, Minato-ku
Tokyo 106, Japan

The following paragraph does not apply to the United Kingdom or any other country where such provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this statement may not apply to you.

This information could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the publication. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time without notice.

Any references in this information to non-IBM Web sites are provided for convenience only and do not in any manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of the materials for this IBM product and use of those Web sites is at your own risk.

IBM may use or distribute any of the information you supply in any way it believes appropriate without incurring any obligation to you.

Licensees of this program who wish to have information about it for the purpose of enabling: (i) the exchange of information between independently created programs and other programs (including this one) and (ii) the mutual use of the information which has been exchanged, should contact:

IBM  Deutschland GmbH
Department  0790
Pascalstrasse 100
70569 Stuttgart  
Germany

Such information may be available, subject to appropriate terms and conditions, including in some cases, payment of a fee.

The licensed program described in this information and all licensed material available for it are provided by IBM under terms of the IBM Customer Agreement or any equivalent agreement between us.

Any performance data contained herein was determined in a controlled environment. Therefore, the results obtained in other operating environments may vary significantly. Some measurements may have been made on development-level systems and there is no guarantee that these measurements will be the same on generally available systems. Furthermore, some measurement may have been estimated through extrapolation. Actual results may vary. Users of this document should verify the applicable data for their specific environment.

Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products.

All statements regarding IBM's future direction or intent are subject to change or withdrawal without notice, and represent goals and objectives only.

This information contains examples of data and reports used in daily business operations. To illustrate them as completely as possible, the examples include the names of individuals, companies, brands, and products. All of these names are fictitious and any similarity to the names and addresses used by an actual business enterprise is entirely coincidental.

COPYRIGHT LICENSE:

This information contains sample application programs in source language, which illustrates programming techniques on various operating platforms. You may copy, modify, and distribute these sample programs in any form without payment to IBM, for the purposes of developing, using, marketing or distributing application programs conforming to the application programming interface for the operating platform for which the sample programs are written. These examples have not been thoroughly tested under all conditions. IBM, therefore, cannot guarantee or imply reliability, serviceability, or function of these programs.

You may copy, modify, and distribute these sample programs in any form without payment to IBM for the purposes of developing, using, marketing, or distributing application programs conforming to IBM's application programming interfaces.

Each copy or any portion of these sample programs or any derivative work, must include a copyright notice as follows:

(C) (your company name) (year). Portions of this code are derived from IBM Corp. Sample Programs. (C) Copyright IBM Corp. _enter the year or years_. All rights reserved.

Trademarks

The following terms are trademarks of the IBM Corporation in the United States, other countries, or both:

AIX
alphaWorks
DB2
DB2 Universal Database
IBM
Intelligent Miner
Redbooks
WebSphere

UNIX is a registered trademark of The Open Group in the United States and other countries.

Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both.

Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.

Linux is a trademark of Linus Torvalds in the United States, other countries, or both.

Other company, product, and service names may be trademarks or service marks of others.

Glossary

This glossary defines terms as they are used in this book. If you cannot find the term you are looking for, refer to the Dictionary of Computing New York: McGraw-Hill, 1994.

A

active field
A field that is used during the training run to compute a data mining model, and to evaluate or predict a single row. Active fields are defined in the logical data specification.
application phase
A phase during which a row is evaluated against a data mining model, and one or more values are computed. These include the identification of the cluster for data mining Clustering, and the predicted value for data mining Classification or data mining Regression. The application phase is used only for data mining Clustering, Classification, and Regression.
association rules
Combinations of field values that appear frequently (according to a specified threshold). An example is a situation where there is a significant number of groups containing the relevant combination of values.

Example of application: store layout.

C

categorical field type
A field type that supports only <equal operator> as a comparison operator. There is no defined order, and no arithmetic operations are supported.
class label
A target field used in data mining classification to create a data mining classification model. Its application to data without a class label enables it to predict a value for this class label. The class label must be of the categorical field type.
confidence
The percentage of transactions that contain all the items that make up a rule in the transactions that contain the antecedent of the rule. The confidence of the data mining association rule "X and Y implies Z" is 100 times the number of transactions that contain X, Y, and Z divided by the number of transactions that contain X and Y.
cost rate
The cost rate is a parameter specific to the classification settings. It defines the maximum percentage of classification error tolerated during the validation phase. If the classification error is greater than the cost rate, the tree classification algorithm returns a warning and reports the end of the training phase.

D

data mining
The process of discovering valuable, previously unknown information from a large amount of data. The data is analyzed without any preconceived expectation of the results. Data mining delivers knowledge that provides a deeper insight into the data.
data mining association rules
See association rules
data mining classification
A data mining function that computes a data mining classification model. Class label values can be predicted by using this model, as can field values without a class label.

Example of application: insurance risk prediction.

data mining classification error
The percentage of wrongly predicted values among the total number of values predicted during the validation phase of the data mining Classification mining function. This error is returned at the end of the test phase.
data mining classification model
The result of data mining classification.
data mining cluster
A set of rows with common characteristics. See also data mining clustering.
data mining clustering
A data mining function that discovers sets of rows with common characteristics. These sets are known as clusters. Rows are possibly homogeneous inside a cluster, and possibly heterogeneous between two clusters.

Example of application: customer mailings.

data mining data type
An abstraction of a source table. A data mining data type maps the field names (that is, the column names of the source table) to alias names. Before the training run, these alias names are compared to the field names used in the specified logical data specification.
data mining field type
The characteristic that defines the way the data mining field values are compared and managed during a training run. Data mining field types are either categorical or numerical.
data mining function
Four types of data mining functions are distinguished: discovering association rules, clustering/segmentation, classification, and regression.
data mining model
The result of a training run of a data mining function over a given set of data. This result contains the usable information discovered in the data. The data mining model can also be used alone as a substitute for the original large amount of data. In this case, it is used to associate, classify, or predict the behavior of additional data (in application and testing phases).
data mining run
Computation of a data mining model using data mining settings. Depending on the data mining function, a data mining run may contain a training phase, a validation phase, and a testing phase.
data mining segmentation
See data mining clustering
data mining settings
These settings are used in the data mining run, and specify the logical data specification and parameters, depending on the data mining function.
data mining task
Abstraction for the complete data needed to compute a data mining model, containing the data mining settings and the data mining data type.
data mining test result
A statistical result, returned at the end of the testing phase, that contains an evaluation of the correctly and incorrectly predicted values in the test data. This result can be considered as a quality criterion of the data mining model.
data warehouse
A collection of data that is used for decision support.

E

error weight
A parameter that defines a severity level that has to be applied to a wrong prediction during the validation phase. The error weight parameter is specific to the data mining settings and the data mining classification. The error weight depends on the wrongly-predicted value and the real value of the class label.
export
To transform the value of a user-defined type into a specific data format.

I

import
To generate a value of a user-defined type from a specific data format.
input mapping
See logical data specification.

L

logical data specification
The part of the data mining settings that lists field names and field types that will be used during the data mining run. Before the data mining run, these fields will be compared to the field names or aliases defined in the data mining data type.

N

numerical field type
A field type that supports all operations of <numerical value expression>.

P

predicted value
The value of the target field predicted using a data mining classification or regression model. The predicted value can be either categorical or numerical.

S

similarity scale
A scale for a numerical field used to compute similarities for data mining clustering. The similarity is 50% when the values differ by the similarity scale.
source table
Defines the data on which data mining is done. The source table is either a base table or a view.
support
The support of a data mining association rule is the percentage of transactions that contain all items of the rule. The support of the data mining association rule X+Y->Z is 100 times the number of transactions that contain X, Y, and Z divided by the total number of transactions.

T

target field
The special field, used in data mining classification and regression, whose value will be predicted. In classification, the target field is called a class label, and belongs to the categorical field type. In regression, the target field belongs to the numerical field type.
testing phase
A phase in which the following sequence occurs:
  1. A set of rows containing values for the target field is read.
  2. Each row is evaluated (as in the application phase).
  3. The predicted value is compared to the actual value in the target field.
The testing phase is used only for data mining classification and regression.
training data
Data used as input for the training phase.
training phase
The phase in which the data mining model is computed. This phase is common to all data mining functions.
training run
The computation of a data mining model using data mining settings.

V

validation phase
Part of the training phase for data mining Classification and Regression mining functions. In this phase, the calculated data mining model is used with another set of rows. The purpose is to test these rows against the data mining model. See testing phase.

Bibliography

This bibliography lists all publications in the Intelligent Miner library other than this book, related IBM publications that are relevant to the contents of this book, and non-IBM publications that might be useful for reference purposes.

Where appropriate, IBM publication numbers are given after the document title. This will assist you in finding the document online at the IBM Publications Center.

IBM DB2 Intelligent Miner publications

Related information

IBM Web sites

Other Web sites

Index

Special characters
A B C D E F G H I J L M N O P Q R S T U V W X
Special characters A B C D E F G H I J L M N O P Q R S T U V W X