Chapter 10. Building the mining models using IM Modeling functions 213
10.3 Configuring a database for mining
This section explains each of the steps in Table 10-1.
10.3.1 Enabling the DB2 UDB instance for modeling
After the modeling module is installed, you need to configure the DB2 UDB
instance and the database before you can use IM Modeling.
Since the modeling data mining function is implemented primarily as UDF, you
have to increase the default memory size allocated to UDF. A recommended
value is 60000.
A DBA or someone with database management (DBM) authority must perform
the steps that are outlined in Table 10-2.
3 Specify mining data Once for each
table
Specify the name and the columns of the training
table.
4 Define mining settings Every model Generate logical data definitions.
Set a number of parameters that are specific for
each data mining function.
5 Defining mining tasks Every model Create the mining task that can also include the
test run specification.
6 Building and storing
mining models
Every model Generate the SQL script that builds and stores the
mining models.
7 Testing classification
models
Test the mining model with the predefined stored
procedure.
8 Working with mining
models and test results
Exporting mining models and test the results.
Action category When Action steps
214 Enhance Your Business Applications: Simple Integration of Advanced Data Mining Functions
Table 10-2 Database instance parameters required for scoring
10.3.2 Configuring the individual database for modeling
After the database instance is configured for modeling, you must enable the
database. The following steps are required for each database.
A DBA or someone with database management (DBM) authority must perform
the steps that are outlined in Table 10-3.
Table 10-3 Database parameters required for scoring
Step Platform Purpose DB2 command
1 UNIX
Windows
Increase
UDF_MEM_SZ
db2 update dbm cfg using udf_mem_sz
60000
2 Windows
only
Increase DB2 UDB
registry parameter
db2set DB2NTMEMSIZE=APLD:240000000
3 UNIX
Windows
Bounce the
database
db2stop
db2start
Step Platform Purpose DB2 command
1 UNIX
Windows
Increase the log size
for a likely long
transaction during
modeling.
db2 update db cfg for <database>
using logfilsiz 2000
2 UNIX
Windows
Increase the
application heaps
control shared
memory.
db2 update db cfg for <database>
using APP_CTL_HEAP_SZ 10000
3 UNIX
Windows
Increase private
memory for the
application.
db2 update db cfg for <database>
using APPLHEAPSZ 1000
4 UNIX
Windows
Create the database
objects that are
required for modeling:
administrative tables,
UDFs, and UDTs.
idmenabledb <database> fenced
tables
Chapter 10. Building the mining models using IM Modeling functions 215
10.3.3 IM Modeling in DB2 UDB V8.1
DB2 UDB V8.1 provide additional User Defined Functions and stored procedures
for IM Modeling. The invocation of modeling run can be made from a single call
to stored procedure.
Table 10-4 illustrates the invocation of modeling runs using stored procedures.
Table 10-4 Stored procedures for starting mining runs
6 UNIX
Windows
This is optional for DB2
UDB V8. With DB2
UDB V8, the use of IM
Modeling can be
simplified by installing
these additional UDFs
and stored procedures.
You can find the source
code in Appendix F,
UDF to create data
mining models on
page 281.
db2 -tvf <path of the extra UDF
and Stored Procedure creation
scripts>
Step Platform Purpose DB2 command
Mining Algorithm Stored Procedure
Clustering BuildClusModel
Example:
call redbook.BuildClusModel('myModel', 'BANKING_MODELING',
ClusSettings('BANKING_MODELING')
..DM_setMaxNumClus(6)..DM_expClusSettings()
Note: This creates a model called myModel on the Banking_Modeling table and creates
up to six clusters.
Tree classification BuildClasModel
Example:
call redbook.BuildClasModel('myModel', 'BANKING_MODELING',
ClasSettings('BANKING_MODELING')
..DM_setMaxNumClus(6)..DM_expClusSettings()
Association BuildRuleModel

Get Enhance Your Business Applications: Simple Integration of Advanced Data Mining Functions now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.