This edition applies to Version 8.2 of:
and to all subsequent releases and modifications until otherwise indicated in new editions.
This book introduces the Easy Mining procedures. It explains how you can use them with the application programming interface (API) of the Intelligent Miner(TM) products IBM(R) DB2(R) Intelligent Miner Scoring and IBM DB2 Intelligent Miner Modeling, in this book referred to as IM Scoring and IM Modeling.
This book describes how you can solve various business problems in different business areas by using the Easy Mining procedures. It explains when to use which of the available Easy Mining procedures. It also contains a complete and detailed reference of the Easy Mining procedures.
The Easy Mining procedures are automatically installed when you are installing IM Modeling.
This book does not contain a glossary. See IM Modeling: Programming and Administration or IM Scoring: Programming and Administration for product specific terminology.
For an overview of the traditional data mining process, see Appendix A. Data mining at a glance. For more information about data mining and the Intelligent Miner library, see Bibliography.
This book is for application designers and application programmers who want to integrate Data Mining functionality into their own applications.
You should be familiar with databases, in particular with DB2, and the structured query language (SQL). If you are a Java(TM) programmer, you must know how to call SQL statements from Java APIs. You can use any other programming language that can handle SQL. The knowledge of data mining functions is not required, however, it helps to understand the concepts that are introduced in this book.
The Easy Mining procedures are included in the schema IDMMX. To call an Easy Mining procedure, you must specify the qualified name of the Easy Mining procedure, for example, IDMMX.FindDeviations. In this book, the names of the Easy Mining procedures are shown without the schema names.
Table 1 shows the highlighting conventions that are used in this book.
| Element type | Highlighting convention | Example |
|---|---|---|
| Variables | Italics | <modelName> |
| Command syntax | Monospaced and bold font |
IDMMX.SetTraceFile() <traceFile> |
Names of the following element types:
|
Monospaced font |
|
| Names of the Easy Mining procedures and options | Bold | With the IDMMX.FindDeviations procedure, you can use the DM_setMaxNumClus option. |
| New terms that are introduced for the first time | Italics | This column is called the target column. |
| Emphasis on a particular statement | Italics | To exclude several columns, create a view. |
Table 2 shows the abbreviations that are used in this book.
| Abbreviation | Meaning |
| API | Application programming interface |
| CRM | Customer relationship management |
| PMML | Predictive model markup language |
| SQL/MM | Structured query language/Multimedia |
| UDF | User-defined function |
Your feedback is important in helping to provide the most accurate and high-quality information. If you have any comments about this book or any other Intelligent Miner products documentation:
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 typical mining tasks and for basic mining steps.
The Easy Mining procedures for typical mining tasks correspond to the main steps of the data mining process. They are easy to use because any parameter modifications that might be required are done by the mining functions. This means that you do not need to have in-depth knowledge about data mining.
With the Easy Mining procedures for typical mining tasks, you can solve most of the typical business problems in various application areas, for example, Banking or Manufacturing, without having in-depth data mining skills.
Table 3 provides an overview of the available Easy Mining procedures for typical mining tasks.
| Mining tasks | Easy Mining procedure |
|---|---|
| Finding deviations | FindDeviations |
| Finding groups with similar characteristics | ClusterTable |
| Finding relationships | FindRules |
| Predicting future behavior | PredictColumn |
| Predicting an outcome | PredictColValue |
| Finding explanations for specific events | ExplainColValue |
| Finding most important fields | FindMostImpFields |
For more information, see Easy Mining procedures for typical mining tasks.
The Easy Mining procedures for basic mining steps correspond to the SQL API of IM Modeling and IM Scoring. They are easy to use because their syntax is easy. Their syntax is easy because they concentrate on the more frequently used concepts of SQL/MM. They might provide better results compared to the Easy Mining procedures for typical mining tasks because you can modify the parameters. However, this means that you need some knowledge about the data mining process. For example, you must know how to modify the maximum number of clusters to gain better clustering results.
With the Easy Mining procedures for basic mining steps, you can create, test, and modify data models. You can later apply these data models to new data to help you make successful business decisions.
Table 4 provides an overview of the available Easy Mining procedures for basic mining steps.
| Mining steps | Classification mining function | Regression mining function | Clustering mining function | Associations mining function |
|---|---|---|---|---|
| Building models | BuildClasModel | BuildRegModel | BuildClusModel | BuildRuleModel |
| Testing models | TestClasModel | TestRegModel | - | - |
| Applying models | ApplyClasModel | ApplyRegModel | ApplyClusModel | - |
| Exporting models | ExportClasModel | ExportRegModel | ExportClusModel | ExportRuleModel |
| Exporting test result | ExportClasTestResult | ExportRegTestResult | - | - |
| Building views | BuildClasView | BuildRegView | BuildClusView | - |
For more information, see Easy Mining procedures for basic mining steps.
Preprocessing and utility procedures help you to prepare your data for an Easy Mining procedure, or to accomplish administrative tasks, for example, handling error messages, canceling Easy Mining procedures, or working with the trace file. The following procedures are available:
For more information, see Using preprocessing and utility procedures.
This chapter describes a banking scenario. It explains the everyday life situation of a bank and the goals the bank might have based on this everyday life situation. It also describes the advantage of finding deviations and how you can do this by using the Easy Mining procedure FindDeviations.
A bank has quite a lot of information about its customers. For example, it knows the gender, the age, and the profession of its customers. Besides this demographic information, the bank also collects data about the status of its customers. For example, the bank might know since when a person has been a customer of this bank.
Of course, a bank has much more information about its customers. It might also know, for example, the banking products its customers hold, the average balance of the accounts, or the number of transactions. To keep it simple, only little information is used in this example.
The information that the bank collected is stored in a database. You can create tables or views from this information. One row in a table or view contains the complete information about a particular customer. The table or view might look like the table that is shown in Figure 1.
The table that is shown in Figure 1 contains one record for each customer. Each customer is identified by a value in the column CLIENT_ID, for example, 00861101. The other columns in the table contain values for age, gender, marital status, profession, and the number of years as client at that bank.
You can create the DEMOBANK database including this table by following these steps:
db2 "create database DEMOBANK"
idmenabledb DEMOBANK dbcfg
If the executable file idmenabledb is not in the search path, you can find it in the bin directory of your Intelligent Miner Modeling or Intelligent Miner Scoring installation path. For more information, see IBM DB2 Intelligent Miner Scoring, IBM DB2 Intelligent Miner Modeling, IBM DB2 Intelligent Miner Visualization: Installing the Intelligent Miner products.
db2 -tvf SampleTables.db2
The bank might want to find the customers who are to some respect different from the other customers. These customers might have been neglected in the past because they fall out of the standard target groups, however, they might be as profitable as other groups of the customers.
Another goal of the bank might be to find implausible combinations of values that should be corrected in this table. For example, the value employee in the PROFESSION column and the value 80 in the AGE column indicates that the record needs to be updated because someone at this age is not actively working as an employee anymore.
This means that the bank is looking for deviations.
You can detect deviations by using the Easy Mining procedure FindDeviations.
Use the following command to run the Easy Mining procedure:
db2 "call IDMMX.FindDeviations('BANK.DEV_CUSTOMERS',
'BANK.CUSTOMERS_MASTERDATA')"Where:
The result of this call is the output view BANK.DEV_CUSTOMERS that is shown in Figure 2.
The BANK.DEV_CUSTOMERS view contains the columns of the input table BANK.CUSTOMERS_MASTERDATA and the following additional columns:
The records in the BANK.DEV_CUSTOMERS view that is shown in Figure 2 are sorted in descending order by their deviation degree value. The first two rows in this table have a deviation degree of 7506. This means that these rows represent the most remarkable deviations. These rows include the following values:
Typically, women at the age of 64 or 66 are already retired. Therefore this information might not be up to date.
The records with the deviation degree of 3753 represent a group of 4 women at the age of approximately 30 years who are separated or divorced. They are new customers. They are inactive or they have an intermediate profession. Therefore they might not represent an interesting target group for sales of securities. The same is likely to be true for the next group with a deviation degree of 3002.4. This group represents old retired men.
For more information about the FindDeviations procedure, see Finding deviations (FindDeviations procedure).
Easy Mining procedures for typical mining tasks describes the available Easy Mining procedures for typical mining tasks. It starts with the complete description of the FindDeviations procedure that is introduced in this chapter as quick start example. If the information about the FindDeviations procedure in this chapter is sufficient for you, you can skip Finding deviations (FindDeviations procedure) and continue with Finding groups with similar characteristics (ClusterTable procedure).
This chapter describes a set of typical data mining tasks, for example, finding unusual deviations in your data. You can try out these tasks on your own data by using the Easy Mining procedures. This might reveal interesting information that you have not been aware of before, because this information was hidden in your data.
For your first attempts, you can use the Easy Mining procedures with their default parameter settings. However, by using the default parameter settings, not all of the information that was previously hidden might be revealed. You can get even better results by using additional option strings.
The following chapters are divided into the following subchapters:
This section helps you to improve the results that you obtained by implementing the basic information that is provided in the previous chapters.
It is assumed that your database contains tables or views that include many data records. Each data record describes different characteristics of a distinct entity. For example:
You can find deviations in your data by using the FindDeviations procedure.
If your database contains customer data, you might want to know if there are customers that are different from the majority of customers because they have combinations of characteristics that exist only for very few customers.
Knowing such deviations in your data can be very useful for you. For example, some of the data records might represent customers who have an unusually buying behavior. There might be customers who deserve special attention because they buy expensive products of high quality.
Deviations in data tables can represent anything. This depends on the kind of input data you are using. For example, deviations can indicate fraudulent behavior because there are customers who have unusual high discount rates. Other unusual combinations can represent inconsistencies in your data. For example, if you identify a customer who is 40 years old and still goes to school, there is something wrong with your data.
For databases that describe characteristics of entities other than customers, the types of deviations that you can find depend on the kind of input data that you are using.
To find deviations, use the FindDeviations procedure.
IDMMX.FindDeviations(<deviationsView>,
<inputTable>)
With the FindDeviations procedure, you must specify the following parameters:
The FindDeviations procedure creates a view and a model. The model is stored in the table IDMMX.CLUSTERMODELS under the same name as the generated view. If a model with the same name already exists, the previous model is replaced with the new model. If a view with the same name already exists, the previous view is replaced with the new view.
This parameter is of type VARCHAR. Its size is 240.
The columns of the input table that might not be useful to create a model are ignored by the Easy Mining procedure. These are, for example, key columns.
This parameter is of type VARCHAR. Its size is 257.
The FindDeviations procedure creates a view that contains the columns of the input table and the following additional columns:
The small clusters are interesting for you because you are looking for unusual behavior. The cluster ID helps you to interpret the deviation because the typical characteristics of a cluster characterize the deviation.
To explore the clusters in detail, you can use the table function DM_getClusters of IM Modeling, IBM DB2 Intelligent Miner Visualization, in this book referred to as IM Visualization, or any other visualization tool.
Figure 3 shows the data flow of the FindDeviations procedure.
For an example of the IDMMX.FindDeviations procedure, see Quick start sample.
Sometimes you might additionally want to specify a specific parameter for an Easy Mining procedure. You can do this by including an optional parameter string in an Easy Mining procedure. For more information, see Optional parameter strings.
Sometimes you might be interested in deviations based only on a subset of the columns in the input table. If you want to use a subset of the columns only, you can remove one or more fields from the input table.
You might want to remove one or more fields from the input table.
To remove one field, you can use the DM_remDataSpecFld option. For example, to remove the column NBR_YEARS_CLI from the input table, you can use the following optional parameter string:
'DM_remDataSpecFld(''NBR_YEARS_CLI'')'
To remove more fields from the input table, you can use several DM_remDataSpecFld options in an Easy Mining procedure, or you can create a view that contains only the columns that you want to use. Use this view as input for the Easy Mining procedure.
There are more optional parameter strings. For more information, see Optional parameter strings.
The complete procedure call including the optional parameter string looks like this:
db2 "call IDMMX.FindDeviations('BANK.DEV_CUSTOMERS',
'BANK.CUSTOMERS_MASTERDATA',
'DM_remDataSpecFld(''NBR_YEARS_CLI'')')"
You can find groups with similar characteristics by using the ClusterTable procedure.
Your database might contain customer data including demographic data, for example:
The information might also include the income or the socio-demographic group of the customer.
Furthermore, you might have collected other customer information. This information depends on the business that you are in. For example, a retail store might collect the sales transactions of their customers. From this information, you can compute the following results:
Another example is an insurance company that knows the contracts that their customers have signed. Or a bank that knows the accounts of their customers and the amount of transactions per account.
These are only few examples of the kind of information that data tables can contain. The data tables can also contain data other than customer data. A manufacturing company might collect information about the production of their products, or a retail chain might collect information about their stores.
If you have data tables that contain this kind of information, you might want to know whether this data set has an inherent structure, or if it contains groups of objects that are very similar.
Knowing such groups enhances your business operations immensely because you can treat your customers according to the group that they belong to. For example, you can define specific product offerings or marketing campaigns targeted for each important group instead of treating all customers equally.
The Easy Mining procedure ClusterTable might find a group of customers that prefers healthy food of high quality. This is the appropriate customer group for a promotion of ecologically produced French cheese. It does not make any sense to send this group an advertisement about frozen pizza.
To find groups with similar characteristics, use the ClusterTable procedure.
IDMMX.ClusterTable(<clusterView>,
<inputTable>,
<minSize>,
<maxSize>)
With the ClusterTable procedure, you must specify the following parameters:
The ClusterTable procedure creates a view and a model. The model represents the characteristics of the clusters. It is stored in the table IDMMX.ClusterModels under the same name as the generated view. If a model with the same name already exists, the previous model is replaced with the new model. If a view with the same name already exists, the previous view is replaced with the new view.
This parameter is of type VARCHAR. Its size is 240.
The columns of the input table that might not be useful to create a model are ignored by the Easy Mining procedure. These are, for example, key columns.
This parameter is of type VARCHAR. Its size is 257.
This parameter is of type REAL.
This parameter is of type REAL.
The values for the minimum and the maximum size of a cluster are indicated in percent. For example, a minimum size of 10,0 means that the smallest cluster contains 10% of the records that are contained in the input table.
The view created by the ClusterTable procedure contains the columns of the input table and the following columns:
The value can range from 0 to 1.
The quality value refers to a single record within the model.
The value can range from 0 to 1.
The confidence value refers to a single record within the model.
To explore the characteristics of each cluster in more detail, you can open the clustering model with IM Visualization or with any other visualization tool that supports PMML. Visualizing the clustering model helps you to assess whether the clustering model is useful for you.
Figure 4 shows the data flow of the ClusterTable procedure.
You can use the quality value to select the best records that belong to a cluster. For example, you might have a limited budget for a mailing campaign. This budget does not allow to address all customers that belong to a cluster. With the quality value, you can select the most promising customers to address.
Typically, you do not want clusters that are too large. For example, a cluster that represents 75% of the whole population is not interesting because it does not differ too much from the characteristics of the whole population.
Based on your business requirements, clusters that are too small also might not be interesting. For example, if you apply clustering for target marketing, there might be a lower limit for the size of a target group for a promotion campaign. If this target group is too small, the costs of the campaign might exceed the expected revenue.
In other cases, however, you might be interested in very small clusters. These clusters represent the niches. For example, if you are looking for patterns of unusual behavior in your data to detect fraud or other kinds of irregularities. If you are looking for patterns of this kind, use the FindDeviations procedure. See Finding deviations (FindDeviations procedure) for more information.
Figure 5 shows customer data of a bank. The table contains the following information:
In a real banking scenario, a table containing customer data includes probably more columns than the example shown in Figure 5.
To discover interesting clusters in the table BANK.CUSTOMERS, you can use the Easy Mining procedure ClusterTable.
Use the following command to run the Easy Mining procedure:
db2 "call IDMMX.ClusterTable('BANK.CLUSVIEW',
'BANK.CUSTOMERS',
10,
35)"Where:
Figure 6 shows the data flow of the ClusterTable procedure based on the example used in this section.
The output view BANK.CLUSVIEW shown in Figure 7 contains the columns of the input table BANK.CUSTOMERS and additionally the columns CLUSTER_ID, QUALITY, and CONFIDENCE. The CLUSTER_ID column contains values from 1 to 4. This means that the Clustering mining function has computed 4 clusters.
The result view BANK.CLUSVIEW shown in Figure 7 only shows which record belongs to which cluster. If you want to analyze the characteristics of the clusters, you can open the clustering model DEMOBANK.CLUSVIEW that is stored in the IDMMX.CLUSTERMODELS table with IM Visualization or with any other visualization tool that supports PMML.
Figure 8 shows the clustering model BANK.CLUSVIEW with IM Visualization. The Graphic View of the Clustering visualizer shows that there are 4 clusters. The largest cluster contains 33,71% of the total population. The smallest cluster contains 13,56% of the total population.
The pie charts and the bar charts show the distribution of the values of the columns in the clusters compared to the total population.
Only in the two leftmost histograms of the bar chart NO_DEBIT_TRANS, the relative frequency of debit transactions in cluster 1 is higher than in the total population. These histograms indicate the fraction of customers with the lowest number of debit transactions. These customers are the least active with regard to debit transactions.
The columns INT_CREDITCARD and NO_DEBIT_TRANS show you that the customers included in this cluster are not the most interesting customers.
Sometimes you might additionally want to specify a specific parameter for an Easy Mining procedure. You can do this by including an optional parameter string in an Easy Mining procedure. For more information, see Optional parameter strings.
There are a lot of ways how to partition the contents of a table into homogenous clusters. The Clustering mining function is using one of these ways. Often the first clustering result does not fully satisfy your business requirements. Therefore you need to refine the results.
The clustering results depend mainly on the input data. Therefore the main issue is to select the appropriate columns as input for the Clustering mining function. The ClusterTable procedure is using all columns of an input table. To specify particular columns as input data, you can choose between the following options:
You can remove one or more fields from the computation of the model. For more information, see Removing fields from the input table.
Values of supplementary columns are not used to compute the similarity of records. However, statistics of these columns are computed and included in the generated model for reference purposes.
To define a column as supplementary, you must set the field usage type of this column to 2. You can set the field usage type with the DM_setFldUsageType option. For example, to define the column PROFESSION as supplementary, you can use the following option string:
'DM_setFldUsageType(''PROFESSION'',2)'Where:
There are more optional parameter strings. For more information, see Optional parameter strings.
The complete procedure call including the optional parameter string looks like this:
db2 "call IDMMX.ClusterTable('BANK.CLUSVIEW',
'BANK.CUSTOMERS',
10,
35
'DM_setFldUsageType(''PROFESSION'',2)')"
You can find relationships in your data by using the FindRules procedure.
Your database might include a data table that contains customer data. You might want to find out whether there are relationships between the values in the columns of this table. For example, such a relationship might indicate that in a certain number of cases a column has a specific value if other columns have a specific value combination.
For example, the FindRules procedure might find out that 70% of the male customers who have an online access to their account also have a credit card. This is an interesting cross-selling information that you can exploit in the next marketing campaign.
You can also apply the FindRules procedure to retail transaction data. A sales transaction consists of the items that a customer has bought during a visit to the retail store. The information is stored in a table with at least the following columns:
The items with the same associated transaction ID are bought together. If you apply the FindRules procedure to a transaction table, you might find out the relationships between the purchased items. They indicate, for example, that in 45% of the cases if customers buy cereals they also buy fruit. With this cross-selling information, you can decide where to place the products in your store or on which products you might put a discount in the next marketing campaign.
To find relationships in your data, use the FindRules procedure.
IDMMX.FindRules(<rulesView>,
<inputTable>,
<groupColumn>,
<nbRules>,
<minConfidence>)
To find relationships in your data, you must specify the following parameters for the FindRules procedure:
The FindRules procedure creates a view and a model. The model is stored in the table IDMMX.RuleModels under the same name as the generated view. If a model with the same name already exists, the previous model is replaced with the new model. If a view with the same name already exists, the previous view is replaced with the new view.
This parameter is of type VARCHAR. Its size is 240.
The columns of the input table that might not be useful to create a model are ignored by the Easy Mining procedure. These are, for example, key columns.
This parameter is of type VARCHAR. Its size is 257.
If you specify a column of the input table as the GROUP column, the remaining columns of the input table are used as item columns.
If you specify NULL for the GROUP column, each record represents a transaction and all columns of the input table are used as item columns.
This parameter is of type VARCHAR. Its size is 128.
For information about the valid SQL types of categorical and numerical fields, see Mining field types.
The generated rules are stored in a view.
This parameter is of type INTEGER.
The confidence of each rule is greater or equal to the value that you specified for minimum confidence.
This parameter is of type REAL.
The Associations mining function computes associations rules. The set of the computed associations rules is called rule model.
The first part of an associations rule is called rule body. The second part of an associations rule is called rule head.
If you use the Associations mining function, for example, on customer data of a bank, the rule body and the rule head might represent column value pairs, for example, online_access=YES. The associations rule is interpreted like this:
If online_access=YES then bankcard=YES
If you use the Associations mining function, for example, on retail transaction data, the rule body and the rule head might represent articles that occur in retail transactions, for example, chocolate, or candy. The associations rule is interpreted like this:
If customers buy chocolate, they also buy candies.
Associations rules include the following attributes:
For example, rule ID 123 in Figure 13 indicates that in 57,576% of the cases where customers have a savings account with a building society, they also have a home insurance contract and a popular savings plan.
The support value of the rule head can be considered as the expected value for the confidence. It indicates the relative frequency of the rule head in the whole transaction set.
The confidence value of the associations rule indicates the relative frequency of the rule head that contains the items of the rule body. For example, if the confidence of the following rule is 30%, and the frequency of the customers who buy candies (which is the support of the rule head) is 10%, you can expect that 10% of the customers who buy chocolate also buy candies. Therefore 10% is the expected confidence, and 30% / 10% = 3.0 is the lift of the rule:
If customers buy chocolate, they also buy candies
Figure 11 shows the data flow of the FindRules procedure.
The FindRules procedure is very useful in the banking business.
A bank knows the banking products that their customers own. This information might be stored in the table BANK.CUSTOMER_PRODUCTS. This table contains the following columns:
The table might look like this:
Because customers can possess more than one banking product, tables can contain more than one record for a given client ID. The table in Figure 12 shows that the customer with the client ID 395821 owns one product while the customer with the client ID 856 owns five products.
The bank might want to know whether there are relationships between the products that a customer owns. You can use the FindRules procedure to find such relationships.
Use the following command to run the Easy Mining procedure:
db2 "call IDMMX.FindRules('BANK.PRODUCT_RULES',
'BANK.CUSTOMER_PRODUCTS',
'CLIENT_ID',
100,
30)"
Where:
The result of calling the IDMMX.FindRules procedure might look like this:
In Figure 13, rule 122 includes the product home insurance contract in the BODYTEXT column because the home insurance contract represents the body of the rule. The product savings account with a building society represents the head of the rule. Therefore it is included in the HEADNAME column.
Sometimes you might additionally want to specify a specific parameter for an Easy Mining procedure. You can do this by including an optional parameter string in an Easy Mining procedure. For more information, see Optional parameter strings.
When you use the FindRules procedure, you can do the following actions:
For more information, see Removing fields from the input table.
The input table CUSTOMER_ID that is shown in Figure 12 contains the following columns:
The PRODUCT column is implicitly specified as item_ID column, because the CLIENT_ID column is specified as group_ID column.
If you have a table with more than two columns, you can specify a particular column as the item ID column by using the DM_setItemFld option. If you specify a column as item ID column, only this column is considered by the Easy Mining procedure. If you do not specify a column as item ID column, all columns are searched for relationships.
With the DM_setItemFld option, you can set the name for the item_ID column. For example, if you want to specify the PRODUCT column as the item ID column, the options string looks like this:
'DM_setItemFld(''PRODUCT'')'
Transaction tables, for example, the BANK.CUSTOMER_PRODUCTS table that is shown in Figure 12, might contain numbers that represent the product identification instead of product names. Running the FindRules procedure on such tables generates rules that include numbers instead of product names. Such a rule might look like this:
If [2937], then [5879]Where:
This makes the understanding of the rules very difficult. To display the appropriate product names, you can define a name mapping that maps the product ID to the appropriate name in the associations rules.
The mapping from the product ID to the product name must be defined in a table. If such a table exists, you can use the DM_addNmp option and the DM_setFldNmp option to define a name mapping and apply it to the PRODUCT field.
It is assumed that the mapping is defined by the table BANKING.PRODUCTS. This table contains the following columns:
The following option string defines a name mapping that is called PRODUCT_NAMES:
'DM_addNmp("PRODUCT_NAMES",
"BANK.PRODUCTS",
"ID",
"DESCRIPTION")'
The following option string applies the name mapping PRODUCT_NAMES to the PRODUCT column:
'DM_setFldNmp("PRODUCT",
"PRODUCT_NAMES")'
There are more optional parameter strings. For more information, see Optional parameter strings.
The complete procedure call including the optional parameter strings looks like this:
db2 "call IDMMX.FindRules('BANK.PRODUCT_RULES',
'BANK.CUSTOMER_PRODUCTS',
'CLIENT_ID',
100,
30
'DM_setItemFld(''PRODUCT''),
DM_addNmp(''PRODUCT_NAMES'',
''BANK.PRODUCTS'',
''ID'',
''DESCRIPTION''),
DM_setFldNmp(''PRODUCT'',
''PRODUCT_NAMES'')')"
You can predict future behavior by using the PredictColumn procedure.
Your database might contain customer data. In the tables or views of your database, there might be one column that you are particularly interested in. For example, if you want to know the aggregated revenue of each customer who visited your shop last year, you might be interested in the AGGREGATED REVENUE column. This column is called the target column.
You might want to know whether there are relationships between the occurrence of the values in the target column AGGREGATED REVENUE and the values of the other columns such that you can predict from the values of the other columns the values occurring in the target column AGGREGATED REVENUE. If you have new customer data that does not yet contain values in the AGGREGATED REVENUE column, you can predict the estimated revenue of new customers.
If you have new customer data that does not yet have values in the target column CATEGORY, you can predict the category that the new customers best fit into. This information helps you to plan a marketing campaign for this particular customer category.
In customer relationship management, you might want to predict which customers are likely to buy certain products. This information helps you to promote cross-selling.
In the health care industry, you can find relations between symptoms and diseases. With this information, you can predict the potential diseases of new patients.
To predict future behavior, you can use the IDMMX.PredictColumn procedure.
IDMMX.PredictColumn(<predView>,
<inputTable>,
<targetColumn>)
To predict future behavior, you must specify the following parameters for the PredictColumn procedure:
The PredictColumn procedure creates a view and a model. Depending on the mining function that is used to build the model, the model is stored in one of the following tables under the same name as the generated view:
If a model with the same name already exists, the previous model is replaced with the new model. If a view with the same name already exists, the previous view is replaced with the new view.
This parameter is of type VARCHAR. Its size is 240.
The columns of the input table that might not be useful to create a model are ignored by the Easy Mining procedure. These are, for example, key columns.
This parameter is of type VARCHAR. Its size is 257.
The PredictColumn procedure derives the values in this column from the values of the other columns in the input table. If the values in the target column are categorical, the Classification mining function is used. If the values in the target column are numeric, the Regression mining function is used.
This parameter is of type VARCHAR. Its size is 128.
For information about the valid SQL types of categorical and numerical fields, see Mining field types.
Figure 14 shows the data flow of the PredictColumn procedure. By applying the PredictColumn procedure to the input table with the specified target column, a model and a view is generated. The view includes the columns of the input table and the columns PREDICTION and CONFIDENCE.
Based on the input parameters, the PredictColumn procedure creates a view. This view contains the columns of the input table and the following additional columns:
If the target column is categorical, the confidence value can range from 0 to 1.
If the target column is numeric, this column contains only null values.
With the prediction confidence, you can select the most reliable predictions.
To analyze the prediction model in detail, you can use IM Visualization or any other visualization tool that supports PMML.
The PredictColumn procedure splits the input data in the following disjoint data sets:
The model quality indicates how well the model might perform on unknown data. Typically, the model quality is better on the training data than on the validation data because the model might be tuned towards the records of the training data set. In the extreme case it is as if you learned all records of the training data set by heart. This means that you had an optimal model quality for the training data set because for all records of the training data set the predictions were correct. On the other hand, you would not know what to predict for a record of the validation data set unless it had the same values as a record in the training data set. Therefore, for computing the quality of the model , it is better to use data records that were not used in the training phase.
The input data in Figure 15 represents a banking scenario. It shows the following information about banking customers:
The BANKCARD column in the DEMOBANK.BANKCUSTOMERS table indicates whether customers have a bank card. Based on this information, the management of the bank might plan a promotion campaign for bank cards.
The bank management needs to know who might be a good candidate to offer the bank card. Therefore the bank management wants to find out the characteristics of customers who have a bank card, and the characteristics of customers who do not have a bank card. Good candidates for the promotion are customers who do not yet have a bank card, although they possess the characteristics of a bank card holder.
To determine the characteristics of bank card holders and non-bank card holders, you can use the PredictColumn procedure.
Use the following command to run the Easy Mining procedure:
db2 "call IDMMX.PredictColumn('BANK.BANKCARD_PRED',
'BANK.BANKCUSTOMERS',
'BANKCARD')"Where:
Figure 15 shows the data flow of the PredictColumn procedure: applying the PredictColumn procedure to the input table BANKCUSTOMERS produces a model and an output view. The model and the output view have the same name, for example, BANK.BANKCARD_PRED. The model is stored in the IDMMX.CassifModels table. The output view BANK.BANKCARD_PRED that is shown in Figure 15 contains the columns of the input table and the following additional columns:
You can use the BANK.BANKCARD_PRED output view to select candidates for a bank card promotion.
Potential candidates for the bank card promotion are the customers who are identified as not having a bank card yet although they have the characteristics of bank card holders. In the BANK.BANKCARD_PRED output view that is shown in Figure 15, these candidates are represented by the records that have a NO value in the BANKCARD column and a YES value in the PREDICTION column.
With the information in the output view BANK.BANKCARD_PRED, you can select the candidates for the bank card promotion. However, if you want to know the characteristics that distinguish bank card holders from non-bank card holders, you can analyze the model BANK.BANKCARD_PRED that is stored in the table IDMMX.ClassifModels by opening it with IM Visualization or any other visualization tool that supports PMML.
You can determine the characteristics of bank card holders by analyzing the Tree View of the Classification Visualizer in Figure 16 .
The first test ONLINE_ACCESS=YES is performed on the value of the tree node with the node ID 1.1. This tree node is not expanded because it is pruned. The SCORE value of this tree node is YES. This means that there is a good chance that this customer also has a bank card. The PURITY value shows that 83,5% of the customers with an online access to their account have a bank card. The value in the RECORD COUNT column shows that 22% of the customers have online access to their accounts.
The tree node with the node ID 1.2 is expanded because it is not pruned. The SCORE value of this tree node is NO. Some descendants of this node are labeled with YES in the Score column, for example, the node 1.2.1.1.2.1.
By analyzing these nodes and their corresponding paths related to the root node, you can determine the other characteristics that identify a bank card holder.
The Confusion Matrix View of the Classification Visualizer in Figure 17 shows the number of correct and incorrect predictions for the validation data.
The target column of the model BANK.BANKCARD_PRED has the following predicted values:
The confusion matrix in Figure 17 shows that 264 of the non-bank card holders are classified as bank card holders. This is the target group that you are interested in.
Sometimes you might additionally want to specify a specific parameter for an Easy Mining procedure. You can do this by including an optional parameter string in an Easy Mining procedure. For more information, see Optional parameter strings.
The required quality of a prediction model depends on the application for which you want to use it. Being significantly better than random guessing might be a good result. This applies, for example, if you want to predict cross-selling opportunities.
In other application areas, a good prediction quality is mandatory, for example, if you want to use a reliable model to predict diseases from symptoms.
You might think that the prediction quality always should be as good as possible. In general, this is true. However, sometimes the result might be too good. The reason for a result that is too good can be that there are causal dependencies between the target field and some input fields.
For example, possessing a bank card leads to an increasing amount of debit transactions. Therefore, a high number of debit transactions seems to be a good indicator for possessing a bank card. However, the causal relationship is just the inverse. The possession of a bank card implies a higher amount of debit transactions. It does not imply that a high number of debit transactions entails having a bank card.
There are more reasons for having a high amount of debit transactions.
You should always examine the tests near the root node of the classification tree. You should check whether there are columns that have causal relationships. Whenever you identify columns with causal relationships, you must remove them from the input fields.
For more information about removing fields from the input table, see Removing fields from the input table.
You can set more parameters of the Tree Classification mining function by using optional parameter strings. For example, if the target field is categorical, you might want to set the maximum tree depth. For more information, see How to go further.
There are more optional parameter strings. For more information, see Optional parameter strings.
You can predict values by using the PredictColValue procedure.
You might have a database with customer data. In the tables or views of your database, there might be one column that you are particularly interested in. For example, if you want to know whether your customers have answered to a mailing campaign, you might be interested in the RESPONDED column. If you want to know whether customers have canceled their contracts, you might be interested in the CONTRACT column.
The column that you are particularly interested in is called the target column. The target column CONTRACT_STATUS can have several values, for example, SIGNED, PROLONGED, or CANCELED. Typically, you are not interested in all values of the target column. You might be interested only in one value. For example, to prevent customers from canceling their contracts, you want to know the customers who are likely to cancel a contract. Therefore, you are only interested in the target value CANCELED.
You might want to know whether there are relationships between the occurrence of the CANCELED value in the target column CONTRACT_STATUS and the values of the other columns such that you can predict from the values of the other columns the likelihood that the target column CONTRACT_STATUS contains the value CANCELED.
To predict an outcome, use the PredictColValue procedure.
IDMMX.PredictColValue(<predView>,
<inputTable>,
<targetColumn>,
<targetValue>)
With the PredictColValue procedure, you must specify the following parameters:
The PredictColValue procedure creates a view and a model. The model is stored in the table IDMMX.PredictColValue under the same name as the generated view. If a model with the same name already exists, the previous model is replaced with the new model. If a view with the same name already exists, the previous view is replaced with the new view.
This parameter is of type VARCHAR. Its size is 240.
The columns of the input table that might not be useful to create a model are ignored by the Easy Mining procedure. These are, for example, key columns.
This parameter is of type VARCHAR. Its size is 257.
This parameter is of type VARCHAR. Its size is 128.
For information about the valid SQL types of categorical and numerical fields, see Mining field types.
This parameter is of type VARCHAR. Its size is 128.
The PredictColValue procedure creates a view. This view contains the columns of the input table and the following additional columns:
The values in this column can range from 0 to 1.
With the confidence value, you can determine whether an individual prediction is sufficiently reliable for your application.
It might be useful to consider the results of different prediction techniques. For example, for a mailing campaign it might be more appropriate to use a target audience selected by the Classification mining function instead of a target audience selected by the Regression mining function. It depends on the size of the target audience. If you use a different size of target audience, it might be more appropriate to select the target audience by the Regression mining function. The values in the CLASSIFICATION_CONFIDENCE column and the PREDICTED_VALUE column help you to make this decision.
For more information, seeDetermining the best suited model.
Figure 18 shows the data flow of the PredictColValue procedure.
The PredictColValue procedure does not use the original target column for the mining runs. To build a classification model, it creates a new categorical target column that includes the following values:
To build a regression model, the PredictColValue procedure creates a numeric column. This column can contain the value 1 or 0.
Prediction models are computed on a subset of the input data. The PredictColValue procedure splits the input data into the following disjoint data sets:
The model quality indicates how well the model might perform on unknown data. You can use the validation results to select the model that is best suited according to the requirements of your application. For more information, see Splitting tables into training data sets and test data sets.
To make the difference of the results clear between the PredictColValue procedure and the PredictColumn procedure, the same data is used for both procedures.
You might want to find a prediction model for the BANKCARD column. You are interested in the target value YES.
Use the following command to run the PredictColValue procedure:
db2 "call IDMMX.PredictColValue('BANK.BANKCARD_PRED_YES',
'BANK.BANKCUSTOMERS',
'BANKCARD',
'YES')"
Figure 19 shows the data flow of the PredictColValue procedure based on the example in this section.
The output view BANK.BANKCARD_PRED_YES in Figure 19 shows that the TARGET_VALUE column contains only the target value YES. The classification confidence is computed with respect to the target value YES even when the value of the target column is different. For example, if the value of a target column for a certain record is NO, the confidence is computed with regard to the target value YES. In this example, the target column is BANKCARD.
Sometimes you might additionally want to specify a specific parameter for an Easy Mining procedure. You can do this by including an optional parameter string in an Easy Mining procedure. For more information, see Optional parameter strings.
For the PredictColValue procedure, you can also apply the hints and tips of the PredictColumn procedure. They are described in How to go further.
With the ExplainColValue procedure, you can find explanations in your data that indicate that the target column contains the target value.
Your database might contain data tables that describe the production of a particular product, for example, cars. Each record in the data table represents information about a particular car and details about its production process. One column in these tables represents a specific event, for example, whether the car was delivered on time, or whether it met the expected quality criteria.
If the cars are not delivered on time, you might want to find out why the delivery is delayed. If the cars do not meet the quality criteria, you might want to find out why they do not meet the quality criteria. When you know the reasons, you can take the appropriate actions to improve the production process of the cars.
When your database contains customer data, there might be a column that indicates that customers have canceled their contracts. When you know why customers have canceled their contracts, you can improve customer retention in the future.
To find explanations, use the ExplainColValue procedure.
IDMMX.ExplainColValue(<explanationView>,
<inputTable>,
<targetColumn>,
<targetValue>,
<maxExplLength>)
With the ExplainColValue procedure, you must specify the following parameters:
The ExplainColValue procedure creates a view, a classification model, and a rules model. The models are stored in the tables IDMMX.CLASSIFMODELS and IDMMX.RULEMODELS under the same name as the generated view. If a model with the same name already exists, the previous model is replaced with the new model. If a view with the same name already exists, the previous view is replaced with the new view.
This parameter is of type VARCHAR. Its size is 240.
The columns of the input table that might not be useful to create a model are ignored by the Easy Mining procedure. These are, for example, key columns.
This parameter is of type VARCHAR. Its size is 257.
This parameter is of type VARCHAR. Its size is 128.
For information about the valid SQL types of categorical and numerical fields, see Mining field types.
This parameter is of type VARCHAR. Its size is 1024.
This parameter is of type SMALLINT.
The ExplainColValue procedure creates a view that includes the following columns:
This column can contain the values A or C.
The ExplainColValue procedure generates explanations such that the target column contains a target value. These explanations represent rules that contain a rule head of <targetColumn> = <targetValue>. The rules are stored in the generated view. These rules are derived from a classification model and a rule model. These models are stored in the IDMMX.ClassifModels table and in the IDMMX.RuleModels table under the same name as the generated view.
For the classification model, the explanations are the paths to the leaf nodes labeled with the target value. It is computed on the entire input table.
The associations model is computed on all columns of the input table. Then the rules that contain a rule head of <targetColumn> = <targetValue> are filtered out.
This example is also based on the input table BANK.BANKCUSTOMERS that is used for the ClusterTable procedure in Figure 5.
You might want to find explanations why the BANKCARD column in the BANK.BANKCUSTOMERS table contains the value YES. You might want to specify 3 as the maximum value for the length of the explanations.
Use the following command to run the Easy Mining procedure:
db2 "call IDMMX.ExplainColValue('BANK.BANKCARD_EXPLANATIONS',
'BANK.BANKCUSTOMERS',
'BANKCARD',
'YES',
3)"
The ExplainColValue procedure creates the output view BANK.BANKCARD_EXPLANATIONS that is shown in Figure 21. This output view contains the explanations.
Looking at the explanations that have an explanation confidence of 84.243% in Figure 21 , you can see that the EXPLANATION column contains the explanation ONLINE_ACCESS=YES.
These explanations show that having an online account has an important influence on having a banking card. A business action that is derived from this information is, for example, that you offer to customers a banking card when they ask for an online access to their accounts.
Sometimes you might additionally want to specify a specific parameter for an Easy Mining procedure. You can do this by including an optional parameter string in an Easy Mining procedure. For more information, see Optional parameter strings.
Always check the explanations whether there is a causal dependency between the explanation target and an input field. For more information about causal dependencies, see How to go further.
If there is a dependency, remove this field from the input fields by using the DM_remDataSpecFld options. For more information, see Removing fields from the input table.
There are more optional parameter strings. For more information, see Optional parameter strings.
You can find most important fields by using the FindMostImpFields procedure.
You might collect data about customers or a manufacturing process. The data might be difficult or expensive to collect. Therefore you want to know whether you need to collect complete data, or if there are parts of the data that you do not need to collect.
For example, if you collect only the required information, you can enhance the satisfaction of your customers because you need not ask them superfluous questions. Or you can optimize your database design by keeping only the required information in the tables. This way you can reduce the costs of your business intelligence infrastructure.
You are looking for the most important fields in a table or a view of your database. You can determine the most important fields only with respect to a certain purpose. The purpose is represented by the target column.
The FindMostImpFields procedure finds the most important fields in a table. It determines the importance of the fields of this table with respect to the prediction of the values of the target column.
IDMMX.FindMostImpFields(<mostImpFieldView>,
<inputTable>,
<targetColumn>)
With the FindMostImpFields procedure, you must specify the following parameters:
The FindMostImpFields procedure creates a view and a model. Depending on the type of the target column, a classification model or a regression model is generated. It is stored in one of the following tables under the same name as the generated view:
If a model with the same name already exists, the previous model is replaced with the new model. If a view with the same name already exists, the previous view is replaced with the new view.
This parameter is of type VARCHAR. Its size is 240.
Depending on the type of the target column, the Tree Classification mining function or the Regression mining function computes the most important fields of this table.
The columns of the input table that might not be useful to create a model are ignored by the Easy Mining procedure. These are, for example, key columns.
This parameter is of type VARCHAR. Its size is 257.
The values of the target column can be categorical or numeric.
This parameter is of type VARCHAR. Its size is 128.
For information about the valid SQL types of categorical and numerical fields, see Mining field types.
The generated view contains the following columns:
The importance value ranges from 0 to 1. The higher this value is, the greater is the importance of the field.
You might want to determine the most important field in the BANK.BANKCUSTOMERS input table that is shown in Figure 5. The target column in this table is BANKCARD.
Use the following command to run the FindMostImpFields procedure:
db2 "call IDMMX.FindMostImpFields('BANK.BANKCARD_MOSTIMPFIELDS',
'BANK.BANKCUSTOMERS',
'BANKCARD')"
BANK.BANKCARD_MOSTIMPFIELDS is the name of the view that contains the most important fields together with their importance value.
The BANK.BANKCARD_MOSTIMPFIELDS view looks like this:
Figure 23 shows that the ONLINE_ACCESS column has the highest importance value. Other columns with a high importance value are AGE and AVERAGE_BALANCE. These are the columns with the highest influence on having a bankcard.
The columns PROFESSION, MARITAL_STATUS, and SAVINGS_ACCOUNT have the lowest importance value. Therefore their values are less relevant in the context of having a banking card.
Easy Mining procedures for typical mining tasks describes Easy Mining procedures for typical mining tasks. This chapter describes the mining steps that constitute a mining task.
The mining steps are specific to the different mining functions. Therefore you need to have some experience in data mining if you want to use the Easy Mining procedures that are described in this chapter.
The following mining functions of IM Modeling provide Easy Mining procedures for basic mining steps:
For more information about these mining functions, see IBM DB2 Modeling: Administration and Programming.
Table 5 provides an overview of the available Easy Mining procedures for basic mining steps.
| Tasks |
Classification mining procedure |
Regression mining procedure |
Clustering mining procedure |
Associations mining procedure |
|---|---|---|---|---|
| Building models | BuildClasModel | BuildRegModel | BuildClusModel | BuildRuleModel |
| Testing models | TestClasModel | TestRegModel | - | - |
| Applying models | ApplyClasModel | ApplyRegModel | ApplyClusModel | - |
| Exporting models | ExportClasModel | ExportRegModel | ExportClusModel | ExportRuleModel |
| Exporting test result | ExportClasTestResult | ExportRegTestResult | - | - |
| Building mining views | BuildClasView | BuildRegView | BuildClusView | - |
There are Easy Mining procedures for the following mining steps:
Classification and regression are prediction techniques. This means that the Classification mining function and the Regression mining function learn from known cases to predict an outcome in similar situations. Often cases are known from the past experience and applied to new cases when it can be assumed that the situation has not greatly changed. The outcome of classification is a categorical value, the outcome of regression is a numeric value. Apart from this difference, classification and regression are similar.
If you want to use the Classification mining function, the outcome must be categorical. For example, it might be the car type that a customer is interested in. It might indicate whether a customer has responded to a mailing campaign, or if a car was delivered on time.
Other application areas for classification is churn prevention or cross-selling. You might want to predict the customers who are likely to leave to take the appropriate counter measures. Or you want to predict whether customers are likely to buy certain products.
With the Easy Mining procedures for classification mining steps, you can build, test, and apply classification models. You can also build classification views and export classification models and classification test results.
Before you can use the Classification mining function, you must collect historical data about the past. This data must be in a table or a view. Each record in the table or the view describes the properties of an entity for which you know the outcome. For example, an entity might be a customer who has responded to a mailing campaign or a car that was produced on time.
Based on the historical data, the Classification mining function determines which properties distinguish the entities with a certain outcome, for example, having responded to a mailing campaign, from entities that have another outcome, for example, not having responded. For example, the Classification mining function might find out that young and single customers are more likely to respond to a mailing campaign than other customers.
The Classification mining function stores this information in a classification model. This step is called training of a model.
You can build a classification model by using the BuildClasModel procedure.
IDMMX.BuildClasModel(<modelName>,
<inputTable>,
<targetColumn>)
With the BuildClasModel procedure, you must specify the following parameters:
The generated model is stored in the IDMMX.ClassifModels table. If a model with the same name already exists, the previous model is replaced with the new model.
This parameter is of type VARCHAR. Its size is 240.
The values in the columns of the input table are used to determine the distinguishing properties for each value of the target column.
The columns of the input table that might not be useful to create a model are ignored by the Easy Mining procedure. These are, for example, key columns.
This parameter is of type VARCHAR. Its size is 240.
The target column must contain only categorical values.
For information about the valid SQL types of categorical and numerical fields, see Mining field types.
This parameter is of type VARCHAR. Its size is 128.
You might want to build the model BANK.BANKCARD_CLASMODEL to predict the BANKCARD column of the BANK.BANKCUSTOMERS table.
Use the following command to run the Easy Mining procedure:
DB2 "call IDMMX.BuildClasModel('BANK.BANKCARD_CLASMODEL',
'BANK.BANKCUSTOMERS_TRAIN',
'BANKCARD')"
A classification model assigns to each entity the outcome it considers to be the most appropriate. The outcome is the predicted value that is determined by the classification model.
The predicted value for the outcome can differ from the actual value of the outcome because a classification model is almost never perfect. The main reason for this is that the reality is much more complex than its representation in a mining model.
The quality of a classification model is the percentage of correct predictions for a given data set. The goal is to get a model with a high quality. The fraction of correct predictions should be as high as possible when you use the model to predict the outcome for entities for which the outcome is not yet known. So when you use a classification model to select customers for a mailing campaign, you want the model to select only those customers who are the most likely to respond.
The model quality based on the data that you use for the training of the model might not always be a good indicator for the number of correct predictions on unseen data. The model might be tuned too much towards the records in the training data set. This is called overtraining of a model.
In the extreme case, an overtrained model contains all records of the training data set. This means that the model learns the training data by heart. It is capable of giving correct predictions for all records of the training data set. However, when applied to unseen data, this model might perform poorly because the data might contain records that were not included in the training data. Then the model does not know what to do.
To receive a better estimate for the model quality, you can apply the model on data that already includes the outcome but is different from the training data. The easiest way to get such a data set is to split the original data table that includes the historical data into two parts. One part is used for the training of the model, and the other part is used for determining the model quality only. This mining step is called the testing of the model.
You can test models by using the TestClasModel procedure.
IDMMX.TestClasModel(<modelName>,
<inputTable>,
<testResultName>)
With the TestClasModel procedure, you must specify the following parameters:
The model is stored in the IDMMX.ClassifModels table.
This parameter is of type VARCHAR. Its size is 240.
This parameter is of type VARCHAR. Its size is 240.
The classification test result is stored in the IDMMX.ClasTestResults table.
This parameter is of type VARCHAR. Its size is 240.
To test the classification model, you might want to apply the model BANK.BANKCARD_CLASMODEL to the data in the input table BANK.BANKCUSTOMERS and save the test result BANK.BANKCUSTOMERS_TESTRESULT in the IDMMX.ClasTestResult table.
Use the following command to run the Easy Mining procedure:
DB2 "call IDMMX.TestClasModel('BANK.BANKCARD_CLASMODEL',
'BANK.BANKCUSTOMERS_TEST',
'BANK.BANKCARD_TESTRESULT')"
The goal of finding a good prediction model is to apply it to data that does not yet include values for the outcome. This mining step is called scoring or applying.
You can apply classification models by using the ApplyClasModel procedure.
IDMMX.ApplyClasModel(<modelName>,
<inputTable>,
<outputView>,
<predClasColumn>,
<confidenceColumn>)
With the ApplyClasModel procedure, you must specify the following parameters:
The model is stored in the IDMMX.ClassifModels table.
This parameter is of type VARCHAR. Its size is 240.
This parameter is of type VARCHAR. Its size is 240.
This parameter is of type VARCHAR. Its size is 240.
The output view includes the columns of the input table and the following additional columns:
This parameter is of type VARCHAR. Its size is 128.
If you do not want to include the Confidence column in the output table, leave the string for the confidence parameter empty or specify NULL for the confidence parameter.
The value for the classification confidence can range from 0 to 1. It indicates the confidence that the predicted class value for the record is correct.
This parameter is of type VARCHAR. Its size is 128.
You might want to:
Use the following command to run the Easy Mining procedure:
DB2 "call IDMMX.ApplyClasModel('BANK.BANKCARD_CLASMODEL',
'BANK.BANKCUSTOMERS',
'BANK.BANKCARD_APPLY',
'PRED_CLASS',
'CONFIDENCE')"
The BuildClasView procedure combines the training of a classification model on the input table with the application of the model to the same input table.
Combining the training and the application of a model is useful, for example, if you are interested in cross-selling opportunities. If you want to know the customers who are likely to buy a certain product but have not yet done so, you might want to apply the trained model directly to the input data to compare the predicted value with the actual value. This mining step is called building classification views.
You can build classification views by using the BuildClasView procedure.
IDMMX.BuildClasView(<viewName>,
<inputTable>,
<targetColumn>)
With the BuildClasView procedure, you must specify the following parameters:
The BuildClasView procedure creates a view and a model. The model is stored in the table IDMMX.ClassifModels under the same name as the generated view. If a model with the same name already exists, the previous model is replaced with the new model. If a view with the same name already exists, the previous view is replaced with the new view.
This parameter is of type VARCHAR. Its size is 240.
This parameter is of type VARCHAR. Its size is 240.
The target column must contain only categorical values.
For information about the valid SQL types of categorical and numerical fields, see Mining field types.
This parameter is of type VARCHAR. Its size is 128.
When the classification model is applied to the data in the input table, the view is created. This view contains the columns of the input table and following additional columns:
You might want to create the classification view BANK.BANKCARD_CLASVIEW:
Use the following command to run the Easy Mining procedure:
DB2 "call IDMMX.BuildClasView('BANK.BANKCARD_CLASVIEW',
'BANK.BANKCUSTOMERS',
'BANKCARD')"
See Exporting models and test results for information about exporting classification models and test results.
Sometimes you might additionally want to specify a specific parameter for an Easy Mining procedure. You can do this by including an optional parameter string in an Easy Mining procedure. For more information, see Optional parameter strings.
With the BuildClasView procedure, you can remove a field from the input data or set the depth of a classification tree by using the appropriate optional parameter string.
It is important to select the appropriate input fields to avoid that the model becomes overtrained. For more information about overtrained models, see Overtrained models.
For more information about removing input fields, see Removing fields from the input table.
IM Modeling uses the Tree Classification mining function for classification. Classification trees can get very complex. You can limit the tree depth of classification trees by using the DM_setTreeClasPar option. For example, to set the tree depth to 5, the DM_setTreeClasPar option looks like this:
DM_setTreeClasPar(''MaxDth'', 5)
There are more optional parameter strings for the Easy Mining procedures. For more information, see Optional parameter strings.
The complete procedure call including the optional parameter string looks like this:
db2 "call IDMMX.BuildClasModel('BANK.BANKCARD_CLASVIEW',
'BANK.BANKCUSTOMERS',
'BANKCARD',
'DM_setTreeClasPar(''MaxDth'', 5)')"
The Easy Mining procedures for regression mining steps support the following mining steps:
Regression and classification are prediction techniques. This means that the Regression mining function and the Classification mining function learn from the past to predict an outcome in the future. The outcome of regression is a numeric value, the outcome of classification is a categorical value. Apart from this difference, regression and classification are similar.
The Regression mining function predicts continuous numeric values, for example, the estimated annual revenue for each customer. It can also predict discrete numeric values, for example, 1 and 0.
Therefore you can use the Regression mining function to solve classification problems provided that the models contain exactly two categories, for example, YES and NO. If YES is mapped to 1 and NO is mapped to 0, the resulting regression model predicts values close to 1 if YES is likely and values close to 0 if NO is likely.
With the Easy Mining procedures for regression mining steps you can build, test, and apply regression models. You can also build regression views and export regression models or regression test results.
Because the regression mining steps and the classification mining steps are identical, the following sections contain only the syntax of the Easy Mining procedure and a corresponding example. For more information, see the corresponding chapters in Easy Mining procedures for classification mining steps.
You can build regression models by using the BuildRegModel procedure.
IDMMX.BuildRegModel(<modelName>,
<inputTable>,
<targetColumn>)
You must specify the following parameters for the BuildRegModel procedure:
The BuildRegModel procedure creates a model and saves it in the table IDMMX.RegressionModels. If a model with the same name already exists, the previous model is replaced with the new model.
This parameter is of type VARCHAR. Its size is 240.
The BuildRegModel procedure starts a regression training run on this table.
The columns of the input table that might not be useful to create a model are ignored by the Easy Mining procedure. These are, for example, key columns.
This parameter is of type VARCHAR. Its size is 240.
This parameter is of type VARCHAR. Its size is 128.
For information about the valid SQL types of categorical and numerical fields, see Mining field types.
You might want to predict the AVERAGE_BALANCE column of the BANK.BANKCUSTOMERS table by building the model BANK.AVERAGE_BALANCE_REGMODEL.
Use the following command to run the Easy Mining procedure:
DB2 "call IDMMX.BuildRegModel('BANK.AVERAGE_BALANCE_REGMODEL',
'BANK.BANKCUSTOMERS',
'AVERAGE_BALANCE')"
You can test regression models by using the TestRegModel procedure.
IDMMX.TestRegModel(<modelName>,
<inputTable>,
<testResultName>)
You must specify the following parameters for the TestRegModel procedure:
The model is stored in the IDMMX.RegressionModels table.
This parameter is of type VARCHAR. Its size is 240.
This parameter is of type VARCHAR. Its size is 240.
The test result is stored in the IDMMX.RegTestResults table.
This parameter is of type VARCHAR. Its size is 240.
You might want to test the regression model BANK.AVERAGE_BALANCE_REGMODEL by applying it to the data in the BANK.BANKCUSTOMERS table and to save the test result in the BANK.AVERAGE_BALANCE_TESTRESULT table.
Use the following command to run the Easy Mining procedure:
DB2 "call IDMMX.TestRegModel('BANK.AVERAGE_BALANCE_REGMODEL',
'BANK.BANKCUSTOMERS',
'BANK.AVERAGE_BALANCE_TESTRESULT')"
You can apply regression models to a table or to a view by using the ApplyRegModel procedure.
IDMMX.ApplyRegModel(<modelName>,
<inputTable>,
<outputView>,
<predValueColumn>,
<predStdDevColumn>)
With the ApplyRegModel procedure, you must specify the following parameters:
The model is stored in the IDMMX.RegressionModels table.
This parameter is of type VARCHAR. Its size is 240.
The ApplyRegModel procedure applies the regression model to the data in this table.
This parameter is of type VARCHAR. Its size is 240.
The output view contains the columns of the input table and additional columns that include values for the predicted value and the estimated standard deviation for the predicted value.
This parameter is of type VARCHAR. Its size is 240.
This parameter is of type VARCHAR. Its size is 128.
The predicted standard deviation indicates the expected range of the actual value after you have applied the model.
If you do not want to include the column for the estimated standard deviation in the output view, leave this string empty or specify null for this parameter.
This parameter is of type VARCHAR. Its size is 128.
You might want to:
Use the following command to run the Easy Mining procedure:
DB2 "call IDMMX.ApplyRegModel('BANK.AVERAGE_BALANCE_REGMODEL',
'BANK.BANKCUSTOMERS',
'BANK.AVG_BALANCE_APPLY'
'PRED_AVG_BALANCE',
'PRED_STD_DEV')"
You can build regression views by using the Easy Mining procedure BuildRegView. This procedure combines the training of regression models on the input table with the application of these models to the same table.
IDMMX.BuildRegView(<viewName>,
<inputTable>,
<targetColumn>)
With the BuildRegView procedure, you must specify the following parameters:
The BuildRegView procedure creates a view and a model. The model is stored in the table IDMMX.RegressionModels under the same name as the generated view. If a model with the same name already exists, the previous model is replaced with the new model. If a view with the same name already exists, the previous view is replaced with the new view.
This parameter is of type VARCHAR. Its size is 240.
This parameter is of type VARCHAR. Its size is 240.
The target column must contain numeric values.
For information about the valid SQL types of categorical and numerical fields, see Mining field types.
This parameter is of type VARCHAR. Its size is 128.
When the regression model is applied to the data in the input table, the view is created. This view contains the columns of the input table and the following columns:
You might want to build the regression view BANK.BANKCARD_REGVIEW:
Use the following command to run the Easy Mining procedure:
DB2 "call IDMMX.BuildRegView('BANK.BANKCARD_REGVIEW',
'BANK.BANKCUSTOMERS',
'AVERAGE_BALANCE')"
See Exporting models and test results for information about exporting models and test results.
Sometimes you might additionally want to specify a specific parameter for an Easy Mining procedure. You can do this by including an optional parameter string in an Easy Mining procedure. For more information, see Optional parameter strings.
It is important to select the appropriate input fields to avoid that the model becomes overtrained.
There might be logical dependencies between the outcome and some of the input fields. This can occur, for example, if you want to predict customer churn. There might be an input field that indicates the development of the revenue with a customer. Typically, if a customer churns, the revenue declines. Therefore there is a close correlation between a negative revenue development and churn. However, if the decline occurs after the churn, this column is not an appropriate indicator for churn. Therefore this field must be removed from the set of input fields.
For more information about removing one field from the input data, see Removing fields from the input table.
The Easy Mining procedures for clustering support the following mining steps:
The Clustering mining function discovers homogenous groups of records in your data. These groups are called clusters or segments. These clusters can represent, for example, customers who share a common buying behavior or stores with common sales characteristics.
Typically, you use the Clustering mining function to find groups whose members you want to treat similarly. For example, if you have a cluster of customers with a common buying behavior, a cluster might contain a specific target group for a marketing campaign. If you have a cluster of stores, you can optimize their offers depending on the cluster they belong to.
You can use the Clustering mining function also to detect outliers. Because the members of a cluster share a degree of similarity, the members of the smallest clusters, the niches, have only little in common with the members of the other bigger clusters. The members of the niches are the outliers or the deviations in a data set. They can represent untypical behavior or inconsistencies in your data.
You can create, apply, and export clustering models. You can also create clustering views.
The input for the Clustering mining function must be a table or a view. In this table or view, each record represents the properties of an entity to be clustered. For customer segmentation, such a table might contain demographic information about each customer, for example, age, marital status, or profession. The table also contains figures about each customer's buying behavior, for example, the total revenue per month per product category.
If you run the Clustering mining function on such a table, you get a clustering model that assigns to each record of the input table the cluster it belongs to. This is called the training of a clustering model.
IDMMX.BuildClusModel(<modelName>,
<inputTable>)
With the BuildClusModel procedure, you must specify the following parameters:
The model is stored in the IDMMX.ClusterModels table. If a model with the same name already exists in the IDMMX.ClusterModels table, the previous model is replaced with the new model.
This parameter is of type VARCHAR. Its size is 240.
The BuildClusModel procedure starts a clustering run on the data of this table.
The columns of the input table that might not be useful to create a model are ignored by the Easy Mining procedure. These are, for example, key columns.
This parameter is of type VARCHAR. Its size is 240.
You might want to create the clustering model BANK.CUSTOMERS_CLUSMODEL of the customers of a bank. The information about these customers is stored in the BANK.BANKCUSTOMERS table.
Use the following command to run the Easy Mining procedure:
DB2 "call IDMMX.BuildClusModel('BANK.CUSTOMERS_CLUSMODEL',
'BANK.BANKCUSTOMERS')"
After you have built the model, you might want to determine the records that are assigned to the individual clusters. This mining step is called scoring of a clustering model.
To apply a clustering model, you can use the ApplyClusModel procedure.
IDMMX.ApplyClusModel(<modelName>,
<inputTable>,
<outputView>,
<clusterIDColumn>,
<qualityColumn>,
<confidenceColumn>)
With the ApplyClusModel procedure, you must specify the following parameters:
The model is stored in IDMMX.ClusterModels table.
This parameter is of type VARCHAR. Its size is 240.
The ApplyClusModel procedure applies the clustering model to the data in this table.
This parameter is of type VARCHAR. Its size is 240.
The output view contains the columns of the input table and additional columns that contain the cluster identification, the clustering quality, and the clustering confidence.
If an output view with the same name already exists, the previous output view is replaced with the new output view.
This parameter is of type VARCHAR. Its size is 240.
This parameter is of type VARCHAR. Its size is 128.
The value for clustering quality indicates how the records fit into the cluster. The value can range from 1 to 0.
If you do not want to include the Quality column in the output table, leave the string for these parameters empty, or specify NULL for these strings.
This parameter is of type VARCHAR. Its size is 128.
The clustering confidence indicates the confidence that the assigned cluster ID is the best cluster for this record. The value can range from 1 to 0.
If you do not want to include the Confidence column in the output table, leave the string for these parameters empty, or specify null for these strings.
This parameter is of type VARCHAR. Its size is 128.
You might want to create the output view BANK.CUSTOMERS_CLUS_APPLY by applying the model BANK.CUSTOMERS_CLUSMODEL to the input table BANK.BANKCUSTOMERS by creating.
Use the following command to run the Easy Mining procedure:
DB2 "call IDMMX.ApplyClusModel('BANK.CUSTOMERS_CLUSMODEL',
'BANK.BANKCUSTOMERS',
'BANK.CUSTOMERS_CLUS_APPLY',
'CLUSTERID',
'CLUS_QUALITY',
'CLUS_CONFIDENCE')"
You can combine the following clustering mining steps by creating a clustering view:
If you build a clustering view, the clustering model is built and applied to the records of the input table or view. The clustering view indicates the clusters that each record belongs to.
You can build a clustering view by using the BuildClusView procedure.
IDMMX.BuildClusView(<viewName>,
<inputTable>)
With the BuildClusView procedure, you must specify the following parameters:
The BuildClusView procedure creates a view and a model. The model is stored in the table IDMMX.ClusterModels under the same name as the generated view. If a model with the same name already exists, the previous model is replaced with the new model. If a view with the same name already exists, the previous view is replaced with the new view.
This parameter is of type VARCHAR. Its size is 240.
The BuildClusView procedure starts a clustering run on the data in this table.
This parameter is of type VARCHAR. Its size is 240.
When the clustering model is applied to the data in the input table, the view is created. This view contains the columns of the input table and additionally the following columns:
You might want to create the clustering view BANK.CUSTOMERS_CLUSVIEW from customers of a bank. The information about the customers is stored in the table BANK.BANKCUSTOMERS.
Use the following command to run the Easy Mining procedure:
DB2 "call IDMMX.BuildClusView('BANK.CUSTOMERS_CLUSVIEW',
'BANK.BANKCUSTOMERS')"
See Exporting models and test results for information about exporting models and test results.
Sometimes you might additionally want to specify a specific parameter for an Easy Mining procedure. You can do this by including an optional parameter string in an Easy Mining procedure. For more information, see Optional parameter strings.
After you have used the Clustering mining function on a table, you might want to improve the model. For example, there might be a very big cluster and several smaller clusters. However, you want to have a more even partitioning of the data in your input table or view.
You can reduce the size of the biggest cluster by increasing the similarity threshold. The similarity threshold represents the minimum degree of similarity for a record to be assigned to a particular cluster. If you increase the similarity threshold, fewer records are assigned to the same cluster.
You can set the similarity threshold with the DM_setDClusPar option. The value for the similarity threshold ranges from 0 to 1. The default value for the similarity threshold is 0.5. This means that increasing the default value to a value of, for example, 0.7, reduces the size of the biggest cluster.
The optional parameter string looks like this:
DM_setDClusPar(''SimThr'',0.7)
Increasing the similarity threshold has the side effect that the number of clusters increases. If you want to limit the number of clusters, you can use the DM_setMaxNumClus option. For example, you might want to set the maximum number of clusters to 10.
The optional parameter string looks like this:
DM_setMaxNumClus(10)
You can also remove one or more fields from the input table. For more information, see Removing fields from the input table.
There are more optional parameter strings for the Easy Mining procedures. For more information, see Optional parameter strings.
The complete procedure call including the optional parameter strings looks like this:
db2 "call IDMMX.BuildClusModel('BANK.CUSTOMERS_CLUSMODEL',
'BANK.BANKCUSTOMERS',
'DM_setMaxNumClus(10),
DM_setDClusPar(''SimThr'',0.7)')"
The Easy Mining procedures for rules support the following mining steps:
Association rules indicate the items that occur together in your data.
If you have a table that contains retail transaction data, association rules indicate the articles that are bought together. Retail transaction action data is usually stored in tables that contain the following columns:
The items that have the same transaction ID belong to the same transaction.
An associations rule of retail transaction data might look like this:
If customers buy chocolate, they also buy candy.
With associations rules, you can determine the placement of the products in a store. Placing products that are linked by an association rule close to each other can increase the sales of these products.
With association rules, you can also determine the products that you might put on sale for a marketing campaign. Placing the articles that are linked by an associations rule together, however, putting not all of these articles on sale, might increase the sales of all products, those on sale and those not on sale.
In an online store, you can use associations rules to generate personalized product recommendations.
Finding associations rules is not limited to tables with retail transaction data. You can apply the Associations mining function to any relational tables. In relational tables, the associations rules indicate the values that occur together in the records of the table. For example, a rule derived from a table of bank customers might look like this:
If the value of the online-access column is YES, the value of the bankcard column is also YES.
Rules like this might reveal important relationships that are hidden in your data. These relationships can explain why certain columns have specific values. For example, in the manufacturing industry, rules like this can explain why quality problems occur or why certain goods are not produced on time.
You can build and export rule models.
The Associations mining function computes association rules. The set of the computed associations rules is called a rules model.
The first part of an associations rule is called rule body. The second part of an associations rule is called rule head.
If you use the Associations mining function on transaction tables, for example, retail transaction data, the rule body and the rule head might represent articles that occur in retail transactions, for example, chocolate, or candy.
The associations rule might look like this:
If customers buy chocolate, they also buy candy.
If you use the Associations mining function on relational tables, for example, customer data of a bank, the rule body and the rule head might represent column value pairs, for example, online-access=YES.
The associations rule might look like this:
If online-access=YES then bankcard=YES
An associations rule might not always be valid. For example, if the following associations rule has a confidence value of 60%, this rule indicates that if customers buy chocolate only in 60% of the cases they also buy candy:
If chocolate then candy
The degree of validity is indicated by the confidence value of a rule. The value for confidence is shown in percent. It states how often the rule head occurs in a transaction given that the rule body occurs in the transaction.
Another attribute of a rule is the support value. The support value indicates the relative frequency that the conditions in the rule head and in the rule body hold.
For example:
If chocolate then candy
If online-access=YES then bankcard=YES
You can build a rule model by using the BuildRuleModel procedure.
IDMMX.BuildRuleModel(<modelName>,
<inputTable>,
<groupColumn>,
<minSupport>,
<minConfidence>,
<maxRuleLength>)
For the BuildRuleModel procedure, you must specify the following parameters:
The model is stored in the IDMMX.RuleModels table. If a model with the same name already exists, the previous model is replaced with the new model.
This parameter is of type VARCHAR. Its size is 240.
The BuildRuleModel procedure starts an associations run on this table.
The columns of the input table that might not be useful to create a model are ignored by the Easy Mining procedure. These are, for example, key columns.
This parameter is of type VARCHAR. Its size is 240.
If you specify a column of the input table as the GROUP column, the remaining columns of the input table are used as item columns.
If you specify null or an empty string for the GROUP column, the BuildRuleModel procedure looks for association rules in the entire relational table.
This parameter is of type VARCHAR. Its size is 128.
For information about the valid SQL types of categorical and numerical fields, see Mining field types.
You can specify a value between 0 and 100. If you specify a value that is less or equal to 0, the value for minimum support is automatically determined to produce a result that contains at least some rules.
This parameter is of type REAL.
You can specify a value between 0 and 100. If you specify a value that is less or equal to 0, the default value of 25% is automatically used as the lower limit for the confidence of a rule.
This parameter is of type REAL.
The rule length determines the maximum number of items that occur in an associations rule. You must specify a value greater or equal to 2. For example, if you specify 3 as the maximum rule length, the associations rule contains two items in the rule body and one item in the rule head. If you specify a value less or equal to 0, the maximum rule length is not limited.
This parameter is of type INTEGER.
You might want to build the model BANK.PRODUCT_RULES based on the BANK.CUSTOMER_PRODUCTS table. The BANK.CUSTOMER_PRODUCTS table includes the columns CLIENT_ID and PRODUCT. You might want to specify the CLIENT_ID column as GROUP column because a transaction includes all products that are owned by an individual customer.
Use the following command to run the Easy Mining procedure:
DB2 "call IDMMX.BuildRuleModel('BANK.PRODUCT_RULES',
'BANK.CUSTOMER_PRODUCTS',
'CLIENT ID',
5, 30, 3)"
If you want to run the BuildRuleModel procedure on the entire BANK.CUSTOMER_PRODUCTS table, you can use the following command:
DB2 "call IDMMX.BuildRuleModel('BANK.PRODUCT_RULES',
'BANK.CUSTOMER_PRODUCTS',
NULL,
5, 30, 3)"
See Exporting models and test results for information about exporting models and test results.
Sometimes you might additionally want to specify a specific parameter for an Easy Mining procedure. You can do this by including an optional parameter string in an Easy Mining procedure. For more information, see Optional parameter strings.
You can do the following tasks by using the appropriate optional parameter string:
The Associations mining function discovers all rules for a given minimum support and minimum confidence. This means that the number of discovered rules can be huge. If you want to reduce the number of discovered rules, you must increase the values for minimum support or minimum confidence. You can also increase the values for both parameters.
You can also reduce the number of discovered rules by reducing the maximum rule length.
You might have a table with sales transaction data that includes additional columns besides the columns for the transaction ID and the item. Therefore you must specify the field that you want to use as item ID field.
To specify a field as item ID field, you can use the DM_setItemFld option. For example, if you want to specify the PRODUCT column as item ID field, the optional parameter string looks like this:
DM_setItemFld(''PRODUCT'')
In the transaction tables of the retail industry, the column PRODUCT might contain numeric values to identify the articles. The description of the articles is stored in another table. If you want the article descriptions to appear in the rules instead of the article IDs, you must specify a name mapping. For more information, see Using name mappings.
There are more optional parameter strings for the Easy Mining procedures. For more information, see Optional parameter strings.
The complete procedure call including the optional parameter strings looks like this:
db2 "call IDMMX.BuildRuleModel('BANK.PRODUCT_RULES',
'BANK.CUSTOMER_PRODUCTS',
'NULL',
5, 30, 3,
'DM_setItemFld("PRODUCT"),
DM_addNmp("PRODUCT_NAMES",
"BANK.PRODUCTS",
"ID",
"DESCRIPTION"),
DM_setFldNmp("PRODUCT",
"PRODUCT_NAMES")')"
You might want to apply a model to data that is stored in a different database. For example, you might want to apply the model in an operational application that uses the model to select the customers for a specific marketing campaign. You can do this by following these steps:
The file on the database server is of the format Predictive Model Markup Language (PMML). PMML is a standard developed by the Data Mining Group. For more information, visit the Data Mining Group.
<EasyMiningProcedure>(<modelName>,
<exportFileName>)
<EasyMiningProcedure>(<testResultName>,
<exportFileName>)
To export a model or a test result, you must specify the following parameters:
Depending on the model or the test result that you want to export, it is stored in one of the following tables:
You must specify the complete path of the file.
You might want to export the model BANK.BANKCARD_CLASMODEL to the file c:\temp\bankcard_clasmodel.xml on a Windows database server.
Use the following command to run the Easy Mining procedure:
DB2 "call IDMMX.ExportClasModel('BANK.BANKCARD_CLASMODEL',
'c:\temp\bankcard_clasmodel.xml')"
This chapter describes preprocessing and utility procedures.
With the SplitData procedure, you can split tables into training data sets and test data sets.
If you want to create a prediction model, you typically use a table or a view that contains historical data. If you decide to use the Easy Mining procedures for classification or regression, you might want to split this table into the following disjoint data sets:
You can use the SplitData procedure to split a table in two disjoint data sets.
IDMMX.SplitData(<inputTable>,
<trainViewName>,
<testViewName>,
<testSampleSize>
[<stratSampleColumn>])
With the SplitData procedure, you must specify the following parameters:
This parameter is of type VARCHAR. Its size is 240.
This view contains the same columns as the input table.
This parameter is of type VARCHAR. Its size is 240.
This view contains the same columns as the input table. It contains a random sample of the records in the input table that is disjoint from the training view.
This parameter is of type VARCHAR. Its size is 240.
This parameter is of type REAL.
If you specify a value that is different from NULL or an empty string for this parameter, a stratified sample is created for the training data set.
This parameter is of type VARCHAR. Its size is 128.
If you specify a value that is different from NULL or an empty string for the parameter <stratSampleColumn>, a stratified sample is created for the training data set. This means that, based on the complement of the test data set, a sample is created. In this sample, the values of the Stratified Sample column occur with approximately the same frequency.
Creating a stratified sample can be useful if you use classification and the distribution of the values of the target column is unbalanced. For example, a specific value might occur with a frequency of 99%. A good classification model would be to predict always this value because the percentage of wrong predictions is 1% only. However, you do not always want this. Performing the training run on a stratified sample helps.
Applying models that are computed on a stratified sample should be done with care because the confidence values that are computed by the classification model are not correct on a data set that does not have the same characteristics as the stratified sample. Correcting these confidence values requires expert knowledge in data mining. Therefore it is recommended to use the Easy Mining procedures on a non-stratified sample. They automatically take into account the differences of the frequencies of the target values.
If you do not specify the Stratified Sample column, the training data set contains the records of the complement of the test data set.
You might want to split the table BANK.BANKCUSTOMERS into equal portions.
Use the following command to run the SplitData procedure:
DB2 "call IDMMX.SplitData('BANK.BANKCUSTOMERS',
'BANK.BANKCUSTOMERS_TRAIN',
'BANK.BANKCUSTOMERS_TEST',
50.0)"
Utility procedures help you to accomplish administrative tasks, for example, handling error messages, canceling Easy Mining procedures, or working with the trace file.
When the call of an Easy Mining procedure fails, DB2 returns the error with the following error message:
SQL4302N (''Java stored procedure or user-defined function <user-defined function name>, specific name <specific name> aborted with an exception <exception name>'').
In most of the cases, the actual message string is truncated. If you want to get the original error message from the Easy Mining procedures, you can call the GetLastError procedure.
With the GetLastError procedure, you can specify several parameters. A question mark (?) in front of a parameter name indicates that the parameter after the question mark is an output parameter.
To retrieve the last issued error message, you can specify the following parameters:
IDMMX.GetLastError(?<errorMessage>[,?<errorCode>,?<SQL state>])
If you want to retrieve the last error message that was issued, you can use the following command:
DB2 "call IDMMX.GetLastError(?)"
If you want to retrieve the last error message that was issued including the error code and the SQL state, you can use the following command:
DB2 "call IDMMX.GetLastError(?, ?, ?)"
You can also specify a model name or a view name. For example, you might want to retrieve the last error message that was issued when you used a particular model or a view.
IDMMX.GetLastError(<modelViewName>,?<errorMessage>[,?<errorCode>,?<SQL state>])
If you want to retrieve the last error message of the procedure call that used the model name BANK.CUSTOMERS_CLUSMODEL, use the following command:
DB2 "call IDMMX.GetLastError('BANK.CUSTOMERS_CLUSMODEL', ?)"
If you want to retrieve the last error message including the error code and the SQL state of the procedure call that used the view name BANK.CUSTOMERS_CLUSVIEW, use the following command:
DB2 "call IDMMX.GetLastError('BANK.CUSTOMERS_CLUSVIEW', ?, ?, ?)"
The procedure calls retrieve the last error message that was issued by an Easy Mining procedure that ran on the same database as the database from which the GetLastError procedure is called.
If you have specified a name for the trace file, SQL statements and other trace information that are submitted during the run of an Easy Mining procedure are written to this file. This information helps the IBM Support team to locate an error.
With the SetTraceFile procedure, you can set the name of the trace file for the current database connection. You must specify the full path of the file on the server where you want the trace information written to.
If you specify an empty string or NULL as name for the trace file, the writing of trace file information is stopped.
IDMMX.SetTraceFile(<traceFile>)
To set the name of the trace file to c:\temp\easymining.trc, use the following command:
DB2 "call IDMMX.SetTraceFile('c:\temp\easymining.trc')"
With the GetTraceFile procedure, you can retrieve the name of the trace file.
IDMMX.GetTraceFile(?<traceFile>)
To retrieve the name of the trace file, use the following command:
DB2 "call IDMMX.GetTraceFile (?)"
Mining runs can take a very long time. You can cancel the Easy Mining procedures for building and testing models by using the CancelTask procedure.
The CancelTask procedure cancels the Easy Mining procedure that contains the specified model name as first parameter.
It might take a while until the Easy Mining procedure stops after it has received a cancel request because the point of time might not be appropriate for the Easy Mining procedure.
IDMMX.CancelTask(<modelViewName>)
You might want to run the PredictColumn procedure by using the following command:
call DB2"IDMMX.PredictColumn('BANK.BANKCARD_PRED',
'BANK.BANKCUSTOMERS',
'BANKCARD')"
With the CancelTask procedure, you can cancel the PredictColumn procedure by using the following command:
DB2 "call IDMMX.CancelTask('BANK.BANKCARD_PRED')
The first parameter of an Easy Mining procedure is typically the name of a model or a view. You cannot start an Easy Mining procedure if another Easy Mining procedure with the same first parameter is currently running.
If you start an Easy Mining procedure that includes the same first parameter of an Easy Mining procedure that is currently running, an error message is displayed. It indicates that a mining run with same model name or the same view name is already running.
This message might also be displayed, if an Easy Mining procedure ends abnormally and you try to start it again. Before you can start an Easy Mining procedure again that has abnormally ended, you must declare it as stopped by calling the SetTaskStopped procedure.
IDMMX.SetTaskStopped(<modelViewName>)Where <modelViewName> is the first parameter of the call of the Easy Mining procedure that you want to stop.
You might want to declare the following call of the BuildClusModel procedure as stopped:
DB2 "call IDMMX.BuildClasModel('BANK.CUSTOMERS_CLUSMODEL',
'BANK.BANKCUSTOMERS')"
To declare the above call as stopped, you must use the following call of the SetTaskStopped procedure:
DB2 "call IDMMX.SetTaskStopped('BANK.CUSTOMERS_CLUSMODEL')"
Some of the Easy Mining procedures create tables and views. Almost all of them create a model or a test result and store them in one of the standard tables for mining models or test results of IM Modeling. You can clean up these tables in your database by calling the IDMMX.CleanUpTask procedure. It removes all tables, views, models, or test results that are created by using a particular name as their first parameter.
IDMMX.CleanUpTask(<modelViewName>)
You might have built the model and the output view BANK.BANKCARD_PRED by using the following procedure call:
call IDMMX.PredictColumn('BANK.BANKCARD_PRED',
'BANK.BANKCUSTOMERS',
'BANKCARD')
To clean up the tasks that you have submitted to create the model and the output view BANK.BANKCARD_PRED, you can use the following procedure call:
call IDMMX.CleanUpTask('BANK.BANKCARD_PRED')
With this procedure, all models, views, and test results that are called BANK.BANKCARD_PRED are deleted.
This chapter provides a complete scenario in the banking business. It introduces the business goal and describes the steps that lead to the successful completion of this goal.
It is assumed that you are working for a bank. You want to promote a new bank card offering. Therefore you are planning a direct marketing campaign. However, you have only a limited budget for this campaign. Therefore you decide to address only the customers who will most likely accept the new offering.
To identify the characteristics of customers who are most likely interested in the new bank card, you can start a test campaign on a representative sample of your customers. You can save the results of the test campaign in a table, for example, the BANK.TEST_CAMPAIGN table. Among other columns, the BANK.TEST_CAMPAIGN table contains the following columns:
With the information in the BANK.TEST_CAMPAIGN table and other information about the customers that might be available, you can build a prediction model. Based on the prediction model, you can select the customers who will most likely accept the new bank card offer.
In the BANK.TEST_CAMPAIGN table, customers who accepted the new offer are identified by the value YES in the BANKCARD column. Therefore you want to build a model that predicts that the BANKCARD column contains the value YES.
To build the prediction model BANK.BANKCARD_PRED_YES based on the BANK.TEST_CAMPAIGN table, you can use the PredictColValue procedure by using the following command:
DB2 "call IDMMX.PredictColValue('BANK.BANKCARD_PRED_YES',
'BANK.TEST_CAMPAIGN'
'BANKCARD',
'YES')"
The PredictColValue procedure uses the Classification mining function and the Regression mining function to build a prediction model for each mining function. It also creates the result view BANK.BANKCARD_PRED_YES. Besides the columns of the input table, the result view contains the following additional columns:
The PredictColValue procedure builds a classification model and a regression model. The model that makes the best selection of the customers for the marketing campaign is best suited to be used. Because you do not know the result of the campaign in advance, you must content yourself with the selection that is based on the validation data set of the BANK.TEST_CAMPAIGN table.
Assuming that the budget of the campaign is adequate to address 30% of your customers, you need to determine which model performs best when you select 30% of the validation data set. Follow these steps:
select count(*) from BANK.BANKCARD_PRED_YES
where DATA_SET = "VALIDATION"Now you must determine the customers who are selected by the classification model. You also need to know how many of the customers are supposed to accept the offer. You can get this information by using the following query:
WITH CLASS_RANK(CLIENT_ID, CONFIDENCE, BANKCARD, RANK) as
( select CLIENT_ID, CONFIDENCE, BANKCARD,
rank() over (order by CONFIDENCE desc, CLIENT_ID asc) as RANK
from BANK.BANKCARD_PRED_YES
where DATA_SET='VALIDATION'
) select count(*), BANKCARD from CLASS_RANK
where RANK <= 3000
group by BANKCARD''
The common table expression defines the temporary table CLASS_RANK. In this temporary table, every client ID is associated with a rank number. The rank is determined by ordering the records of the BANK.BANKCARD_PRED_YES view according to the values in the CONFIDENCE column and the CLIENT_ID column.
This means that the records with a higher classification confidence value have a lower rank.
If the classification confidence is equal for two or more client IDs, the rank is determined by the client ID. This ensures a continuous numbering of the rank numbers. The rank represents the order in which the customers are selected for the marketing campaign.
It is assumed that the validation data set includes 10 000 records. 30% of 10 000 records corresponds to 3 000 customers. The selected customers are the customers that have a rank value that is less or equal to 3 000.
With this information it is easy to determine how many of these customers have accepted the new bankcard. You can group the records of the CLASS_RANK column with a rank value less or equal to 3 000 according to the BANKCARD column and count the occurrences of each of its values.
To determine the corresponding figure for the regression model, you must only replace the CONFIDENCE column with the PREDICTION column. The query looks like this:
WITH CLASS_RANK(CLIENT_ID, PREDICTION, BANKCARD, RANK) as
( select CLIENT_ID, PREDICTION, BANKCARD,
rank() over (order by PREDICTION desc, CLIENT_ID asc) as RANK
from BANK.BANKCARD_PRED_YES
where DATA_SET='VALIDATION'
) select count(*), BANKCARD from CLASS_RANK
where RANK <= 3000
group by BANKCARD'' The model with the higher count for the YES value in the BANKCARD column is suited best for the marketing campaign.
To select the customers for the marketing campaign, you might need to transfer the model to the server where the database of the campaign management application resides.
You can transfer the model by using the ExportClasModel procedure or the ExportRegModel procedure. To import the model into the database of the campaign management application, you can use one of the following UDFs of IM Scoring:
It is assumed that the BANK.BANKCARD_PRED_YES model is stored in the database in one of the following tables:
The table that contains the customer data for the marketing campaign is called BANK.CAMPAIGN_CUSTOMERS. The BANK.CAMPAIGN_CUSTOMERS table has the same schema as the input table for the PredictColValue procedure.
To select 30% of the customers for the marketing campaign, follow these steps:
If the selected model is a classification model, the command might look like this:
DB2 "call IDMMX.ApplyClasModel('BANK.BANKCARD_PRED_YES',
'BANK.CAMPAIGN_CUSTOMERS',
'BANK.CAMPAIGN_APPLY',
'CLASS_VAL',
'PREDICTION')"
If the selected model is a regression model, the command might look like this:
DB2 "call IDMMX.ApplyRegModel('BANK.BANKCARD_PRED_YES',
'BANK.CAMPAIGN_CUSTOMERS',
'BANK.CAMPAIGN_APPLY',
'PREDICTION',
'PRED_STD_DEV')"
With these procedure calls, the BANK.CAMPAIGN_APPLY view is created. This view contains the PREDICTION column. In the classification model, it represents the classification confidence. In the regression model, it represents the predicted value.
WITH PRED_RANK(CLIENT_ID, PREDICTION, RANK) as
( select CLIENT_ID, PREDICTION,
rank() over (order by PREDICTION desc, CLIENT_ID asc) as RANK
from BANK.CAMPAIGN_APPLY
)
select * from PRED_RANK
where RANK <= 10000 This query looks similar to the above query that determines the selected customers of the validation data set. You also select the customers based on the computed classification confidence of the underlying classification model, or the predicted value of the underlying regression model.
You can easily integrate this set of procedure calls and SQL queries into an application program that performs these steps automatically. This way you need not bother about the different operations that are performed. The only output that might be produced is a list of customers who are supposed to take part in the marketing campaign.
This chapter contains the syntax diagrams and related information of the complete set of the Easy Mining procedures.
If you are using IM Modeling and IM Scoring, you can use the complete set of Easy Mining procedures. If you are using IM Scoring, you can only use a subset of the Easy Mining procedures. If you are using IM Modeling, the Easy Mining procedures are not available.
The following tables show the product that is required to run an Easy Mining procedure. The X denotes that the Easy Mining procedure is supported in the corresponding product.
| Procedure name | IM Scoring | IM Modeling and IM Scoring |
|---|---|---|
| IDMMX.ClusterTable | - | X |
| IDMMX.ExplainColValue | - | X |
| IDMMX.FindDeviations | - | X |
| IDMMX.FindMostImpFields | - | X |
| IDMMX.FindRules | - | X |
| IDMMX.PredictColumn | - | X |
| IDMMX.PredictColValue | - | X |
| Procedure name | IM Scoring | IM Modeling and IM Scoring |
|---|---|---|
| IDMMX.BuildClasModel | - | X |
| IDMMX.TestClasModel | - | X |
| IDMMX.ApplyClasModel | X | X |
| IDMMX.ExportClasModel | X | X |
| IDMMX.ExportClasTestResult | - | X |
| IDMMX.BuildClasView | - | X |
| IDMMX.BuildRegModel | - | X |
| IDMMX.TestRegModel | - | X |
| IDMMX.ApplyRegModel | X | X |
| IDMMX.ExportRegModel | X | X |
| IDMMX.ExportRegTestResult | - | X |
| IDMMX.BuildRegView | - | X |
| IDMMX.BuildClusModel | - | X |
| IDMMX.ApplyClusModel | X | X |
| IDMMX.ExportClusModel | X | X |
| IDMMX.BuildClusView | - | X |
| IDMMX.BuildRuleModel | - | X |
| IDMMX.ExportRuleModel | X | X |
| Procedure name | IM Scoring | IM Modeling |
|---|---|---|
| IDMMX.SplitData | - | X |
| IDMMX.GetLastError | X | X |
| IDMMX.CancelTask | - | X |
| IDMMX.SetTraceFile | X | X |
| IDMMX.GetTraceFile | X | X |
Typically, you must specify the following parameters for an Easy Mining procedure:
By specifying optional parameter strings, you can you can modify default parameters of the Easy Mining procedures. For example, when you are building a classification tree, you might want to set the depth of the classification tree to 5 by using the DM_setTreeClasPar option.
An Easy Mining procedure that can include an optional parameter string is, for example, the BuildClasModel procedure.
By specifying the name of a settings object, you can modify any parameter in this settings object.
An Easy Mining procedure that includes the settings name parameter is labeled with the extension SN, for example, ClusterTableSN procedure. The extension SN denotes settings name.
The syntax and both types of parameters of the Easy Mining procedures are described in the following sections.
For more information about error messages, see IBM DB2 Intelligent Miner Modeling, IBM DB2 Intelligent Miner Scoring: Messages.
With optional parameter strings, you can modify default parameters of the Easy Mining procedures.
optionsString .-,------------------------------. | .-,--------. | V V | | >>---optionName--(----argument-+--)-+--------------------------><
The Easy Mining procedures automatically determine particular parameters. Therefore, an optional parameter string might be overwritten by a value that is determined by the Easy Mining procedure.
You must include string constants in two pairs of single quotes because the optional parameter string is a string constant that also must be included in a pair of single quotes.
The following tables give you an overview of the available optional parameter strings.
| Option type | Option name | Supported Easy Mining procedure |
|---|---|---|
| Mining data methods |
DM_defMiningData DM_setColumns DM_setFldAlias DM_impMiningData DM_setWhereClause |
The Easy Mining procedures for typical mining tasks. The following Easy Mining procedures for basic mining steps: BuildClasModel BuildClasView BuildClusModel BuildClusView BuildRegModel BuildRegView BuildRuleModel |
| Logical data specs methods |
DM_addDataSpecFld DM_addNmp DM_addTax DM_addTaxMap DM_impDataSpec DM_remDataSpecFld DM_remNmp DM_remTax DM_remTaxMap DM_setFldNmp DM_setFldOutLim DM_setFldTax DM_setFldType |
Easy Mining procedures for typical mining tasks. The following Easy Mining procedures for basic mining steps: BuildClasModel BuildClasView BuildClusModel BuildClusView BuildRegModel BuildRegView BuildRuleModel |
| Classification settings methods |
DM_impClasSettings DM_setClasCost DM_setClasCostRate DM_setClasTarget DM_setCostMat DM_setFldUsageType DM_setPowerOptions DM_setTreeClasPar DM_useClasDataSpec |
PredictColumn PredictColValue ExplainColValue FindMostImpFields BuildClasModel BuildClasView |
| Regression settings methods |
DM_impRegSettings DM_setExecTime DM_setFldUsageType DM_setPowerOptions DM_setRegRSquared DM_setRegTarget DM_useRegDataSpec |
PredictColumn PredictColValue FindMostImpFields BuildRegModel BuildRegView |
| Clustering settings methods |
DM_addSimMat DM_impClusSettings DM_remSimMat DM_setDClusFldpar DM_setDClusPar DM_setExecTime DM_setFldOutlTreat DM_setFldSimMat DM_setFldSimScale DM_setFldUsageType DM_setFldWeight DM_setMaxNumClus DM_setMinData DM_setPowerOptions DM_useClusDataSpec |
FindDeviations ClusterTable BuildClusModel BuildClusView |
| Rule settings methods |
DM_addConItem DM_impRuleSettings DM_remConItem DM_setConType DM_setFldUsageType DM_setGroup DM_setItemFld DM_setItemFormat DM_setMaxLen DM_setMinConf DM_setMinSupport DM_setPowerOptions DM_useRuleDataSpec |
FindRules ExplainColValue BuildRuleModel |
| Mining task methods | DM_setProgTab |
Easy Mining procedures for typical mining tasks. The following Easy Mining procedures for basic mining steps: BuildClasModel BuildClasView BuildClusModel BuildClusView BuildRegModel BuildRegView BuildRuleModel |
The following optional parameter strings are described in this book. For more information, see the appropriate chapters.
See Using name mappings for more information.
See Using name mappings for more information.
See Removing fields from the input table for more information.
See Reducing the size of clusters for more information.
See Defining supplementary columns for more information.
See Setting the name of the item ID column for more information.
See Setting the number of clusters for more information.
See Setting the depth of a classification tree for more information.
For more information, see IBM DB2 Intelligent Miner Modeling: Administration and Programming.
The following Easy Mining procedures for typical mining tasks are available. They are presented in alphabetical order:
With the IDMMX.ClusterTable procedure or the IDMMX.ClusterTableSN procedure, you can partition the input table into homogenous segments or clusters. You can specify the minimum size and the maximum size of these clusters.
IDMMX.ClusterTable >>-IDMMX.ClusterTable--(--clusterView--,--input table--,--------> >--minSize--,--maxSize--+------------------+--)---------------->< '-,--optionsString-'
IDMMX.ClusterTableSN >>-IDMMX.ClusterTableSN--(--clusterView--,--input table--,------> >--minSize--,--maxSize--,--settingsName--)---------------------><
The ClusterTable procedure creates a view and a model. The model represents the characteristics of the clusters. It is stored in the table IDMMX.ClusterModels under the same name as the generated view. If a model with the same name already exists, the previous model is replaced with the new model. If a view with the same name already exists, the previous view is replaced with the new view.
This parameter is of type VARCHAR. Its size is 240.
The columns of the input table that might not be useful to create a model are ignored by the Easy Mining procedure. These are, for example, key columns.
This parameter is of type VARCHAR. Its size is 257.
This parameter is of type REAL.
This parameter is of type REAL.
This parameter is of type VARCHAR. Its size is 32672.
This parameter is of type VARCHAR. Its size is 240.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
This means that too many clusters (more than 100) would be generated.
The IDMMX.FindDeviations procedure or the IDMMX.FindDeviationsSN procedure compute untypical records or deviations of the input table.
IDMMX.FindDeviations >>-IDMMX.FindDeviations--(--deviationsView--,--inputTable-------> >--+------------------+--)------------------------------------->< '-,--optionsString-'
IDMMX.FindDeviationsSN >>-IDMMX.FindDeviationsSN--(--deviationsView--,-----------------> >--inputTable--,--settingsName--)------------------------------><
The FindDeviations procedure creates a view and a model. The model is stored in the table IDMMX.CLUSTERMODELS under the same name as the generated view. If a model with the same name already exists, the previous model is replaced with the new model. If a view with the same name already exists, the previous view is replaced with the new view.
This parameter is of type VARCHAR. Its size is 240.
The columns of the input table that might not be useful to create a model are ignored by the Easy Mining procedure. These are, for example, key columns.
This parameter is of type VARCHAR. Its size is 257.
This parameter is of type VARCHAR. Its size is 32672.
This parameter is of type VARCHAR. Its size is 240.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
With the ExplainColValue procedure or the ExplainColValueSN procedure, you can find explanations in your data that indicate under which condition the target column contains the target value.
IDMMX.ExplainColValue >>-IDMMX.ExplainColValue--(--viewName--,--inputTable--,---------> >--targetColumn--,--targetValue--,--maxExplLength---------------> >--+------------------+--)------------------------------------->< '-,--optionsString-'
IDMMX.ExplainColValueSN >>-IDMMX.ExplainColValueSN--(--viewName--,--inputTable--,--targetColumn--,--> >--targetValue--,--maxExplLength--,--clasSettingsName--,--ruleSettingsName--)-><
With the ExplainColValue procedure, you must specify the following parameters:
The ExplainColValue procedure creates a view, a classification model, and a rules model. The models are stored in the tables IDMMX.CLASSIFMODELS and IDMMX.RULEMODELS under the same name as the generated view. If a model with the same name already exists, the previous model is replaced with the new model. If a view with the same name already exists, the previous view is replaced with the new view.
This parameter is of type VARCHAR. Its size is 240.
The columns of the input table that might not be useful to create a model are ignored by the Easy Mining procedure. These are, for example, key columns.
This parameter is of type VARCHAR. Its size is 257.
This parameter is of type VARCHAR. Its size is 128.
For information about the valid SQL types of categorical and numerical fields, see Mining field types.
This parameter is of type VARCHAR. Its size is 1024.
This parameter is of type SMALLINT.
This parameter is of type VARCHAR. Its size is 32672.
This parameter is of type VARCHAR. Its size is 240.
This parameter is of type VARCHAR. Its size is 240.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
Depending on the type of the target column, the Tree Classification mining function or the Regression mining function is used by the IDMMX.FindMostImpFields procedure or the IDMMX.FindMostImpFieldsSN to compute the most important fields of the input table.
IDMMX.FindMostImpFields >>-IDMMX.FindMostImpFields--(--mostImpFieldView--,--inputTable--,--> >--targetColumn--+------------------+--)----------------------->< '-,--optionsString-'
IDMMX.FindMostImpFieldsSN >>-IDMMX.FindMostImpFieldsSN--(--mostImpFieldView--,--inputTable--,--> >--targetColumn--,--settingsName--)----------------------------><
With the IDMMX.FindMostImpFields procedure, you must specify the following parameters:
The FindMostImpFields procedure creates a view and a model. Depending on the type of the target column, a classification model or a regression model is generated. It is stored in one of the following tables under the same name as the generated view:
If a model with the same name already exists, the previous model is replaced with the new model. If a view with the same name already exists, the previous view is replaced with the new view.
This parameter is of type VARCHAR. Its size is 240.
Depending on the type of the target column, the Tree Classification mining function or the Regression mining function computes the most important fields of this table.
The columns of the input table that might not be useful to create a model are ignored by the Easy Mining procedure. These are, for example, key columns.
This parameter is of type VARCHAR. Its size is 257.
The values of the target column can be categorical or numeric.
This parameter is of type VARCHAR. Its size is 128.
For information about the valid SQL types of categorical and numerical fields, see Mining field types.
This parameter is of type VARCHAR. Its size is 32672.
This parameter is of type VARCHAR. Its size is 240.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
The IDMMX.FindRules procedure or the IDMMX.FindRulesSN procedure computes a rule model based on the input table. It uses all columns of the input table as item fields except the column that is specified as the group column. If the value of the group column is not NULL, the standard transaction input format for associations is assumed.
IDMMX.FindRules >>-IDMMX.FindRules--(--rulesView--,--inputTable--,--------------> >--groupColumn--,--nbRules--,--minConfidence--------------------> >--+------------------+--)------------------------------------->< '-,--optionsString-'
IDMMX.FindRulesSN >>-IDMMX.FindRulesSN--(--rulesView--,--inputTable--,------------> >--groupColumn--,--nbRules--,--minConfidence--,--settingsName--)-><
With the IDMMX.FindRules procedure, you must specify the following parameters:
The FindRules procedure creates a view and a model. The model is stored in the table IDMMX.RuleModels under the same name as the generated view. If a model with the same name already exists, the previous model is replaced with the new model. If a view with the same name already exists, the previous view is replaced with the new view.
This parameter is of type VARCHAR. Its size is 240.
The columns of the input table that might not be useful to create a model are ignored by the Easy Mining procedure. These are, for example, key columns.
This parameter is of type VARCHAR. Its size is 257.
If you specify a column of the input table as the GROUP column, the remaining columns of the input table are used as item columns.
If you specify NULL for the GROUP column, each record represents a transaction and all columns of the input table are used as item columns.
This parameter is of type VARCHAR. Its size is 128.
For information about the valid SQL types of categorical and numerical fields, see Mining field types.
The generated rules are stored in a view.
This parameter is of type INTEGER.
The confidence of each rule is greater or equal to the value that you specified for minimum confidence.
This parameter is of type REAL.
This parameter is of type VARCHAR. Its size is 32672.
This parameter is of type VARCHAR. Its size is 240.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
The IDMMX.PredictColumn procedure or the IDMMX.PredictColumnSN procedure create a prediction model for the values in the target column and apply the model to the input table.
IDMMX.PredictColumn >>-IDMMX.PredictColumn--(--viewName--,--inputTable--,-----------> >--targetColumn--+------------------+--)----------------------->< '-,--optionsString-'
IDMMX.PredictColumnSN >>-IDMMX.PredictColumnSN--(--viewName--,--inputTable--,---------> >--targetColumn--,--settingsName--)----------------------------><
The PredictColumn procedure creates a view and a model. Depending on the mining function that is used to build the model, the model is stored in one of the following tables under the same name as the generated view:
If a model with the same name already exists, the previous model is replaced with the new model. If a view with the same name already exists, the previous view is replaced with the new view.
This parameter is of type VARCHAR. Its size is 240.
The columns of the input table that might not be useful to create a model are ignored by the Easy Mining procedure. These are, for example, key columns.
This parameter is of type VARCHAR. Its size is 257.
The PredictColumn procedure derives the values in this column from the values of the other columns in the input table. If the values in the target column are categorical, the Classification mining function is used. If the values in the target column are numeric, the Regression mining function is used.
This parameter is of type VARCHAR. Its size is 128.
For information about the valid SQL types of categorical and numerical fields, see Mining field types.
This parameter is of type VARCHAR. Its size is 32672.
This parameter is of type VARCHAR. Its size is 240.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
The IDMMX.PredictColValue procedure and the IDMMX.PredictColValueSN procedure compute a prediction model for a specific target value of the target column. They use the Tree Classification mining function and the Regression mining function to compute the model.
IDMMX.PredictColValue >>-IDMMX.PredictColValue--(--viewName--,--inputTable--,---------> >--targetColumn--,--targetValue--+------------------+--)------->< '-,--optionsString-'
IDMMX.PredictColValueSN >>-IDMMX.PredictColValueSN--(--viewName--,--inputTable--,-------> >--targetColumn--,--targetValue--,--clasSettingsName--,--regSettingsName--)-><
With the PredictColValue procedure, you must specify the following parameters:
The PredictColValue procedure creates a view and a model. The model is stored in the table IDMMX.PredictColValue under the same name as the generated view. If a model with the same name already exists, the previous model is replaced with the new model. If a view with the same name already exists, the previous view is replaced with the new view.
This parameter is of type VARCHAR. Its size is 240.
The columns of the input table that might not be useful to create a model are ignored by the Easy Mining procedure. These are, for example, key columns.
This parameter is of type VARCHAR. Its size is 257.
This parameter is of type VARCHAR. Its size is 128.
For information about the valid SQL types of categorical and numerical fields, see Mining field types.
This parameter is of type VARCHAR. Its size is 128.
This parameter is of type VARCHAR. Its size is 32672.
This parameter is of type VARCHAR. Its size is 240.
This parameter is of type VARCHAR. Its size is 240.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
The following Easy Mining procedures for basic mining steps are available:
With the IDMMX.ApplyClasModel procedure, you can apply a model to data that does not yet include values for the outcome.
IDMMX.ApplyClasModel >>-IDMMX.ApplyClasModel--(--modelName--,--inputTable--,---------> >--outputView--,--predClasColumn--,--confidenceColumn--)-------><
With the ApplyClasModel procedure, you must specify the following parameters:
The model is stored in the IDMMX.ClassifModels table.
This parameter is of type VARCHAR. Its size is 240.
This parameter is of type VARCHAR. Its size is 240.
This parameter is of type VARCHAR. Its size is 240.
The output view includes the columns of the input table and the following additional columns:
This parameter is of type VARCHAR. Its size is 128.
If you do not want to include the Confidence column in the output table, leave the string for the confidence parameter empty or specify NULL for the confidence parameter.
The value for the classification confidence can range from 0 to 1. It indicates the confidence that the predicted class value for the record is correct.
This parameter is of type VARCHAR. Its size is 128.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
With the IDMMX.ApplyClusModel procedure, you can determine the records that are assigned to the individual clusters by applying the model to the input table.
IDMMX.ApplyClusModel >>-IDMMX.ApplyClusModel--(--modelName--,--inputTable--,--outputView--,--> >--clusterIDColumn--,--qualityColumn--,--confidenceColumn--)---><
With the ApplyClusModel procedure, you must specify the following parameters:
The model is stored in IDMMX.ClusterModels table.
This parameter is of type VARCHAR. Its size is 240.
The ApplyClusModel procedure applies the clustering model to the data in this table.
This parameter is of type VARCHAR. Its size is 240.
The output view contains the columns of the input table and additional columns that contain the cluster identification, the clustering quality, and the clustering confidence.
If an output view with the same name already exists, the previous output view is replaced with the new output view.
This parameter is of type VARCHAR. Its size is 240.
This parameter is of type VARCHAR. Its size is 128.
The value for clustering quality indicates how the records fit into the cluster. The value can range from 1 to 0.
If you do not want to include the Quality column in the output table, leave the string for these parameters empty, or specify NULL for these strings.
This parameter is of type VARCHAR. Its size is 128.
The clustering confidence indicates the confidence that the assigned cluster ID is the best cluster for this record. The value can range from 1 to 0.
If you do not want to include the Confidence column in the output table, leave the string for these parameters empty, or specify null for these strings.
This parameter is of type VARCHAR. Its size is 128.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
With the ApplyRegModel procedure, you can apply regression models to data that does not yet include values for the outcome.
IDMMX.ApplyRegModel >>-IDMMX.ApplyRegModel--(--modelName--,--inputTable--,----------> >--outputView--,--predValueColumn--,--predStdDevColumn--)------><
With the ApplyRegModel procedure, you must specify the following parameters:
The model is stored in the IDMMX.RegressionModels table.
This parameter is of type VARCHAR. Its size is 240.
The ApplyRegModel procedure applies the regression model to the data in this table.
This parameter is of type VARCHAR. Its size is 240.
The output view contains the columns of the input table and additional columns that include values for the predicted value and the estimated standard deviation for the predicted value.
This parameter is of type VARCHAR. Its size is 240.
This parameter is of type VARCHAR. Its size is 128.
The predicted standard deviation indicates the expected range of the actual value after you have applied the model.
If you do not want to include the column for the estimated standard deviation in the output view, leave this string empty or specify null for this parameter.
This parameter is of type VARCHAR. Its size is 128.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
With the IDMMX.BuildClasModel procedure or the IDMMX.BuildClasModelSN procedure, you can perform a classification training run on the specified input table.
IDMMX.BuildClasModel >>-IDMMX.BuildClasModel--(--modelName--,--inputTable--,---------> >--targetColumn--+------------------+--)----------------------->< '-,--optionsString-'
IDMMX.BuildClasModelSN >>-IDMMX.BuildClasModelSN--(--modelName--,--inputTable--,-------> >--targetColumn--,--settingsName--)----------------------------><
With the BuildClasModel procedure, you must specify the following parameters:
The generated model is stored in the IDMMX.ClassifModels table. If a model with the same name already exists, the previous model is replaced with the new model.
This parameter is of type VARCHAR. Its size is 240.
The values in the columns of the input table are used to determine the distinguishing properties for each value of the target column.
The columns of the input table that might not be useful to create a model are ignored by the Easy Mining procedure. These are, for example, key columns.
This parameter is of type VARCHAR. Its size is 240.
The target column must contain only categorical values.
For information about the valid SQL types of categorical and numerical fields, see Mining field types.
This parameter is of type VARCHAR. Its size is 128.
This parameter is of type VARCHAR. Its size is 32672.
This parameter is of type VARCHAR. Its size is 240.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
With the BuildClasView procedure or the BuildClasViewSN procedure, you can combine the training of a classification model on the input table with the application of the model to the same input table.
IDMMX.BuildClasView >>-IDMMX.BuildClasView--(--viewName--,--inputTable--,-----------> >--targetColumn--+------------------+--)----------------------->< '-,--optionsString-'
IDMMX.BuildClasViewSN >>-IDMMX.BuildClasViewSN--(--viewName--,--inputTable--,---------> >--targetColumn--,--settingsName--)----------------------------><
With the BuildClasView procedure, you must specify the following parameters:
The BuildClasView procedure creates a view and a model. The model is stored in the table IDMMX.ClassifModels under the same name as the generated view. If a model with the same name already exists, the previous model is replaced with the new model. If a view with the same name already exists, the previous view is replaced with the new view.
This parameter is of type VARCHAR. Its size is 240.
This parameter is of type VARCHAR. Its size is 240.
The target column must contain only categorical values.
For information about the valid SQL types of categorical and numerical fields, see Mining field types.
This parameter is of type VARCHAR. Its size is 128.
This parameter is of type VARCHAR. Its size is 32672.
This parameter is of type VARCHAR. Its size is 240.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
With the IDMMX.BuildClusModel procedure or the IDMMX.BuildClusModelSN procedure, you can create a clustering model that assigns to each record of the input table the cluster it belongs to.
IDMMX.BuildClusModel >>-IDMMX.BuildClusModel--(--modelName--,--inputTable------------> >--+------------------+--)------------------------------------->< '-,--optionsString-'
IDMMX.BuildClusModelSN >>-IDMMX.BuildClusModelSN--(--modelName--,--inputTable--,--settingsName--)-><
The model is stored in the IDMMX.ClusterModels table. If a model with the same name already exists in the IDMMX.ClusterModels table, the previous model is replaced with the new model.
This parameter is of type VARCHAR. Its size is 240.
The BuildClusModel procedure starts a clustering run on the data of this table.
The columns of the input table that might not be useful to create a model are ignored by the Easy Mining procedure. These are, for example, key columns.
This parameter is of type VARCHAR. Its size is 240.
This parameter is of type VARCHAR. Its size is 32672.
This parameter is of type VARCHAR. Its size is 240.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
With the IDMMX.BuildClusView procedure or the IDMMX.BuildClusViewSN procedure, you can combine the following clustering mining steps by creating a clustering view:
If you build a clustering view, the clustering model is built and applied to the records of the input table or view. The clustering view indicates the clusters that each record belongs to.
IDMMX.BuildClusView >>-IDMMX.BuildClusView--(--viewName--,--inputTable--------------> >--+------------------+--)------------------------------------->< '-,--optionsString-'
IDMMX.BuildClusViewSN >>-IDMMX.BuildClusViewSN--(--viewName--,--inputTable--,--settingsName--)-><
The BuildClusView procedure creates a view and a model. The model is stored in the table IDMMX.ClusterModels under the same name as the generated view. If a model with the same name already exists, the previous model is replaced with the new model. If a view with the same name already exists, the previous view is replaced with the new view.
This parameter is of type VARCHAR. Its size is 240.
The BuildClusView procedure starts a clustering run on the data in this table.
This parameter is of type VARCHAR. Its size is 240.
This parameter is of type VARCHAR. Its size is 32672.
This parameter is of type VARCHAR. Its size is 240.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
With the BuildRegModel procedure or the BuildRegModelSN procedure, you can perform a regression training run on the input table.
IDMMX.BuildRegModel >>-IDMMX.BuildRegModel--(--modelName--,--inputTable--,----------> >--targetColumn--+------------------+--)----------------------->< '-,--optionsString-'
IDMMX.BuildRegModelSN >>-IDMMX.BuildRegModelSN--(--modelName--,--inputTable--,--------> >--targetColumn--,--settingsName--)----------------------------><
The BuildRegModel procedure creates a model and saves it in the table IDMMX.RegressionModels. If a model with the same name already exists, the previous model is replaced with the new model.
This parameter is of type VARCHAR. Its size is 240.
The BuildRegModel procedure starts a regression training run on this table.
The columns of the input table that might not be useful to create a model are ignored by the Easy Mining procedure. These are, for example, key columns.
This parameter is of type VARCHAR. Its size is 240.
This parameter is of type VARCHAR. Its size is 128.
For information about the valid SQL types of categorical and numerical fields, see Mining field types.
This parameter is of type VARCHAR. Its size is 32672.
This parameter is of type VARCHAR. Its size is 240.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
With the IDMMX.BuildRegView procedure or the IDMMX.BuildRegViewSN procedure, you can combine the training of regression models on the input table with the application of these models to the same table.
IDMMX.BuildRegView >>-IDMMX.BuildRegView--(--viewName--,--inputTable--,------------> >--targetColumn--+------------------+--)----------------------->< '-,--optionsString-'
IDMMX.BuildRegViewSN >>-IDMMX.BuildRegViewSN--(--viewName--,--inputTable--,----------> >--targetColumn--,--settingsName--)----------------------------><
The BuildRegView procedure creates a view and a model. The model is stored in the table IDMMX.RegressionModels under the same name as the generated view. If a model with the same name already exists, the previous model is replaced with the new model. If a view with the same name already exists, the previous view is replaced with the new view.
This parameter is of type VARCHAR. Its size is 240.
This parameter is of type VARCHAR. Its size is 240.
The target column must contain numeric values.
For information about the valid SQL types of categorical and numerical fields, see Mining field types.
This parameter is of type VARCHAR. Its size is 128.
This parameter is of type VARCHAR. Its size is 32672.
This parameter is of type VARCHAR. Its size is 240.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
With the IDMMX.BuildRuleModel procedure or the IDMMX.BuildRuleModelSN procedure, you can compute association rules based on the input table. The set of the computed associations rules is called a rule model.
IDMMX.BuildRuleModel >>-IDMMX.BuildRuleModel--(--modelName--,--inputTable--,--groupColumn--,--> >--minSupport--,--minConfidence--,--maxRuleLength---------------> >--+------------------+--)------------------------------------->< '-,--optionsString-'
IDMMX.BuildRuleModelSN >>-IDMMX.BuildRuleModelSN--(--modelName--,--inputTable--,--groupColumn--,--> >--minSupport--,--minConfidence--,--maxRuleLength--,--settingsName--)-><
The model is stored in the IDMMX.RuleModels table. If a model with the same name already exists, the previous model is replaced with the new model.
This parameter is of type VARCHAR. Its size is 240.
The BuildRuleModel procedure starts an associations run on this table.
The columns of the input table that might not be useful to create a model are ignored by the Easy Mining procedure. These are, for example, key columns.
This parameter is of type VARCHAR. Its size is 240.
If you specify a column of the input table as the GROUP column, the remaining columns of the input table are used as item columns.
If you specify null or an empty string for the GROUP column, the BuildRuleModel procedure looks for association rules in the entire relational table.
This parameter is of type VARCHAR. Its size is 128.
For information about the valid SQL types of categorical and numerical fields, see Mining field types.
You can specify a value between 0 and 100. If you specify a value that is less or equal to 0, the value for minimum support is automatically determined to produce a result that contains at least some rules.
This parameter is of type REAL.
You can specify a value between 0 and 100. If you specify a value that is less or equal to 0, the default value of 25% is automatically used as the lower limit for the confidence of a rule.
This parameter is of type REAL.
The rule length determines the maximum number of items that occur in an associations rule. You must specify a value greater or equal to 2. For example, if you specify 3 as the maximum rule length, the associations rule contains two items in the rule body and one item in the rule head. If you specify a value less or equal to 0, the maximum rule length is not limited.
This parameter is of type INTEGER.
This parameter is of type VARCHAR. Its size is 32672.
This parameter is of type VARCHAR. Its size is 240.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
With the IDMMX.ExportClasModel procedure, you can export a classification model to a file on a different server.
With the IDMMX.ExportClasModel procedure, you must specify the following parameters:
This parameter is of type VARCHAR. Its size is 240.
You must specify the complete path of the file.
This parameter is of type VARCHAR. Its size is 32672.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
With the IDMMX.ExportClasTestResult procedure, you can export a classification test result to a file on a different server.
IDMMX.ExportClasTestResult >>-IDMMX.ExportClasTestResult--(--testResultName--,--exportFileName--)-><
With the IDMMX.ExportClasTestResult procedure, you must specify the following parameters:
This parameter is of type VARCHAR. Its size is 240.
You must specify the complete path of the file.
This parameter is of type VARCHAR. Its size is 32672.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
With the IDMMX.ExportClusModel procedure, you can export a clustering model to a file on a different server.
With the IDMMX.ExportClusModel procedure, you must specify the following parameters:
This parameter is of type VARCHAR. Its size is 240.
You must specify the complete path of the file.
This parameter is of type VARCHAR. Its size is 32672.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
With the IDMMX.ExportRegModel procedure, you can export a regression model to a file on a different server.
With the IDMMX.ExportRegModel procedure, you must specify the following parameters:
This parameter is of type VARCHAR. Its size is 240.
You must specify the complete path of the file.
This parameter is of type VARCHAR. Its size is 32672.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
With the IDMMX.ExportRegTestResult procedure, you can export a regression test result to a file on a different server.
With the IDMMX.ExportRegTestResult procedure, you must specify the following parameters:
This parameter is of type VARCHAR. Its size is 240.
You must specify the complete path of the file.
This parameter is of type VARCHAR. Its size is 32672.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
With the IDMMX.ExportRuleModel procedure, you can export a rule model to a file on a different server.
With the IDMMX.ExportRuleModel procedure, you must specify the following parameters:
This parameter is of type VARCHAR. Its size is 240.
You must specify the complete path of the file.
This parameter is of type VARCHAR. Its size is 32672.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
The IDMMX.TestClasModel procedure tests the classification model by applying it to the data in the input table. It compares the predicted class value in the classification model with the actual class value in the input table.
With the TestClasModel procedure, you must specify the following parameters:
The model is stored in the IDMMX.ClassifModels table.
This parameter is of type VARCHAR. Its size is 240.
This parameter is of type VARCHAR. Its size is 240.
The classification test result is stored in the IDMMX.ClasTestResults table.
This parameter is of type VARCHAR. Its size is 240.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
The IDMMX.TestRegModel procedure tests the regression model by applying it to the data in the input table. It compares the predicted class value in the classification model with the actual class value in the input table.
You must specify the following parameters for the TestRegModel procedure:
The model is stored in the IDMMX.RegressionModels table.
This parameter is of type VARCHAR. Its size is 240.
This parameter is of type VARCHAR. Its size is 240.
The test result is stored in the IDMMX.RegTestResults table.
This parameter is of type VARCHAR. Its size is 240.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
The following procedures are available:
Mining runs can take a very long time. With the IDMMX.CancelTask procedure, you can cancel the Easy Mining procedures for building and testing models.
This parameter is of type VARCHAR. Its size is 240.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
With the IDMMX.CleanUpTask procedure, you can remove all tables, views, models, or test results that are created by using a particular name as their first parameter.
This parameter is of type VARCHAR. Its size is 240.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
With the IDMMX.GetLastError procedure, you can retrieve the previous error message.
IDMMX.GetLastError >>-IDMMX.GetLastError--(--+---------------+--,--errorMessage----> '-modelViewName-' >--+---------------------------+--)---------------------------->< '-,--errorCode--,--SQL code-'
This parameter is of type VARCHAR. Its size is 240.
For the following parameters, you must specify a question mark (?) instead of the variable name. For an example of the command, see Examples.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure did not finish successfully, the following exception might occur:
With the IDMMX.GetTraceFile procedure, you can retrieve the name of the file that contains SQL statements that are submitted during the run of an Easy Mining procedure.
This parameter is of type VARCHAR. Its size is 32672.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
There are no exceptions for this procedure.
With the IDMMX.SetTaskStopped procedure, you can declare the call of an Easy Mining procedure as stopped.
You can use this procedure if the call of an Easy Mining procedure has abnormally ended and you want to start it again.
IDMMX.SetTaskStopped >>-IDMMX.SetTaskStopped--(--+---------------+--)--------------->< '-modelViewName-'
This parameter is of type VARCHAR. Its size is 240.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure did not finish successfully, the following exception might occur:
With the SetTraceFile procedure, you can set the name of the trace file for the current database connection.
This parameter is of type VARCHAR. Its size is 32672.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exception might occur:
With the SplitData procedure, you can split tables into training data sets and test data sets.
IDMMX.SplitData >>-IDMMX.SplitData--(--inputTable--,--trainViewName--,----------> >--testViewName--,--testSampleSize--,---------------------------> >--+----------------------+--)--------------------------------->< '-,--stratSampleColumn-'
This parameter is of type VARCHAR. Its size is 240.
This view contains the same columns as the input table.
This parameter is of type VARCHAR. Its size is 240.
This view contains the same columns as the input table. It contains a random sample of the records in the input table that is disjoint from the training view.
This parameter is of type VARCHAR. Its size is 240.
This parameter is of type REAL.
If you specify a value that is different from NULL or an empty string for this parameter, a stratified sample is created for the training data set.
This parameter is of type VARCHAR. Its size is 128.
When the Easy Mining procedure finished successfully, the return code 0 is displayed.
If the Easy Mining procedure does not finish successfully, the following exceptions might occur:
This chapter describes the conventions that are used in the Easy Mining procedures.
The following conventions are used for the Easy Mining procedures:
Qualified names consist of the schema name and the table name, for example, BANKING.CUSTOMER_DATA
where:
If you do not specify a schema name, the default schema is used. The default schema is the user ID. For example, if user ID Miller creates the table CUSTOMER_DATA without specifying a schema name, the qualified name of this table is MILLER.CUSTOMER_DATA.
In DB2, all identifiers, for example, table names or column names, that are specified in DB2 SQL statements in lowercase without quotes, are converted into uppercase. To avoid syntax errors and to easily differentiate between identifiers and SQL keywords, it is recommended to always specify identifiers in uppercase and include them in quotes. For example, this specification is well-defined:
CREATE TABLE "BANKING_MODELING" (
"TYPE" CHAR(7),
"GENDER" CHAR(6),
"AGE" DOUBLE,
"PRODUCT" CHAR(1),
"SIBLINGS" DOUBLE,
"INCOME" DOUBLE)
'DM_setTreeClaPar(''MaxPur'', 90)'
The quotes included in SQL strings are single quotes. Different parameters must be separated with a comma.
The generated mining models and test results are saved in the tables of IM Modeling and IM Scoring.
If a task object is created, it is saved under the model name or the test result name in the corresponding IDMMX.*Task table.
The schema for the following database objects defines a name space for these database objects and the corresponding tasks:
In contrast to the standard behavior of a schema in a database, you cannot define authorizations for a model schema.
The Intelligent Miner mining functions distinguish only between categorical fields and numerical fields.
Columns of the following SQL types are treated as categorical fields by Intelligent Miner:
Columns of the following SQL types are treated as numerical fields by Intelligent Miner:
You can change the mining field type of a column by using the DM_setFldType option.
The group column of the following procedures can be categorical or numerical:
The target column of the following procedures can be categorical:
The target column of the following procedures can be numerical:
The target column of the following procedures can be categorical or numerical:
For more information about the column types and the sizes of the input and output parameters of the methods and functions, see IBM DB2 Intelligent Miner Modeling: Administration and Programming.
This section provides a quick overview of data mining. It outlines the data mining process and gives a general introduction to the mining functions that are supported by IM Scoring and IM Modeling. It also maps several business questions to the appropriate data mining solution in different business areas.
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.
Data mining is an iterative process that typically involves the following phases:
In the problem definition phase, data mining tools are not yet required.
In the data exploration phase, traditional data analysis tools, for example, statistics, are used to explore the data.
In the data preparation phase, data is tweaked multiple times in no prescribed order. Preparing the data for the modeling tool by selecting tables, records, and attributes, are typical tasks in this phase. The meaning of the data is not changed.
In the modeling phase, a frequent exchange with the domain experts from the data preparation phase is required.
The modeling phase and the evaluation phase are coupled. They can be repeated several times to change parameters until optimal values are achieved. When the final modeling phase is completed, a model of high quality has been built.
At the end of the evaluation phase, the data mining experts decide how to use the data mining results.
The Intelligent Miner products assist you to follow this process. You can apply the functions of the Intelligent Miner products independently, iteratively, or in combination.
Figure 24 shows the major phases of the data mining process.
IM Modeling helps you to select the input data, explore the data, transform the data, and mine the data. With IM Visualization you can display the data mining results to analyze and interpret them. With IM Scoring, you can apply the model that you have created with IM Modeling.
To gain insight into a specific business problem, you can use one of the following mining functions:
The goal of the Associations mining function is to find items that are 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 following 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.
Classification is the process of automatically creating a model of classes from a set of records that contain class labels. The Classification mining function 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 application tool to apply this 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.
When a model is applied, IM Scoring assigns a class label and a confidence value to each individual record being scored.
The Clustering mining function consists of a range of algorithms that group data records on the basis of how similar they are. For example, a data record might consist of a description of customers. In this case, clustering would group similar customers together, and at the same time it would maximize 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 can be grouped in homogeneous groups that are very similar to each other.
When a model is applied, IM Scoring assigns a cluster ID, a quality value, and a confidence value to each individual record being scored. The quality value and the confidence value are different measures that indicate how well the record fits into the assigned cluster.
The Regression mining function predicts values to discover the dependency and the variation of one field's value on the values of the other fields within the same record. A model is generated that can predict a value for that particular field in a new record of the same form, based on other field values. For example, a retailer wants to use historical data to estimate the sales revenue for a new customer. A mining run on this historical data creates a model. This model can be used to predict the expected sales revenue for a new customer, based on the new customer's data. The model might also show that, for some customers, incentive campaigns improve sales. In addition, it might reveal that frequent visits by sales representatives lead to a lower revenue if the customer is young.
When a model is applied, IM Scoring assigns a predicted value.
In the reference part of this book, the syntax for the functionality of the Intelligent Miner products is described by using the following structure:
The >>--- symbol indicates the beginning of a statement.
The ---> symbol indicates that the statement syntax is continued on the next line.
The >--- symbol indicates that a statement is continued from the previous line.
The -->< symbol indicates the end of a statement.
>>-required item-----------------------------------------------><
>>-+---------------+------------------------------------------->< '-optional item-'
If you must choose one of the items, one item of the stack appears on the main path.
>>-+-required choice1-+---------------------------------------->< '-required choice2-'
If choosing none of the items is an option, the entire stack appears below the main path.
>>-+------------------+---------------------------------------->< +-optional choice1-+ '-optional choice2-'
A repeat arrow above a stack indicates that you can make more than one choice from the stacked items.
.----------------------. V | >>---+------------------+-+------------------------------------>< +-optional choice1-+ '-optional choice2-'
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.
The following terms are trademarks of the IBM Corporation in the United States, other countries, or both:
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.
Other company, product, and service names may be trademarks or service marks of others.
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 helps you to find the document on the Web at the IBM Publications Center.
To download DB2 fix packs, go to this Web site.
\doc\ScoringBean\index.html