Overview of the example files

Intelligent Miner® includes example files. With these example files, you can quickly learn about the concepts of the Clustering mining function, the Associations mining functions, or the Sequence Rule mining function.

The example files are in the samples/dwe/ScoringDB2 directory of your Db2 installation. This directory contains the mining models, the data, and the scripts that are required to complete the exercises.

The following tables show the example files that are in the samples directory and the purpose you can use them for.

Table 1. example files for the Associations mining function, the Sequence Rule mining function, and the Clustering mining function
example file Purpose
readme.txt This file explains how to use the example files.
bankingScoring.data This flat file contains records that describe customers of a bank. You can apply a clustering model to this data.
bankingImport.db2 This script creates the Db2 example table BANKING_SCORING, imports the file bankingScoring.data, and inserts the data into the BANKING_SCORING table.
clusDemoBanking.pmml This Distribution-based Clustering model in PMML format is built from data that describes the customers of a bank who have a particular type of account. The customers are grouped according to similarities of age, income, number of siblings, gender, and account type.
bankingInsert.db2 This script imports the model that is stored in the file clusDemoBanking.pmml and inserts it into the table IDMMX.CLUSTERMODELS.
bankingExtract.db2 This script extracts the following items:
  • The name of the model
  • The number of clusters
  • The number and the names of fields
  • The model quality from a Clustering model
bankingApplyView.db2 This script applies the Clustering model that is imported from the table BANKING_SCORING to the specified data. It retrieves values from the calculated results by using a common table expression.
bankingApplyTable.db2 This script performs the following tasks:
  1. Creating a results table
  2. Reading the Clustering model from the table IDMMX.CLUSTERMODELS into the model cache.
  3. Applying the Distribution-based Clustering model to the banking data to determine the customer segment for each customer in the table BANKING_SCORING.
  4. Storing the calculated results in the table.
  5. Retrieving the results values from the table.
bankingApplyResultSpec.db2 This script performs the following tasks:
  1. Importing the Clustering model from the table BANKING_SCORING
  2. Applying the Clustering model to the specified data by using a result specification
  3. Calculating the score and the quality for cluster ID 3
  4. Retrieving values from the calculated results by using a common table expression
bankingApplyEasyMining.db2 This script uses the Easy Mining procedure ApplyClusModel to score a clustering model.
bankingCacheModels.db2 This script manages the model cache to optimize the performance and to score a single record that is provided by the application. It inserts Clustering models into the table IDMMX.CLUSTERMODELS from the file clusterModels.001.
bankingTriggerScoring.db2 This script uses triggers to recompute scores in real time when a data record is changed.
bankingDelete.db2 This script deletes entries from the example tables that are created when you use the example files. It avoids error messages if only parts of the examples are completed.
clusterModels.del This exported compressed model is used in the script bankingCacheModels.db2.
clusterModelBlobs.001 This exported compressed model is used in the script bankingCacheModels.db2.
retailScoring.data This flat file contains records that describe purchase transactions in the retail industry. You can apply the association rules model and the sequences rules model to this data.
ruleModels.del ruleModelBlobs.001 This is the exported and compressed association rules model and the sequences rules model that are used in the examples.
retailImport.db2 This script creates the Db2 example table RETAIL_SCORING, imports the file retailScoring.data, and inserts the data into the table RETAIL_SCORING. It also imports the models from ruleModelBlobs.001 into the table IDMMX.RULEMODELS.
retailApplyAssoc.db2 This script applies the imported association rules model to the specified data in the table RETAIL_SCORING.
retailApplySequences.db2 This script applies the imported sequences rules model to the specified data in the table RETAIL_SCORING.
retailApplyEasyMining.db2 This script uses the Easy Mining procedure ApplyRuleModel to score a rule model.
retailDelete.db2 This script deletes the example data and the mining objects that are created when you use the retail example files.
db2ExportModels This script exports a model from a table in the database to a file.
db2ImportModels This script imports a model from a file to a table in the database.

Prerequisites

Before you can use the example files, you must follow these steps:
  1. Install and configure data warehousing in Db2® Intelligent Miner Scoring on your operating system.
  2. Enable the Db2 instance.
  3. Create a database, by typing the following command in a Db2 command window:
    db2 create database <dbname>
    where <dbname> is the name of the database, for example, RETAIL.
  4. Enable the database RETAIL for Intelligent Miner Scoring by typing the following command in a Db2 command window:
    idmenabledb RETAIL fenced dbcfg
  5. Connect to the database RETAIL by typing the following command in a Db2 command window:
    db2 connect to RETAIL