Before using this information and the product it supports, be sure to read the information in Appendix F. Notices.
This edition applies to Version 8.2 of IBM DB2 Intelligent Miner Scoring, program number 5765-F36, and to all subsequent releases and modifications until otherwise indicated in new editions.
This edition replaces SH12-6746-00.
IBM(R) DB2(R) Intelligent Miner(TM) Scoring is an application that integrates the model application functionality of Intelligent Miner for Data with the Oracle database.
Intelligent Miner Scoring enables you to import and apply mining models, and to access the results.
Throughout this book, the following abbreviations are used:
This book describes how to use IM Scoring and IM Scoring Java Beans. It also provides a full reference resource to the database objects provided by IM Scoring.
For more information on:
This book is intended for the following users:
In Oracle, the names of the scoring functions, data types, tables, and table columns are created in uppercase letters, even if you used, for example, lowercase letters. In this book, these names are represented in mixed case for better readability.
The following table shows the formatting conventions used in this book.
| Convention used | How it is used |
|---|---|
| Interface elements, for example, menu bars, buttons, and labels are shown in boldface. | Click OK. |
| Menu instructions are shown in boldface and sequential instructions are separated by arrows. | Click File --> Export. |
| Command syntax is shown in a monospaced font. | idm_setup.bat |
The names of the following are shown in a monospaced
font:
|
The SQL INSERT command inserts the model into a column of the table CLUSTERMODELS, which is configured for the data type DM_ClusteringModel. |
| Variables within syntax descriptions, which you should replace by a real value, are shown in italics. If they consist of more than one word they are placed between angle brackets. | idmdisabledb <db name> |
| Italics are used to highlight the introduction of a new term. | These functions are also referred to as user-defined functions and to indicate that a variable should be replaced. |
The following table shows the abbreviations used in this book.
| Abbreviation | Full form |
|---|---|
| CRM | Customer Relationship Management |
| GUI | Graphical user interface |
| ICU | International Components for Unicode |
| PMML | Predictive Model Markup Language |
| RBF | Radial Basis Function |
| RPM | Redhat Package Manager |
| SQL | Structured Query Language |
| UDF | User-defined function |
| UDT | User-defined data type |
| XML | Extensible Markup Language |
This book is divided into the following parts:
The appendixes provide reference information.
In the reference part of this book, the syntax for IM Scoring's functionality is described 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-'
Your feedback is important in helping us to provide you with the most accurate and high-quality information possible. If you have any comments about this book:
This section introduces you to the new features in IM Scoring.
You can import additional data mining models in PMML format, for example, created by SAS EM or SPSS Clementine. The export and import of PMML models is easier than before. Other programs, such as SAS EM and SPSS Clementine allow to directly import PMML models from their workbenches. For more information refer to:
The standards for data mining are outlined in ISO/IEC 13249; the description appears in Part 6: Data Mining of the standards specification. This specification has the general title Information technology - Database languages - SQL Multimedia and Application Packages.
You should consider the following consistency notices when using IM Scoring V8.2:
The IBM DB2 Intelligent Miner is a set of the following products:
These products provide rapid enablement of IM analytics that are embedded in Business Intelligence (BI), eCommerce, or traditional Online Transaction Processing (OLTP) application programs. They are available as separately priced products. They are also available in the IBM DB2 Data Warehouse Edition, except for IM for Data.
IM Scoring and IM Modeling constitute a software development kit (SDK). They consist of Oracle cartridges (IM Scoring only) or DB2 extensions that include an SQL API. You can embed the SQL API in business applications to exploit the data mining functions from this business application.
In Oracle, professionals can interactively issue SQL statements from the Oracle Enterprise Manager or from SQL*Plus. They can also start Intelligent Miner functions from one of these interfaces.
Depending on the experience, the personal preferences, the mining skills, and the complexity of the problem to solve, you can choose between the following approaches to develop a mining solution:
IM Scoring provides scoring technology as database extenders, DB2 extenders, and Oracle cartridges. It enables application programs to apply PMML models to large databases, subsets of databases, or single rows or cases. Application programs use the SQL API, which consists of user-defined functions (UDFs) to perform the scoring operation. The PMML models might have been created by one of the Intelligent Miner products or by other applications and tools that support PMML models.
The following table shows the different PMML models that can be applied by different mining algorithms.
| Data mining function | PMML model type | Mining algorithm | Generated by IM for Data | Generated by IM Modeling |
|---|---|---|---|---|
| Clustering | Center-based clustering | Center-based Clustering algorithm | yes | no |
| Distribution-based clustering | Distribution-based Clustering algorithm | yes | yes | |
| Classification | Neural networks | Neural Classification algorithm | yes | no |
| Decision tree | Tree Classification algorithm | yes | yes | |
| Regression | Logistic Regression algorithm | no | no | |
| Regression | Regression | Linear Regression algorithm | yes | no |
| composite MiningModel (see Notes) | Transform Regression algorithm | no | yes | |
| Proprietary XML | RBF Prediction algorithm | yes | no | |
| Neural networks | Neural Regression algorithm | yes | no |
IM Scoring includes IM Scoring Java Beans, which enables you to score a single data record in a Java application given a PMML model. This can be used to integrate scoring in e-business applications, for example, for real-time scoring in customer relationship management (CRM) systems.
IM Modeling provides IM Modeling technology as DB2 extenders. It enables SQL application programs to develop analytic models based on data accessed by DB2 Universal Database(TM) Version 8.1 or Version 8.2 SQL. Using the SQL API, you can build Associations, Distribution-based Clustering, Tree Classification, and Transform Regression PMML models that are stored in DB2 tables. They can be processed by IM Scoring or IM Visualization.
IM Modeling is easy to understand for users who are familiar with the mining functions in IM for Data.
IM Visualization provides the following JAVA visualizers to present data modeling results for analysis:
You can use the Intelligent Miner Visualizers to visualize PMML-conforming mining models. Applications can call these visualizers to present model results, or you can deploy the visualizers as applets in a Web browser for ready dissemination. The models might have been developed by using IM Modeling or other applications and tools that support interoperability through the use of PMML models, or models of the Intelligent Miner for Data might have been exported as PMML models. Models are stored as flat files, or you can directly visualize mining models from the database. The models in the database have been created by IM Modeling or they have been imported into the database using the import functions of IM Scoring.
The focus of the PMML standard is interoperability for scoring. The best results with IM Visualization can be achieved if the PMML models contain IM Visualization extensions such as distribution statistics or quality information as produced by IM Modeling. For more information on IM Visualization extensions contact your IBM representative.
IM Visualization Version 8.2 provides the following enhancements:
The Intelligent Miner Visualizers Version 8.1 are also included in Intelligent Miner for Data Version 8.1.
Intelligent Miner for Data Version 8.1 is an independent product that provides the following mining functions to build and apply mining models based on database or flat file data:
The Processing functions can be used only on database tables.
IM for Data Version 8.1 is a stand-alone data mining application (workbench) for end users and primarily statisticians with advanced data mining skills. It includes the Intelligent Miner Visualizers and the PMML conversion component of IM Scoring, which allows you to export mining models in PMML format.
This chapter introduces you to the general concepts you need to know to work with IM Scoring. IM Scoring is an add-on service to Oracle that extends the capabilities of Oracle to include data mining functions. Mining models are built using:
You use IM Scoring as follows:
The model is stored in the database in a standardized XML format (PMML). You can directly visualize the mining model from the database using IM Visualization in stand-alone mode or as a Web applet. You can use IM Scoring to apply the model to new data.
Figure 1 shows that PMML models can be applied to new rows of data (ApplicationData) using the Scoring Apply function, which computes a scoring Result that contains the scores and predictions.
This section introduces you to the different data mining functions that are supported by IM Scoring. These data mining functions contain different PMML model types and mining algorithms. Each model type includes different algorithms to deal with the individual data mining functions.
For example, the Clustering data mining function includes the PMML model types Distribution-based Clustering and Center-based Clustering. The scoring functions for Clustering include the Distribution-based Clustering algorithm and the Center-based Clustering algorithm.
IM Scoring supports the data mining functions provided by:
The Associations mining function finds items that are consistently associated with each other in a meaningful way. For example, you can analyze purchase transactions to discover combinations of goods that are often purchased together. The Associations mining function answers the question: If certain items are present in a transaction, what other item or items are likely to be present in the same transaction?
Classification is the process of automatically creating a model of classes from a set of records that contain class labels. The classification technique analyzes records that are already known to belong to a certain class, and creates a profile for a member of that class from the common characteristics of the records. You can then use a data mining 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 technique 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 cluster score, a quality value, and a confidence value to each individual record being scored. The cluster score, quality value, and confidence value are different measures that indicate how well the record fits into the assigned cluster.
Regression is similar to classification except for the type of the predicted value. Rather than predicting a class label, regression is predicting a numeric value. Furthermore, regression can determine which input fields are most relevant to predict the target field values. The predicted value might not be identical with any value contained in the data used to build the model. An example application is customer ranking by expected profit.
When a model is applied, IM Scoring assigns a predicted value and, for an RBF model, a region ID to each individual customer being scored.
PMML is a standard format for data mining models. Based on XML, the PMML format provides a standard that enables data mining models to be shared between the applications of different vendors. The intention is to provide a vendor-independent method for defining models. In this way, proprietary issues and incompatibilities are no longer a barrier to the exchange of models between applications.
For more information on PMML support refer to Appendix A. IM Scoring conformance to PMML.
IM Scoring applies PMML models to data in the database. The PMML models are stored as binary large objects (BLOBs) in the database. IM Scoring provides UDFs to import models into the database.
You can use the following sources of PMML models:
This section describes the tools that can create PMML models for IM Scoring.
You can use IM for Data to build and store models for all mining functions that are supported as shown in Table 3.
To migrate IM for Data models, you can:
Figure 2 shows the process by which a mining model that was built with IM for Data is exported from IM for Data, imported into an Oracle database, and applied to selected data. To use the IM Scoring mining functions:
The mining technology is based on open standards like SQL/MM, PMML, and XML. Other products, such as SAS EM and SPSS Clementine, allow to directly export PMML models from their workbenches. These models can then be imported into the database using the import functions of IM Scoring. For more information refer to:
Depending on your real-time requirements you can invoke the Scoring apply function in different ways. It is important to consider how often the data to be scored changes and how often you need to recompute the scores.
See Storing scoring results permanently for an example of batch scoring with persistent results.
In this case you have the following options:
Here you find a general introduction to the SQL/MM API terminology and statements.
The SQL/MM API is a standardized open SQL API, that:
The following list familiarizes you with the SQL API terminology:
Figure 3 maps the conceptual objects to the user-defined types (UDTs) used in IM Scoring. This figure shows an example for clustering.
In Figure 3 the Scoring function DM_applyClusModel receives the following parameters:
The DM_ApplRow(...,DM_ApplColumn('Age',...),...) function creates an XML string value representing the database row, because this parameter contains a list of column name/value pairs for all columns in a row. Each pair of column name/value is stored in an DM_ApplColumn object.
As the scores are computed in a scalar user-defined function, the scoring step can be embedded in arbitrary SQL statements.
Example: Apply a Clustering model to determine the customer segment for each customer in table BANKING_SCORING. This example joins the BANKING_SCORING table containing the data rows and the model table CLUSTERMODELS. The model BLOB with MODELNAME 'DemoBanking' is read from table CLUSTERMODELS explicitly:
CREATE OR REPLACE VIEW CLUSTERVIEW (CLUSTER_RESULT) AS
SELECT IDMMX.DM_applyClusModel(C.MODEL,
IDMTY.DM_ApplRow(
IDMTY.DM_ApplColumn('TYPE', B.TYPE, NULL),
IDMTY.DM_ApplColumn('AGE', NULL, B.AGE),
IDMTY.DM_ApplColumn('SIBLINGS', NULL, B.SIBLINGS),
IDMTY.DM_ApplColumn('INCOME', NULL, B.INCOME)))
FROM BANKING_SCORING B, ClusterModels C WHERE C.MODELNAME = 'DemoBanking';
SELECT IDMMX.DM_getClusterID( CLUSTER_RESULT ) ClusterID,
IDMMX.DM_getClusScore( CLUSTER_RESULT ) ClusterScore
FROM CLUSTERVIEW;
The aim of this chapter is to get you up and running quickly in using the IM Scoring samples. It provides information on the tasks that you need to complete to get started. Refer to DB2 Intelligent Miner Modeling, DB2 Intelligent Miner Scoring, DB2 Intelligent Miner Visualization: Installing the Intelligent Miner products for a detailed description on how to install and configure IM Scoring.
Refer to Sample files and Completing the practice exercises to find samples and to become more familiar with the IM Scoring mining functions. These sections guide you through a tutorial of practice exercises on sample data. By using the data and scripts provided with the IM Scoring package and the instructions given in these sections, you become familiar, for example, with the following actions:
All the tasks in the practice exercises are completed by means of sample scripts. The scripts include standard SQL commands, such as INSERT, and scoring functions, such as DM_impClusFile. The contents of the scripts are given in these sections so that you can see how the SQL statements are structured. You can use these sample scripts as a basis for your own scripts.
IM Scoring provides a set of samples to help you to get familiar with the UDFs and UDTs.
The UDTs and UDFs (refer to Scoring data types and functions) provided with IM Scoring must be created in the databases that you want to use with IM Scoring. To enable the default Oracle database, run the script idm_setup, which is available in the bin directory of your IM Scoring installation. The script calls SQL*Plus and runs several other SQL scripts that create the necessary database objects. You can enable another database by switching the default database. To do this, change the environment variable ORACLE_SID as necessary, and run idm_setup again.
For more information refer to The idm_setup command.
If you already have PMML models, you can generate SQL scripts from them by using the idmmkSQL tool. These scripts will contain template SQL statements that import and apply the model. The SQL script contains placeholders that you replace with the names of concrete database objects in order to finally get the executable SQL script.
For more information, see:
You can find a practice exercise in using the idmmkSQL tool at Using idmmkSQL to work with your own mining models.
The IM Scoring package includes sample files consisting of a series of practice exercises in using IM Scoring. This tutorial material enables you to:
For more information refer to Introducing data mining functions.
For more information refer to Using IM Scoring Java Beans.
The IM Scoring sample files reside in the samples/ScoringOracle directory of your IM Scoring installation. This directory contains the mining model, data, and scripts that you require to complete the exercises in this chapter.
On Windows(R) you can also use the shortcut IBM DB2 -> Business Intelligence Tools -> Intelligent Miner Scoring 8.2 -> Samples - Oracle in the program folder. This displays a short help topic about how to run the samples.
The IM Scoring Java Beans examples are available in samples/ScoringBean.
Table 4 and Table 5 list the files that are included in the samples directory and explain the purpose of each.
| Sample file | Description |
|---|---|
| readme.txt | A README file containing instructions on how to use the sample files. |
| idm_create_demotab.sql | A script that creates three tables, which are used to store models and their names. |
| idm_drop_demotab.sql | A script that drops the tables created by idm_create_demotab.sql. |
| banking_import.sql | A script that creates the sample table banking_scoring, and calls banking_populate.sql to write the data to the table banking_scoring. |
| banking_populate.sql | A script containing a sequence of INSERT statements that write the records of a bank's customers to the table banking_scoring. This is the data to which you will apply the model. |
| clusDemoBanking.pmml | A Distribution-based Clustering model in PMML format. The model was built from data for a bank's customers who have a particular type of account. Customers are grouped according to similarities of age, income, number of siblings, gender, and account type. |
| clusNeuralBanking.pmml | An exported Center-based Clustering model. The model was built from data for a bank's customers. |
| banking_insert.sql | A script that imports the model, which is stored in the file clusDemoBanking.pmml, and then inserts the model into the table CLUSTERMODELS. |
| banking_extract.sql | A script that extracts various information from the model that has been imported into the database by means of the script banking_insert.sql. |
| banking_apply1.sql |
A script that applies the imported Clustering model to the specified data from the table banking_scoring, and then obtains values from the calculated results. The script uses DM_ApplRow and DM_ApplColumn to construct data of the type DM_ApplicationData. |
| banking_apply2.sql | A script that applies the imported Clustering model to the specified data from the table banking_scoring, creates a results table, stores the calculated results in the table, and then obtains results values from the table. The script uses DM_ApplRow and DM_ApplColumn to build the input data records. |
| banking_apply3.sql | Like banking_apply2.sql, except that it uses the DM_applData function instead of DM_ApplRow and DM_ApplColumn to construct data of the type DM_ApplicationData. |
| banking_apply4.sql | Like banking_apply2.sql, except that it uses the CONCAT function instead of DM_ApplRow and DM_ApplColumn to construct data of the type DM_ApplicationData. |
| compressV7Models.sql | The script compresses models that have been created with IM Scoring V 7.1. For more information refer to Migrating from IM Scoring V7.1 and Migrating from IM Scoring Version 8.1. |
| PredictFunctions-readme.txt | A README file explaining the additional prediction UDFs. |
| PredictFunctions-sample.sql | A script that provides a sample how to use the clustering prediction functions. |
| Sample file | Description |
|---|---|
| SampleDemoBanking_Oracle.java | A sample program that applies a model in an Oracle database using the Java Single Record Scorer. |
| 93er_cars.pmml | A Polynomial Regression model |
| Sample93erCars.java | A sample Java program |
| readme.txt | A README file |
Before you can complete the practice exercises, you must install IM Scoring and configure the system environment as described in DB2 Intelligent Miner Modeling, DB2 Intelligent Miner Scoring, DB2 Intelligent Miner Visualization: Installing the Intelligent Miner products.
The tutorial introduces the following tasks:
In this exercise, you create a table and import the banking data. You will later apply the mining model to this data.
To create a table and import the sample data, which is contained in the file banking_populate.sql, run the sample script banking_import.sql by using the following SQL*Plus command:
@banking_import
In the first part of the script banking_import.sql, the table banking_scoring is dropped. The PL/SQL code avoids an error message if the table does not exist. The second part recreates the table and defines the columns and their data types. At the end, the script calls another script banking_populate.sql, which inserts some records into the table banking_scoring:
BEGIN
EXECUTE IMMEDIATE 'DROP TABLE BANKING_SCORING';
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
/
CREATE TABLE BANKING_SCORING (
TYPE CHAR(7),
GENDER CHAR(6),
AGE NUMBER,
PRODUCT CHAR(1),
SIBLINGS NUMBER,
INCOME NUMBER
);
@@banking_populate.sql
In this exercise, you create the tables that are used to store mining models, and you import a sample mining model into one of these tables.
To create the sample tables for mining models, use the following command in SQL*Plus to run the script idm_create_demotab.sql:
@idm_create_demotab
The script creates three tables in your schema:
Each table has a column for storing the model name, and a column for storing the model itself.
Keep in mind that you can drop these tables with script idm_drop_demotab.sql if the tables are no longer needed.
To import the sample mining model, which is stored in the file clusDemoBanking.pmml, use the following command to run the sample script banking_insert.sql:
@banking_insert
The following script shows an example for AIX(R). It uses the function DM_impClusFile, which is specific to IM Scoring, to import the mining model contained in the file clusDemoBanking.pmml. The SQL INSERT command inserts the mining model into a column in the table CLUSTERMODELS, and sets the name of the model to DemoBanking. The table CLUSTERMODELS is configured for the data type DM_ClusteringModel.
insert into CLUSTERMODELS values ( 'DemoBanking', IDMMX.DM_impClusFile ( '/usr/opt/IMinerX/V8.2/samples/ScoringOracle/clusDemoBanking.pmml')); commit;
You can use different scripts to apply mining models and obtain the results of applying the mining model.
In this exercise, you apply the Distribution-based Clustering model to the banking data and get the values of the calculated results.
To apply the sample mining model and obtain the results of applying the model, use the following command to run the script banking_apply1.sql:
@banking_apply1
The sample script banking_apply1.sql contains the following statements:
execute IDMMX.DM_initialize
CREATE OR REPLACE VIEW CLUSTERVIEW (CLUSTER_RESULT) AS
SELECT IDMMX.DM_applyClusModel(C.MODEL,
IDMTY.DM_ApplRow(
IDMTY.DM_ApplColumn('TYPE', B.TYPE, NULL),
IDMTY.DM_ApplColumn('AGE', NULL, B.AGE),
IDMTY.DM_ApplColumn('SIBLINGS', NULL, B.SIBLINGS),
IDMTY.DM_ApplColumn('INCOME', NULL, B.INCOME)))
FROM BANKING_SCORING B, ClusterModels C WHERE C.MODELNAME = 'DemoBanking';
SELECT IDMMX.DM_getClusterID( CLUSTER_RESULT ) ClusterID,
IDMMX.DM_getClusScore( CLUSTER_RESULT ) ClusterScore
FROM CLUSTERVIEW;
DROP VIEW CLUSTERVIEW;
The script first calls the DM_initialize function, which must be called once per schema before you can use any of the apply scoring functions. Therefore, if you use another Oracle user account for executing scoring functions, first call DM_initialize to prepare the schema for executing application functions. You can call this function repeatedly if you are not sure whether you have already called it.
The script creates a view that defines a CLUSTER_RESULT column that is the result of applying the model DemoBanking to records of the table banking_scoring. Because DemoBanking is a Clustering model, the scoring function DM_applyClusModel is used. The data values are obtained using the user-defined types DM_ApplRow and DM_ApplColumn.
Next, the script obtains the cluster ID and the Clustering quality from (CLUSTER_RESULT) by using the functions DM_getClusterID and DM_getClusScore. The SELECT statement writes these two final results to the screen. Finally, the view is dropped because it is no longer used.
To apply the sample mining model, store results, and obtain results values, run the script banking_apply2.sql by using the following command:
@banking_apply2
The following sample script shows part of the content of banking_apply2.sql:
execute IDMMX.DM_initialize
CREATE TABLE BANKING_APPLY(
TYPE CHAR(7),
GENDER CHAR(6),
AGE NUMBER,
PRODUCT CHAR(1),
SIBLINGS NUMBER,
INCOME NUMBER,
CLUSTER_RESULT VARCHAR2(512)
);
INSERT INTO BANKING_APPLY
SELECT B.TYPE, B.GENDER, B.AGE, B.PRODUCT, B.SIBLINGS, B.INCOME,
IDMMX.DM_applyClusModel(C.MODEL,
IDMTY.DM_ApplRow(
IDMTY.DM_ApplColumn('TYPE', B.TYPE, NULL),
IDMTY.DM_ApplColumn('AGE', NULL, B.AGE),
IDMTY.DM_ApplColumn('SIBLINGS', NULL, B.SIBLINGS),
IDMTY.DM_ApplColumn('INCOME', NULL, B.INCOME)))
FROM BANKING_SCORING B, CLUSTERMODELS C WHERE
C.MODELNAME = 'DemoBanking';
SELECT AGE, IDMMX.DM_getClusterID( CLUSTER_RESULT ) ClusterID,
IDMMX.DM_getClusScore( CLUSTER_RESULT ) ClusterScore
FROM BANKING_APPLY WHERE AGE > 50;
DROP TABLE BANKING_APPLY;
First, the script calls DM_initialize; note that this is necessary only if it is not already done. The script creates a table for the mining results by defining the names and the data types of the table columns. The last column, CLUSTER_RESULT, is designated for the calculated results. This column has a data type of VARCHAR2, which is the source data type for DM_ClusResult. DM_ClusResult is the data type returned by DM_applyClusModel. The script then applies the DemoBanking model to selected data from the banking_scoring table by using function DM_applyClusModel. Next, it obtains the cluster ID and the Clustering quality from the CLUSTER_RESULT column of the new table by using the functions DM_getClusterID and DM_getClusScore. Finally, it drops the table BANKING_APPLY.
You can also apply models and compute cluster IDs in a single SQL query. The following example shows an SQL query of this kind:
SELECT B.TYPE, B.GENDER, B.AGE, B.PRODUCT, B.SIBLINGS, B.INCOME,
IDMMX.DM_getClusterID(
IDMMX.DM_applyClusModel(C.MODEL,
IDMTY.DM_ApplRow(
IDMTY.DM_ApplColumn('TYPE', B.TYPE, NULL),
IDMTY.DM_ApplColumn('AGE', NULL, B.AGE),
IDMTY.DM_ApplColumn('SIBLINGS', NULL, B.SIBLINGS),
IDMTY.DM_ApplColumn('INCOME', NULL, B.INCOME)))) AS ClusterID
FROM BANKING_SCORING B, CLUSTERMODELS C WHERE C.MODELNAME = 'DemoBanking';
In this exercise, you extract information from a model.
The model from which you extract information is the one that you inserted into the database as part of the exercise in the section Creating sample tables for mining models and importing a model.
The information that you extract is:
To extract the information, run the script banking_extract.sql by using the following command:
@banking_extract
The sample script banking_extract.sql contains the following statements:
COLUMN CLUSTERMODELNAME FORMAT A60
COLUMN NO_OF_CLUSTERS FORMAT 9999
COLUMN FIELDNAME1 FORMAT A15
COLUMN FIELDNAME2 FORMAT A15
COLUMN FIELDNAME3 FORMAT A15
COLUMN FIELDNAME4 FORMAT A15
CREATE OR REPLACE VIEW MODELCONTENT ( CLUSTERMODELNAME, NO_OF_CLUSTERS,
MODELFIELDS ) AS
SELECT IDMMX.DM_getClusMdlName( MODEL ),
IDMMX.DM_getNumClusters( MODEL ),
IDMMX.DM_getClusMdlSpec( MODEL )
FROM CLUSTERMODELS WHERE MODELNAME = 'DemoBanking';
SELECT CLUSTERMODELNAME, NO_OF_CLUSTERS,
IDMMX.DM_getFldName(MODELFIELDS, 1) AS FIELDNAME1,
IDMMX.DM_getFldName(MODELFIELDS, 2) AS FIELDNAME2,
IDMMX.DM_getFldName(MODELFIELDS, 3) AS FIELDNAME3,
IDMMX.DM_getFldName(MODELFIELDS, 4) AS FIELDNAME4
FROM MODELCONTENT;
In this exercise, you use IM Scoring Java Beans to score records. To do this, you use the sample program Sample93erCars.java, which you can find in the IM Scoring installation directory under samples/ScoringBean.
In the example, the minimum price of a car is predicted, given the basic characteristics for a car. The data used to train and generate the mining model contained a large number of fields, including:
The training data also contained the actual Minimum Price (in $1000), which was used as the predicted field when the mining model was generated. When IM Scoring Java Beans is used with this model, the scorer predicts the minimum car price for new, previously unseen data.
First, IM Scoring Java Beans is set up to be used for scoring runs. The section of code that follows shows the source code that is used to do this. Here, a constructor is provided that takes as its input parameter the name of the file in which the mining model is stored.
In the example, the model file 93er_cars.pmml is located in the same directory as the sample program. The constructor calls the method initModel(String modelFile), where the instance variable scorer is initialized with the new mining model. This initialization can be done by means of the constructor of the RecordScorer class, or by using the openModel(String modelFile) method.
This operation can take some time, because the mining model is loaded into memory, parsed, and interpreted for scoring. When this is complete, the initialized scorer is prepared for scoring.
Source code: Setting up the RecordScorer
public Sample93erCars(String modelFile ) {
initModel( modelFile );
}
public void initModel( String modelFile ) {
try {
// set the new model file and load the model as preparation for
// following scoring runs
if ( scorer == null ) {
scorer = new RecordScorer( modelFile );
} else scorer.openModel( modelFile );
} catch ( ModelException e ) {
e.printStackTrace();
}
}
When the setup of RecordScorer is complete, it can be used immediately for scoring on a record-by-record basis and for the reading of results. The source code given in Source code: Applying scoring on a record-by-record basis shows how this works.
The record that you want to score is the input for the doScoring(Map record) method. The call to scorer.score(record) computes the scoring result. The result is stored as an instance variable in the scorer object, and can be accessed now by means of the getPredictedValue() method. To keep the scoring API as simple and small as possible, there are no extra result objects provided for each of the model types. Instead, the RecordScorer provides a set of methods that are used to access the computed result fields. If a method is called that does not suit the actual model type, a ResultException is thrown. A call to getClusterID(), for example, instead of to getPredictedValue() in the code given in Source code: Applying scoring on a record-by-record basis would result in such an exception.
Source code: Applying scoring on a record-by-record basis
/**
* Applies scoring: Gets a record as input, applies scoring
* and displays the output.
* @param record the record used for scoring
*/
public void doScoring( Map record ) {
if ( scorer != null ) {
try {
// do scoring now
scorer.score( record );
// Before reading the results, validate that the
// model type is set to regression.
if ( scorer.getModelType() == Scorer.REGRESSION_TYPE ) {
double predictedValue = scorer.getPredictedValue();
displayPredictionResult( record, predictedValue,
"minimum car price" );
}
} catch ( Exception e ) {
// an error occurred while scoring the record
e.printStackTrace();
}
}
}
The code given in Source code: Accessing model metadata shows how access is gained to the metadata of the mining model that is used. For a specified model, it is possible to retrieve the active mining fields that are used, as well as the mining types of these fields. A field that is used by the mining model for the computation of the scoring result is known as an active mining field. In the method displayActiveFields(), the active fields and their related mining types are displayed.
Source code: Accessing model metadata
/**
* Displays the active fields of the mining model that was used.
* The active fields are the ones that are used by the mining
* model for scoring.
*/
public void displayActiveFields() {
if ( scorer != null ) {
String[] activeFields = scorer.getFieldNames();
if ( activeFields != null ) {
System.out.println( "\nActive Fields: " );
for ( int i=0; i<activeFields.length; i++ ) {
System.out.print( "Field Name: " + activeFields[i] );
if ( scorer.isCategoricalField( activeFields[i] ) ) {
System.out.println( ", Mining Type: categorical" );
} else {
System.out.println( ", Mining Type: numerical" );
}
}
}
}
}
The code given here in Source code: The main program shows the main program. Here, the following scenario is demonstrated:
Source code: The main program
public static void main( String[] args ) {
File file = new File( "93er_cars.pmml" );
Sample93erCars obj = new Sample93erCars( file.getAbsolutePath() );
HashMap record = new HashMap();
// A customer starts with the specification of some basic features
// that the car should have. The engine should be powerful, with
// 200 horsepower. The car should have good safety features,
// so that 2 airbags should be available.
// As well, it should use only a moderate amount of gas when
// being driven in the city.
// The estimated minimum price is predicted.
record.put( "Horsepower", new Integer(200) );
record.put( "Air Bags standard", new Integer(2) );
record.put( "City MPG", new Integer(17) );
carPricePredictor.doScoring( record );
// After hearing the estimated price, the customer gets more
// specific, and asks for some more features.
// The car should not be longer than 185 inches, and should be
// at least 68 inches wide.
record.put( "Width (inches)", new Integer(68) );
record.put( "Length (inches)", new Integer(185) );
carPricePredictor.doScoring( record );
// The customer now details the requirements for the engine and the
// driving behavior, and wants to know the new estimated price.
record.put( "Number of cylinders", new Integer(8) );
record.put( "RPM", new Integer(5500) );
record.put( "U-turn space (feet)", new Integer(40) );
carPricePredictor.doScoring( record );
// Finally, the customer adds some details about how the inside of
// the car should look.
// Note: If you look at the model 93er_cars.pmml, you will see that
// "Passenger capacity" and "Luggage capacity (cu.feet)" do not
// appear at all. This means that these features do not affect
// the predicted price. Even if the model does not contain these
// fields, they can be specified in the record.
record.put( "Rear seat room (inches)", new Integer(28) );
record.put( "Passenger capacity", new Integer(28) );
record.put( "Luggage capacity (cu. feet)", new Integer(30) );
carPricePredictor.doScoring( record );
}
To compile the Java program Sample93erCars.java:
This will generate the class file Sample93erCars.class.
To start the program, type java Sample93erCars.
The code given here in Results output for Sample93erCars shows the output of the program. The output demonstrates how the price varies with the new features that the car should have.
Results output for Sample93erCars:
Active Fields: Field Name: Width (inches), Mining Type: numerical Field Name: U-turn space (feet), Mining Type: numerical Field Name: City MPG, Mining Type: numerical Field Name: Air Bags standard, Mining Type: numerical Field Name: Rear seat room (inches), Mining Type: numerical Field Name: Horsepower, Mining Type: numerical Field Name: RPM, Mining Type: numerical Field Name: Number of cylinders, Mining Type: numerical Field Name: Length (inches), Mining Type: numerical Prediction result: Horsepower: 200 City MPG: 17 Air Bags standard: 2 ========================================= Minimum Car Price (in $1000): 30.45425764285364 Prediction result: Length (inches): 185 Horsepower: 200 Width (inches): 68 City MPG: 17 Air Bags standard: 2 ========================================= Minimum Car Price (in $1000): 32.57913872719416 Prediction result: Number of cylinders: 8 Length (inches): 185 U-turn space (feet): 40 Horsepower: 200 RPM: 5500 Width (inches): 68 City MPG: 17 Air Bags standard: 2 ========================================= Minimum Car Price (in $1000): 36.47348105441428 Prediction result: Width (inches): 68 U-turn space (feet): 40 City MPG: 17 Passenger capacity: 28 Air Bags standard: 2 Rear seat room (inches): 28 Horsepower: 200 RPM: 5500 Number of cylinders: 8 Luggage capacity (cu. feet): 30 Length (inches): 185 ========================================= Minimum Car Price (in $1000): 36.41880910964151
In this exercise, you generate a template SQL script using the command line tool idmmkSQL. You then edit the template SQL script to create the final script and execute it.
To do this exercise, you must first have successfully completed the steps described in Creating a table and importing data.
To generate a template SQL script that contains the necessary SQL statements to perform a scoring run:
idmmkSQL -d Oracle clusDemoBanking.pmml clusDemoBanking.sqlThis generates the file clusDemoBanking.sql.
This depends on your operating system and your installation directory.
Column AGE is used to identify the records. This appears twice in the file.
To run the script clusDemoBanking.sql, use the following command in SQL*Plus:
@clusDemoBanking.sql
The script:
You can display the results using the following SQL statement:
SELECT * FROM RESULTTABLE
The results are the same as with the scripts banking_apply1.sql, which you executed in a previous exercise.
This chapter guides you through the use of IM Scoring to perform data mining tasks within a database. Use IM Scoring to:
The database objects supplied with IM Scoring consist of the following:
The UDTs and the UDFs are grouped together in the package IDMMX. The UDTs are either defined in the package IDMMX or in the schema IDMTY. Note that the package does not export the UDTs. You must use the source data types (described in Data types reference) when you create tables with UDTs. To access a UDF, you must specify the fully qualified name, for example, IDMMX.DM_applyClusModel.
The data types and functions are designed along the proposed SQL Standard ISO/IEC 13249-6 SQL/MM Part 6: Data Mining.
Reference supplies overview lists and full descriptions of all the database objects supplied with IM Scoring.
The user-defined data types are used for identifying and storing mining models and results in Oracle tables and for constructing input data for the scoring functions. User-defined data types are also referred to as user-defined types or UDTs.
The user-defined data types provided by IM Scoring consist of distinct types and object types. However, the distinct types are used internally in the package IDMMX and are not visible to the user. Therefore, the "real" parameter types of the UDFs are the source data types of the distinct types. Nevertheless, distinct types are used in the definition of the UDFs in this book in order to better express the meaning of these types.
IM Scoring provides scoring functions, also referred to as user-defined functions (UDFs), which enable you to:
IM Scoring provides a set of new UDTs and UDFs. Before you can use them from SQL statements, they must be created in the database as database objects. In other words, the database must be enabled for the use of IM Scoring.
To enable an Oracle database for IM Scoring, call the command idm_setup. It can be found in the bin directory of your IM Scoring installation.
The program asks for the password of the predefined Oracle user SYS. It calls SQL*Plus and executes a number of SQL scripts that create the necessary database objects. The output from the object creation commands is displayed and written to the file setup.log. Check this log file for any errors. Enter exit on the command line to leave SQL*Plus.
The setup scripts create an Oracle data cartridge in the default database that contains all the scoring functions and some data types. The scoring functions are implemented in a package that is accessible to all users through the public synonym IDMMX. In addition, the scripts create a new user and the schema IDMTY, which also stores some data types.
You must call the command idm_setup for each database that you want to use with IM Scoring. To make this possible, change your default database (by means of the environment variable ORACLE_SID) and call idm_setup again.
For complete instructions on using this command, see The idm_setup command.
To disable databases, IM Scoring provides the SQL script idm_uninstall. This script drops from the default database all the IM Scoring UDTs, UDFs, and schemas that were created. Call this script if you no longer want to use a database with IM Scoring, or before you uninstall IM Scoring.
To execute the script:
The script idm_uninstall must be executed for each database that you want to disable. To make this possible, change your default database (by means of the environment variable ORACLE_SID) and call idm_uninstall again.
Note that idm_uninstall drops database objects without checking if there are dependencies on other objects. Therefore, database objects that are dependent on one of IM Scoring's new types or functions might become invalid.
For instructions on using this command, see The idm_uninstall command.
This section shows how to obtain mining models to be scored in IM Scoring. Introducing IM Scoring familiarizes you with the tools for creating mining models. It also introduces you to the different model formats that can be used.
IM for Data stores models as results objects within an internal structure, and allows you to export these objects to an external file.
To export a results object, follow these steps:
If you export a model in PMML or XML format, an XML encoding is written into the file. The XML encoding is determined by the language environment and the locale of the IM for Data client V8.1.
For more information refer to Appendix D. Using IM Scoring in a multilanguage environment.
You can convert mining models in Intelligent Miner format to PMML 2.1 format by using the command line tool idmxmod. The input model in Intelligent Miner format must exist as a flat file. The output model in PMML format is also contained in a flat file.
For instructions on using this command line tool, see The idmxmod command.
The IM Scoring functions for importing mining models read a file that contains the mining model or a CLOB value from a database table that contains a PMML model. Each import function returns the mining model as data of one of the data types specific to IM Scoring.
You can use an SQL command to insert the returned data into a table where a column has been configured for the appropriate data type.
The IM Scoring package contains sample tables that are configured for the imported models. The sample tables can be created by running script idm_create_demotab.sql. See also Creating sample tables for mining models and importing a model.
Errors can occur in the following circumstances:
The import functions import a mining model from a file and return it as a value of the appropriate data type. Table 6 shows the relationship between the import function, the returned data type, and the sample table. For XML files, the XML encoding specification in the XML header is respected. If the encoding specification does not exist, UTF8 is assumed. For more information on encoding, see Appendix D. Using IM Scoring in a multilanguage environment.
| Import function | Data type | Table |
|---|---|---|
| DM_impClusFile | DM_ClusteringModel | CLUSTERMODELS |
| DM_impClasFile | DM_ClasModel | CLASSIFMODELS |
| DM_impRegFile | DM_RegressionModel | REGRESSIONMODELS |
Figure 4 illustrates the relationship between model type, scoring functions, and the data type of the column in the Oracle table.
You can use the following SQL command to import the file myclusters.xml and insert it into the CLUSTERMODELS table in your schema:
insert into CLUSTERMODELS
values ('CustomerSegments', IDMMX.DM_impClusFile('c:\tmp\myclusters.xml'))
With IM Scoring's import functions, you can override the encoding specification given in the XML file and explicitly specify the encoding to be assumed for the file to be imported.
The import functions of IM Scoring listed in Table 7 use a specific XML encoding to import a mining model from a file and return it as a value of the appropriate data type.
Specifying an XML encoding can be required, for example, if the encoding specified in the file is an unsupported name for a supported code page, or if the encoding of the file has been changed without changing the encoding written in the file.
Table 7 shows the relationship between the import function, the returned data type, and the sample table. The encoding of characters in the imported file is given explicitly. For more information on encodings, see Appendix D. Using IM Scoring in a multilanguage environment.
| Import function | Data type | Table |
|---|---|---|
| DM_impClusFileE | DM_ClusteringModel | CLUSTERMODELS |
| DM_impClasFileE | DM_ClasModel | CLASSIFMODELS |
| DM_impRegFileE | DM_RegressionModel | REGRESSIONMODELS |
You can use the following SQL command to import the file myclusters.xml and insert it into the CLUSTERMODELS table in your schema:
insert into CLUSTERMODELS values( 'CustomerSegments',
IDMMX.DM_impClusFileE('c:\tmp\myclusters.xml', 'iso-8859-1' )
You can use import functions that import a PMML model that already resides in a database table column as a CLOB value.
Table 8 shows the relationship between the import function, the returned data type, and the sample table.
| Import function | Data type | Table |
|---|---|---|
| DM_impClusModel | DM_ClusteringModel | CLUSTERMODELS |
| DM_impClasModel | DM_ClasModel | CLASSIFMODELS |
| DM_impRegModel | DM_RegressionModel | REGRESSIONMODELS |
The following is an example of the use of these import functions.
insert into CLUSTERMODELS select modelname, IDMMX.DM_impClusModel( model ) from PMMLCLUSTERMODELS
It can be time consuming to manually write the SQL scripts that contain the necessary SQL statements for applying a model to a set of input records. This is especially the case if there are a lot of mining fields. For this reason, IM Scoring provides a separate tool, the idmmkSQL command, that generates from mining models the SQL statements that you need. The tool:
The template script contains placeholders for actual values like table names or file names. You have to manually insert these values into the template to get the final SQL script.
The idmmkSQL command supports the different ways of building input data records for the application functions that are provided by IM Scoring. The tool has a command line interface. The type of SQL and the method of building input data records can be controlled by command line parameters.
For instructions on using this tool, see The idmmkSQL command.
You can extract, for example, the following information from a model in the database:
To extract the information, you define a script and then run the script. An example of how to extract information is provided in Extracting information from a model.
This section contains instructions on applying mining models. It is important to get the best possible result when you apply a model to new data records. To ensure this, provide a value in a data record for each active field in the model. The data record consists of a set of field names and their values. The field names in the set match the names of the active fields in the model.
If necessary, you can access information about the active fields in your model. For a sample script that does this, see Extracting information from a model.
IM Scoring includes functions that apply imported mining models to selected data. Table 9 lists each function together with a brief summary of how it is used.
| Application function | Purpose |
|---|---|
| DM_applyClusModel | Applies a model to selected data to produce results
data, grouped into clusters. Clusters are identified when the model is built.
They identify similar characteristics in data.
A possible use of this function is in producing targeted mailshots. |
| DM_applyClasModel | Applies a model to selected data to produce results
data that is classified according to rules established when the model is built.
A possible use of this function is in classifying insurance risks. |
| DM_applyRegModel | Applies a model to selected data to calculate a predicted
value. The predicted value is based on the values of input fields, according
to a pattern established when the model is built.
A possible use of this function is in ranking customers. |
Each function has the following input arguments:
The function returns results data that contains the values that the mining logic calculates.
The field names contained in the XML data record value are mapped to the fields in the applied model using the following logic:
The field names in the displayName attribute and the name attribute might differ.
If you created the model by using IM for Data, the attribute displayName is empty, and the attribute name contains the name of the field used in IM for Data.
The recommended way to construct the input data for the application functions is to use DM_ApplRow and DM_ApplColumn. This way is slightly slower than using CONCAT and slightly more expensive to write than DM_applData. However, it does not have the disadvantages of the other two methods. (For a description of these disadvantages, see the next two sections.) The UDTs IDMTY.DM_ApplRow and IDMTY.DM_ApplColumn enable you to construct the input for the application functions. These data types are defined as follows:
create type DM_ApplColumn as object ( label VARCHAR2(64), charValue VARCHAR2(128), numValue NUMBER ); create type DM_ApplRow as table of DM_ApplColumn;
DM_ApplColumn stores the label for a field that is defined in the model and its field value obtained from the current data record. If the value is of the 'character' data type, use charValue to store it. If it is of the 'number' data type, use numValue to store it. You must set either charValue or numValue to NULL to indicate that the other is valid. This way, DM_ApplColumn can store the equivalent information to the following:
DM_ApplRow is used to line up all DM_ApplColumn definitions for a data record.
The following is an example of the use of DM_ApplRow and DM_ApplColumn. It shows the create view statement that is part of the sample banking_apply1.sql.
CREATE OR REPLACE VIEW CLUSTERVIEW (CLUSTER_RESULT) AS
SELECT IDMMX.DM_applyClusModel(C.MODEL,
IDMTY.DM_ApplRow(
IDMTY.DM_ApplColumn('TYPE', B.TYPE, NULL),
IDMTY.DM_ApplColumn('AGE', NULL, B.AGE),
IDMTY.DM_ApplColumn('SIBLINGS', NULL, B.SIBLINGS),
IDMTY.DM_ApplColumn('INCOME', NULL, B.INCOME)))
FROM BANKING_SCORING B, ClusterModels C WHERE C.MODELNAME = 'DemoBanking';
You can use the function DM_applData to construct the type DM_ApplicationData if the following is true:
The DM_ApplicationData value is the input for the application functions.
For each column of your input data table, there must be a call to DM_applData that processes the value of this column. This value and the corresponding field name in the model is passed to DM_applData, and DM_applData assembles an XML string out of that. DM_applData is called in a nested way, this causes the XML string to grow with each call, since DM_applData concatenates the XML strings generated with each call. Thus, the final result is an XML string that contains a sequence of field name/value pairs. The XML string is of type DM_ApplicationData and is used as the input for the various application functions.
Consider the following situation. You have an input table B that contains the columns Type and Age, and the mining fields in the model have these names as well. In this case, you can use DM_applData as follows:
IDMMX.DM_applData(IDMMX.DM_applData('TYPE', B.TYPE), 'AGE', B.AGE)
The innermost call of DM_applData has only two parameters, field names and value. All the other calls have three parameters, because the result of a DM_applData call is input for the embracing DM_applData call.
For example, the following call corresponds to the call described in Specifying data by means of CONCAT:
IDMMX.DM_applData( IDMMX.DM_applData( 'CHARCOL', CHARCOL ) , 'DOUBLECOL', DOUBLECOL )
For performance-critical applications use the built-in operator CONCAT, or the corresponding characters ||, in a sequence to construct the type DM_ApplicationData. For more information on the required format of the string, see DM_impApplData.
For example, the following calls correspond to the example described in Specifying data by means of DM_applData.
IDMMX.DM_impApplData('<row><column name="CHARCOL">'
||CHARCOL||'</column> '||'column name="DOUBLECOL">'
||DOUBLECOL||'</column></row>')
The concatenation operator implicitly converts a NUMBER argument to a VARCHAR2 string. The characters that are used for the conversion are chosen according to the current territory of the session. However, the function DM_impApplData needs a dot as the decimal character for numbers. Therefore, if your current territory setting defines another character as the decimal character, you should replace DOUBLECOL in the example above by:
TO_CHAR(DOUBLECOL, 'TM9', 'NLS_NUMERIC_CHARACTERS=''.,''')
If the columns CHARCOL and DOUBLECOL have NULL values, you must call CONCAT as follows:
IDMMX.DM_impApplData('<row><column name="CHARCOL"'
||NVL2(CHARCOL,'>'||CHARCOL,' null="true">')
||'</column>'||'<column name="DOUBLECOL"'
||NVL2(DOUBLECOL,'>'||DOUBLECOL,' null="true">')||'</column></row>')
You have three alternatives in constructing an instance of data type DM_ApplicationData:
Each alternative has its advantages and disadvantages:
The results data from each of the scoring functions is identified by a data type that is specific to IM Scoring. Table 10 lists the application functions together with their data types and results data.
| Application function | Data type | Results data |
|---|---|---|
| DM_applyClusModel | DM_ClusResult | Cluster ID, score, quality, confidence |
| DM_applyClasModel | DM_ClasResult | Predicted class, confidence |
| DM_applyRegModel | DM_RegResult |
|
Figure 5 illustrates the process by which data is selected and a model is applied. Values for the fields age and salary are read from a database table to form an instance of the data type DM_ApplicationData. This data and the model, ClusterModel, form the input to the function DM_applyClusModel. The results of applying the model consist of a cluster ID and a cluster score. The results are returned as data type DM_ClusResult.
IM Scoring includes results functions that obtain the different results values calculated within the application functions. This section lists and describes these functions. It also includes information about situations where input records contain NULL values; this is in Handling missing values.
Table 11 lists the results functions and describes the value that each function returns when a Clustering model is applied.
| Results function | Purpose |
|---|---|
| DM_getClusterID | Obtains the cluster ID from results data calculated when a Clustering model is applied. This identifies the position of the cluster in the Clustering model that was the best match for this data record. The position of the cluster is a value between 1 and the number of clusters. |
| DM_getClusScore | Obtains the score of the best cluster from results data calculated when a Clustering model is applied. The score is a measure of how closely the data matches the cluster. |
| DM_getQuality | Returns the quality of the best cluster from results data calculated when a Clustering model is applied. The quality is a measure of how well the data fits into the cluster. |
| DM_getQuality(clusterid) | Returns the quality for a specified cluster from results data calculated when a Clustering model is applied. |
| DM_getClusConf | Returns the confidence of attributing a record to the best cluster in comparison with attributing it to another cluster of the applied model. |
Table 12 lists the results functions and describes the value that each function returns when a Classification model is applied.
| Results function | Purpose |
|---|---|
| DM_getPredClass | Obtains the predicted class from results data calculated when a Classification model is applied. This identifies the class within the model to which the data matched. |
| DM_getConfidence | Obtains the classification confidence value from results data calculated when a Classification model is applied. This is a value between 0.0 and 1.0; it measures the probability that the class is predicted correctly. |
Table 13 lists the results functions and describes the value that each function returns when a Regression model is applied.
| Results function | Purpose |
|---|---|
| DM_getPredValue | Obtains the predicted value from results data calculated when a Regression model is applied. This value is calculated according to relations established by the model. |
| DM_getRBFRegionID | Obtains the number of the region from results data calculated when an RBF Regression model is applied. This identifies the region within the model that the record was assigned to. |
To obtain the results of applying a model, you run the appropriate results function, giving the return value of an application function as a parameter. This can be one of the following:
You pass the return value of the application function directly if you use only a single statement. That is, you apply the model and obtain the results value within a single statement. You use the database column name if the results of applying the model were stored in a table.
If you specify a column name, and the column is not configured for the correct results data type, an error occurs. See Table 10 for the relationships between results functions, results data types, and results data.
A results function might return a NULL value. This means that the application function that calculated the result could not determine this value, because the application function received a faulty data record as input. For example, the data record contained too many invalid values for a reasonable result to be returned.
Input records might contain one or more values that are NULL; these are known as missing values. The handling of missing values in IM Scoring depends on the algorithm.
With IBM models, a sophisticated value treatment is used. If a missing value occurs, the record being scored is fed into both child nodes (binary tree) of the tree node requiring the missing value. This process continues until the record reaches a leaf node. Thus, a record is assigned to more than one leaf node. Tree Classification aggregates all these leaf nodes, and DM_getPredClass returns the value assigned to this aggregated node.
IM Scoring provides a memory cache for mining models that improves the performance of scoring runs and allows real-time scoring. Real-time scoring ensures a fast response time for a scoring run of a single input record with an execution time that takes only a few milliseconds. Model caching allows to perform a scoring run in real time if:
Model caching allows to keep models in main memory for subsequent scoring runs. If there is no model cache, the model is deleted from the main memory after the scoring run (using the SELECT statement) has been finished. If a model is permanently stored in memory, a scoring run using this model is faster, because the initial loading and parsing phase can be skipped.
Since the model cache is realized inside the session-specific extproc agent process, there is one model cache for each database session. This agent remains active throughout your Oracle session. When you log off, extproc is terminated by Oracle, and consequently the cache is removed.
Each cache can store up to two models. A model is implicitly loaded into the cache with an apply function if it is not yet in the cache. If the cache is full, the new model automatically replaces an older model in the cache. Models can be removed from the cache at any time if a new model requires cache space.
Use the following stored procedures to control model caching:
A model cache can significantly improve the scoring speed of one or a few records against a model that is already in the cache. This is especially important for large models that need a lot of time for the open phase.
The scoring run can be a bit slower than without cache:
This section describes the interfaces of IM Scoring Java Beans.
To perform the scoring of a data record, you must specify the following input:
When you have specified the necessary input, you can apply scoring and then access the result fields that have been computed.
The functions of IM Scoring Java Beans are implemented as methods of class com.ibm.iminer.scoring.RecordScorer.
\doc\ScoringBean\index.html
After you have installed IM Scoring Java Beans, you must set environment variables before you can use it from Java applications.
For a Java application to invoke RecordScorer, you must do the following:
The xerces.jar package is the XML4J package needed for XML parsing. It is copied into the java directory during the installation of IM Scoring Java Beans. It is possible, however, to use any other implementation of the XML4J specification.
For more information on how to set an environment variable refer to the documentation of your platform. For more information on IM Scoring Java Beans refer to the samples readme.
This section describes how to specify the model.
The RecordScorer class expects the mining model to be stored in one of the following:
public RecordScorer( String modelFile )
throws ModelException, SQLException
public void openModel( String modelFile ) throws ModelException
When a new mining model is set, this model is loaded explicitly into memory. Loading the mining model means reading the PMML file, interpreting the mining model, and preparing everything for scoring. For big mining models, for example, those with a size of more than 50 MB, this operation might take some time. After the mining model has been loaded, the model is kept interpreted in memory. For consecutive scoring calls, the loaded and prepared mining model is used, so that the scoring of a single record needs a response time of less than a second.
When a mining model is set, it remains loaded until one of the following happens:
public RecordScorer(java.sql.Connection connection,
java.lang.String table,
java.lang.String keyColumn,
java.lang.String modelColumn,
java.lang.String modelKey)
throws ModelException, SQLException
The model is expected in the table table (format:
table or schema.table). The table must have at least two columns, keyColumn and modelColumn. The key column is used to select the desired row in the table, the model column contains the model itself. Parameter modelKey denotes the key which is used to select the row that contains
the model.
public synchronized void openModel(java.sql.Connection connection,
java.lang.String table,
java.lang.String keyColumn,
java.lang.String modelColumn,
java.lang.String modelKey)
throws ModelException, SQLExceptionIf openModel is called with the same parameters as in a previous call,
the model is opened again. That is, the model in the record scorer can be
refreshed when the instance in the database has changed.
The exception ModelException is thrown if one of the following happens:
The RecordScorer class provides a set of functions that can be used to access the metadata of the mining model that is specified. These are as follows:
| Function | Function description |
|---|---|
| public String[] getFieldNames() | Returns the names of the mining fields used by the mining model to perform scoring. If no correct model is specified, a String[0] array is returned. |
| public String[] getCategoricalFields() | Returns the names of the categorical mining fields used by the mining model to perform scoring. If no correct model is specified, a String[0] array is returned. |
| public String[] getNumericalFields() | Returns the names of the numerical mining fields used by the mining model to perform scoring. If no correct model is specified, a String[0] array is returned. |
| public boolean
isCategoricalField(String fieldName) |
Returns true if the field specified by fieldName is a categorical mining field. Otherwise, false is returned. |
| public boolean
isNumericalField(String fieldName) |
Returns true if the field specified by fieldName is a numerical mining field. Otherwise, false is returned. |
| public boolean isField(fieldname) | Returns true if the field specified by fieldName is one of the active mining fields. Otherwise, false is returned. |
| public int getModelType() | Returns an integer value that identifies the type of the model that was used. For this, the constant CLUSTERING_TYPE, CLASSIFICATION_TYPE, REGRESSION_TYPE, and UNDEFINED_TYPE are defined in the Scorer class. |
| public int[] getResultIdentifiers() | Returns the identifiers of the result fields that are
relevant for the model type that is set. For this, there are additional constants
defined in the class Scorer:
|
You can represent a data record by a mapping. Here, the names of the fields used in the records are mapped to their actual values. This is exactly the way in which a record is represented in the RecordScorer class. A java.util.Map object is instantiated, and a mapping between field names and values is defined. For example:
HashMap record = new HashMap();
record.put("Horsepower", new Integer(200) );
record.put("Air Bags standard", new Integer(2) );
record.put("City MPG", new Integer(17) );
Note that the values of categorical fields are interpreted as java.util.String, and the values of numerical fields are expected to inherit from java.lang.Number.
IM Scoring Java Beans can be used to score single or multiple data records using a specified mining model. IM Scoring Java Beans is designed to be used for applications where the online scoring of data records is the main task.
A possible application area of IM Scoring Java Beans might be the realization of an Internet-based call center scenario. In this scenario, the required business logic - in this case the scoring functions - runs on a Web or application server. Clients can connect to the server and send to it a data record that was specified by a call-center operator by means of a user interface on the client. The data record is scored on the server, and the result is passed back to the client in real time.
Figure 6 shows a simplified design, illustrating how such a scenario could be realized using IM Scoring Java Beans. Here, IM Scoring Java Beans is integrated into a J2EE implementation using, for example, servlets or Enterprise Java Beans.
For more information refer to Specifying the mining model to be used.
After the mining model and a data record are specified, the score of the data record can be computed. For this purpose, the RecordScorer class provides the following method:
public void score( Map record ) throws RecordException, ModelException
After you have successfully called the score(Map) method, you can access the computed result fields by using one of the following methods:
| Method | Required model type | Default value |
|---|---|---|
| double getClusterID() | Clustering | java.lang.Double.NaN |
| double getClusterScore() | Clustering | java.lang.Double.NaN |
| double getClusterQuality() | Clustering | java.lang.Double.NaN |
| String getPredictedClass() | Classification | NULL |
| double getConfidence() | Classification | java.lang.Double.NaN |
| double getPredictedValue() | Regression | java.lang.Double.NaN |
Depending on the type of mining model that is used, different sets of fields are computed. After you specify a mining model with one of the openModel(...) methods, you can query the type of mining model by using the method public int getModelType(). This method returns an integer value that represents one of the following constants:
With getModelType(), it is possible to determine which of the methods listed in Table 15 can be used to access the computed result fields. If the model type is, for example, Scorer.CLASSIFICATION_TYPE, the scoring result can be accessed with the methods getPredictedClass() and getConfidence(). The use of the method getPredictedValue() in this context, for example, would throw a ResultException. Each of the result methods throws a ResultException whenever the result field and the actual model type do not fit together.
It might be the case that a mining model is specified, but the model is not loaded yet or the score method is not called yet. In this case, the result methods that fit the specified model type return their default values as listed in Table 15.
0 try {
1 RecordScorer scorer = new RecordScorer( "93er_cars.pmml" );
2 int modelType = scorer.getModelType();
3 double predictedValue = getPredictedValue();
4 try {
5 int predictedClass = scorer.getPredictedClass();
6 } catch ( ResultException e ) {
7 // this is an expected exception for illustration purposes
8 }
9 HashMap record = new HashMap();
10 record.put("Horsepower", new Integer(200));
11 record.put("Air Bags standard", new Integer(2) );
12 record.put("City MPG", new Integer(17) );
13 scorer.score( record );
14 predictedValue = scorer. getPredictedValue();
15
16 } catch ( Exception e ) {
17 // should not occur if everything is correct
18 }
First, a new RecordScorer instance is initialized with a Stepwise Polynomial Regression mining model (line 1). The value of modelType in line 2 thus is equal to the value specified by the constant Scorer.REGRESSION_TYPE. For this type of model, a predicted value is expected for each scored record. When the method getPredictedValue() is called in line 3, the actual predicted value is returned. Since the score(Map) method is not called yet, the default value NaN is returned by the method in line 3. When getPredictedClass() is called in line 5, a ResultException is thrown, because the predicted class for the result field does not fit the model type Scorer.REGRESSION_TYPE. In line 9 to 12, the actual data record is defined. There, the field names are mapped to their actual values. In line 13, score(Map) is called and the scoring result is computed. The result of the call to getPredictedValue() in line 14 is a value not equal to NaN, the default value.
The following exception classes are used by the RecordScorer and its base class Scorer:
In addition, the RecordScorer constructor and the openModel method, which read the model from a database table, can throw a:
java.sql.SQLException
This exception provides information on a database access error or other errors.
IM Scoring provides some utility functions that are used together with the scoring functions, for example, to initialize scoring functions, or to control the tracing process. The utility functions are installed in package IDMMX.
| Utility function | Purpose | Page |
|---|---|---|
| DM_initialize | Performs initialization for a user account to enable the application functions for this user. Must be called once per Oracle user. | DM_initialize |
| DM_memoryFree | Clears the model cache, and closes any error files or trace files that are open. | DM_memoryFree |
| DM_printenv | Displays currently defined environment variables and their values. | DM_printenv |
| DM_printModelCache | Displays the names of the models that are currently in the model cache. | DM_printModelCache |
IM Scoring provides a number of user-defined data types. These data types are used to store models and results, and to define the data to which a model is applied.
Most of the new data types (UDTs) are aliases for built-in Oracle data types. These aliases are defined in the package IDMMX, but they are not visible outside the package. These UDTs are logical types explaining the kind of data a UDF needs or returns. Therefore, you must use the source data types if you want to create a table with columns that are associated with these aliases.
However, the UDTs DM_ApplColumn, DM_ApplRow, and DM_LogicalDataSpec are not aliases but object data types. They are defined in the schema IDMTY and are publicly visible. You can use them by qualifying their name with the schema prefix IDMTY.
| Data type (UDT) | Source data type | Purpose | Functions (UDF) |
|---|---|---|---|
| DM_ApplColumn | Object type with elements:
label: VARCHAR2(64) charValue: VARCHAR2(128) numValue: NUMBER |
Contains a label for a field defined in a model and the value of that field for the currently applied data record. charValue and numValue can be used alternatively. It must always be used together with DM_ApplRow. | |
| DM_ApplRow | Object type with elements:
Table of DM_ApplColumn |
Contains a list of DM_ApplColumn objects. Used to collect the DM_ApplColumn objects that contain the application data and to pass them to DM_applData or directly to the application functions. |
Functions: |
| DM_ApplicationData | VARCHAR2 | Distinct type: It contains the definition of data to which a model is applied. |
Functions: |
| DM_ApplicationDataLarge | CLOB | Distinct type: It contains the definition of data to which a model is applied. |
Functions: |
| DM_ClasModel | BLOB | Distinct type: It identifies data within Oracle as a Tree or Neural Classification model. The data type is associated with the model when the model is imported using the DM_impClasFile function. If the model is stored in a database table, the column must be configured for this data type. |
Functions: |
| DM_ClasResult | VARCHAR2 | Distinct type: It contains the predicted class and classification confidence values for a row of data obtained when a Classification model is applied by means of the DM_applyClasModel function. |
Functions: |
| DM_ClusResult | VARCHAR2 | Distinct type: It contains computed cluster ID, score, confidence, and quality for a row of data obtained when a Clustering model is applied by means of the DM_applyClusModel function. |
Functions: |
| DM_ClusteringModel | BLOB | Distinct type: It identifies data within Oracle as a Demographic or Center-based Clustering model. The data type is associated with the model when the model is imported by means of the DM_impClusFile function. If the model is stored in a database table, the column must be configured for this data type. |
Functions: |
| DM_LogicalDataSpec | CLOB | Object type: It identifies the field names and types that are contained in a model and that are needed to apply a model. |
Functions: |
| DM_RegressionModel | BLOB | Distinct type: It identifies data within Oracle as:
|
Functions: |
| DM_RegResult | VARCHAR2 | Distinct type: It contains the predicted value for a row of data obtained when a Regression model is applied by means of the DM_applyRegModel function. For RBF models it also contains the region ID. |
Functions: |
This chapter contains full descriptions of all the IM Scoring functions and stored procedures. They are presented in alphabetical order of the function names.
IM Scoring provides a number of user-defined scoring functions that enable you to:
The scoring functions are installed in the package IDMMX.
For more information refer to Data types reference.
For instructions on how to use the database objects presented here, see Using IM Scoring.
For instructions on how to read the syntax diagrams, see How to read the syntax diagrams.
This function obtains the data to which a model is applied by DM_applyClusModel, DM_applyClasModel, or DM_applyRegModel. It builds a value of type DM_ApplicationData, which includes the label and the value obtained from the column specified in the SQL statement.
This function is available in two different notations. One notation has two parameters; the other has three parameters. Use the two-parameter notation for the inner call in nested calls, or if the application data consists only of one field-value pair.
Two-parameter notation >>-DM_applData--(--label--,--+-character expression-+--)------->< '-numeric expression---'
Three-parameter notation >>-DM_applData--(--application data--,--label--,----------------> >--+-character expression-+--)--------------------------------->< '-numeric expression---'
Label can have a maximum length of 64.
If multiple data items are to be included, multiple nested calls to DM_applData must be made.
The return value is a value of data type DM_ApplicationData.
An example is provided in:
The results produced by applying a model using DM_applyClasModel are returned as data type DM_ClasResult.
If model or application data is NULL, the return value is NULL.
The results produced by applying a model using DM_applyClusModel are returned as data type DM_ClusResult.
If the input model is a Distribution-based Clustering model that does not contain distance units, they are calculated by default for numeric fields. The default value is half of the square root of the variance of the field.
If model or application data is NULL, the return value is NULL.
The results produced by applying a model using DM_applyRegModel are returned as data type DM_RegResult.
If model or application data is NULL, the return value is NULL.
This function returns a character large object representing a PMML Classification model of type DM_ClasModel.
The return value is a character large object representing the PMML Classification model in question. The CLOB XML string is encoded in database encoding (the code set specified when the database was created) regardless of the encoding specification found in the XML content.
This function returns a character large object representing the PMML Clustering model extracted from a value of type DM_ClusteringModel.
The return value is a character large object representing the Clustering model. The CLOB XML string is encoded in database encoding (the code set specified when the database was created) regardless of the encoding specification found in the XML content.
The return value is a CLOB value converted from fields.
This function returns a character large object representing a PMML or XML Regression model of type DM_RegressionModel.
A character large object (CLOB) represents a Regression model, if it is a valid instance of the PMML-based regression DTD according to XML.
The return value is a character large object (CLOB) representing the Regression model. The CLOB XML string is encoded in the code set, which is specified when the database is created, regardless of the encoding specification found in the XML content.
This function returns the classification cost rate of the Classification model computed in a validation phase during the training phase. It uses the validation data specified in the DM_ClasBldTask value (an IM Modeling structured type that defines a modeling task).
The return value is the name of the Classification model as a VARCHAR2 value.
This function returns the DM_LogicalDataSpec value representing the set of fields needed for an application of the Classification model.
The return value is the DM_LogicalDataSpec value representing the set of fields needed for an application of the Classification model.
The return value is the target field name as a VARCHAR2 value.
This function returns the confidence of attributing the record r to the best cluster in comparison with attributing it to another cluster of the applied model. The ID of the best cluster is returned by the function DM_getClusterID.
The confidence is a value between 0 and 1 of type NUMBER. A value near 0 should never appear. A value near 0.5 (50%) means that the record might fit equally well into another cluster of the model. A value near 1 means that it is quite certain that the record belongs to the best cluster. It also means that the record definitely does not suit any other clusters of the model.
The return value is the name of the Clustering model as a VARCHAR2 value.
This function returns the DM_LogicalDataSpec value representing the set of fields needed for an application of the Clustering model.
The return value is the DM_LogicalDataSpec value representing the set of fields needed for an application of the Clustering model.
The return value is the type of the Clustering model as a VARCHAR value. It can be center-based or distribution-based.
This function obtains the Clustering quality from results data that is produced when you apply a Clustering model. The score is an expression of how closely the data matches the model cluster. For Distribution-based Clustering , a score value close to 1.0 indicates a good match. For Center-based Clustering, a score value close to 0.0 indicates a good match.
For more information refer to DM_getQuality.
This function obtains the cluster ID from results data that is produced when you apply a Clustering model. The cluster ID identifies the position of the cluster in the Clustering model that is the best match for this data. For information about the difference between the cluster IDs that are returned by IM Scoring V7.1 and IM Scoring V8.2, see Using the function DM_getClusterID.
Use DM_getClusterName to get the cluster name shown by the IM for Data Clustering Visualizer.
Examples are provided in:
This function returns the name of a cluster at a specified position in a value of type DM_ClusteringModel.
This function obtains the classification confidence value from results data that was produced when you applied a Classification model. This is a value between 0.0 and 1.0 that expresses the probability that the class is predicted correctly.
This function returns the name of a field at a specified position in a value of type DM_LogicalDataSpec.
Examples are provided in:
This function returns the mining field type of a specified field that is contained in a value of type DM_LogicalDataSpec.
The DM_LogicalDataSpec data type contains the set of input fields of a mining model, created by one of the functions DM_getClusMdlSpec, DM_getClasMdlSpec, or DM_getRegMdlSpec. An input field is defined by a name and a type. The type can be either DM_Categorical or DM_Numerical.
| Mining data field type name | Mining field type value | Source data type |
|---|---|---|
| DM_Categorical | 0 | CHAR, VARCHAR2, and ANSI data types that are converted to CHAR or VARCHAR2 |
| DM_Numerical | 1 | NUMBER and ANSI data types that are converted to NUMBER |
The number of fields, as type INTEGER, that are contained in fields.
This function obtains the predicted class from results data that is produced when you apply a Classification model. This identifies the class within the model to which the data matches.
This function obtains the predicted value from results data that is produced when you apply a Regression model. This value is calculated according to relations that are established by the model.
This function returns the quality of attributing the record to the best cluster whose ID is given by the function DM_getClusterID. It measures how well the applied record fits into the best cluster.
The returned value is between 0.0 and 1.0. A value close to 0.0 means that the record does not fit at all in the best cluster. A value close to 1.0 means that the record fits very well in the best cluster. The quality measurement depends on the algorithm used to score the record, so that a direct comparison between the quality of algorithm results is not possible. However, both center-based and distribution-based algorithms use a linear, possibly similar, quality measurement function.
This function returns the quality of the result for a specified cluster. It measures how well the applied record fits into the specified cluster.
The result may not contain a quality measure for all the available clusters. IM Scoring V8 usually computes the quality measure for only the two best matching clusters; it does this in order to optimize the memory needed to store the clustering result.
The returned value is between 0.0 and 1.0. A value close to 0.0 means that the record does not fit at all in the cluster. A value close to 1.0 means that the record fits very well in the specified cluster. The quality measurement depends on the algorithm used to score the record, so that a direct comparison between the quality of algorithm results is not possible. However, both algorithms use a linear, possibly similar, quality measurement function.
This function returns the number of the region to which the record was assigned. The value is returned from results data that is produced when you apply an RBF Regression model.
The return value is the name of the Regression model as a VARCHAR2 value.
This function returns the DM_LogicalDataSpec value representing the set of fields needed for an application of the Regression model. The field names contained in the DM_LogicalDataSpec value are the field names of the DM_LogicalDataSpec value used for building the Regression model.
The return value is the DM_LogicalDataSpec value representing the set of fields needed for an application of the Regression model.
The target field name is returned as a value of type VARCHAR2.
This function converts a data record of type CLOB, CHAR, VARCHAR2, or DM_ApplRow into type DM_ApplicationData.
The data record must be a well-formed XML element. The element must match the DTD declaration of type row below:
<!ELEMENT row (column*) >
<!ELEMENT column (PCDATA) >
<!ATTLIST column
name CDATA #REQUIRED
null (true | false ) "false"
>A value of the attribute name is interpreted as the name of the scoring field. The content of an element is interpreted as the value of the named scoring field. The order of the column elements is not relevant. The data for some fields might be NULL. In this case, it is represented by an element where the attribute null has the value true and the content is empty.
An object of type DM_ApplRow can store an arbitrary number of objects of type DM_ApplColumn. DM_ApplColumn objects store a label of type VARCHAR2, a value of type VARCHAR2, and another value of type NUMBER. The label corresponds to the value of the attribute name in the XML representation. The character value or numeric value (used alternatively) corresponds to the content of the XML element column(PCDATA). DM_ApplRow and DM_ApplColumn are used by calling their constructors as follows:
IDMTY.DM_ApplRow(IDMTY.DM_ApplColumn(<label>, <char value or NULL>,
<numeric value or NULL>),
...
IDMTY.DM_ApplColumn(<label>, <char value or NULL>,
<numeric value or NULL>))If the char value is used in the constructor of DM_ApplColumn, the numeric value must be NULL, and vice versa.
Examples are provided in:
This function converts a data record of type DM_ApplRow into type DM_ApplicationDataLarge.
An object of type DM_ApplRow can store an arbitrary number of objects of type DM_ApplColumn. DM_ApplColumn objects store a label of type VARCHAR2, a value of type VARCHAR2, and another value of type NUMBER. The label corresponds to the value of the attribute name in the XML representation. The character value or numeric value (used alternatively) corresponds to the content of the XML element column (PCDATA). DM_ApplRow and DM_ApplColumn are used by calling their constructors as follows:
IDMTY.DM_ApplRow(IDMTY.DM_ApplColumn(<label>, <char value or NULL>,
<numeric value or NULL>),
...
IDMTY.DM_ApplColumn(<label>, <char value or NULL>,
<numeric value or NULL>))If the char value is used in the constructor of DM_ApplColumn, the numeric value must be NULL, and vice versa.
Here you find more information about the differences between the source data types of DM_ApplicationData and DM_ApplicationDataLarge:
VARCHAR2 strings in SQL functions are limited to a length of 4 KB, the XML string that is returned by DM_impApplData must be shorter than 4 KB.
The returned XML string can be longer than 4 KB. However, DM_impApplDataLarge is slower than DM_impApplData and it requires more additional space in the Oracle data files.
When specifying the apply function, it is recommended that you assemble your SQL statement as follows. If the returned XML string does not exceed 32 KB (which is the limit of the string length of the PL/SQL engine), you can specify the application data without DM_impApplData, for example:
DM_applyClusModel ( model , application data )
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
Examples are provided in:
This function reads a Classification model from a file, and returns it as data of type DM_ClasModel. This data can then be inserted into a table where one of the columns is designated for this data type.
The return value is the imported model as data type DM_ClasModel.
The encoding of characters in the imported file is determined by default. For information about the default encoding rules, see DM_impClasFileE. The call
DM_impClasFile(filename)corresponds to
DM_impClasFileE(filename, NULL)
When the content of the file is read and imported into Oracle, the file is no longer needed. However, you might want to keep the file in case you need to import the model again.
This function reads a Classification model from a file, and returns it as data of type DM_ClasModel. This data can then be inserted into a table where one of the columns is designated for this data type.
The encoding of characters in the imported file is specified by a parameter.
IM Scoring supports different encoding names. The MIME encoding strings are recommended, for example, iso-8859-1.
When the content of the file is read and imported into Oracle, the file is no longer needed. However, you might want to keep the file in case you need to import the model again.
The return value is the imported model as data type DM_ClasModel.
This function converts the Classification model given as CLOB into a Classification model of type DM_ClasModel.
The return value is a Classification model of type DM_ClasModel. If model_as_CLOB is NULL, the return value is NULL.
This function reads a Demographic or Center-based Clustering model from a file, and returns it as data of type DM_ClusteringModel. This data can then be inserted into a table where one of the columns is designated for this data type.
The return value is the imported model as data type DM_ClusteringModel.
If the input model is a Distribution-based Clustering Model that does not contain distance units, they are calculated by default for numeric fields. The default value is half the square root of the variance of the field.
The encoding of characters in the imported file is determined by default. For information about the default encoding rules, see DM_impClusFileE. The call
DM_impClusFile(filename)corresponds to
DM_impClusFileE(filename, NULL)
When the content of the file is read and imported into Oracle, the file is no longer needed. However, you might want to keep the file in case you need to import the model again.
Examples are provided in:
This function reads a Demographic or Center-based Clustering model from a file, and returns it as data of type DM_ClusteringModel. This data can then be inserted into a table where one of the columns is designated for this data type.
The encoding of characters in the imported file is specified by a parameter.
IM Scoring supports different encoding names. The MIME encoding strings are recommended, for example, iso-8859-1.
The return value is the imported model as data type DM_ClusteringModel.
If the input model is a Distribution-based Clustering model that does not contain distance units, they are calculated by default for numeric fields. The default value is half the square root of the variance of the field.
When the content of the file is read and imported into Oracle, the file is no longer needed. However, you might want to keep the file in case you need to import the model again.
Examples are provided in:
This function converts a Clustering model given as a CLOB value into a Clustering model of type DM_ClusteringModel.
The return value is a Clustering model of type DM_ClusteringModel. If model_as_CLOB is NULL, the return value is NULL.
This function converts a CLOB value to a value of type DM_LogicalDataSpec. The CLOB value must be a value that was previously exported using the DM_expDataSpec function.
The return value is fields containing the content of logDataSpec. Any existing definitions in fields are overwritten by the content of logDataSpec.
If logDataSpec is NULL, the return value is NULL.
This function reads an RBF model, a Neural Regression model, a Polynomial Regression model, or a Transform Regression model from a file, and returns it as data of type DM_RegressionModel. This data can then be inserted into a table where one of the columns is designated for this data type.
The return value is the imported model as data type DM_RegressionModel.
The encoding of characters in the imported file is determined by default. For information about the default encoding rules, see DM_impRegFileE . The call
DM_impRegFile(filename)corresponds to
DM_impRegFileE(filename, NULL)
When the content of the file is read and imported into Oracle, the file is no longer needed. However, you might want to keep the file in case you need to import the model again.
This function reads an RBF model, a Neural Regression model, a Polynomial Regression model, or a Transform Regression model from a file, and returns it as data of type DM_RegressionModel. This data can then be inserted into a table where one of the columns is designated for this data type.
The encoding of characters in the imported file is specified by a parameter.
IM Scoring supports different encoding names. The MIME encoding strings are recommended, for example, iso-8859-1.
The return value is the imported model as data type DM_RegressionModel.
When the content of the file is read and imported into Oracle, the file is no longer needed. However, you might want to keep the file in case you need to import the model again.
This function converts a Regression model given as CLOB into a Regression model of type DM_RegressionModel.
The return value is a Regression model of type DM_RegressionModel. If model_as_CLOB is NULL, the return value is NULL.
This function determines whether a DM_LogicalDataSpec value is compatible with another DM_LogicalDataSpec value.
This function obtains the predicted class from results data that is produced when you apply a Classification model. This identifies, within the model, the particular class that matches the data.
>>-IDMMX.PredictClass--(--ModelName--,--+-InputDataAsXMLString-----+--,--return value--)->< '-InputDataAsApplRowObject-'
This function obtains the classification confidence value from results data that is produced when you apply a Classification model. The confidence is a value between 0.0 and 1.0 that expresses the probability that the class is predicted correctly.
>>-IDMMX.PredictClassConf--(--ModelName--,--+-InputDataAsXMLString-----+--,--return value--)->< '-InputDataAsApplRowObject-'
This function obtains the confidence from results data that is produced when you apply a Clustering model. This is a value between 0.0 and 1.0 that expresses the probability that the predicted cluster is the best match against the other clusters.
>>-IDMMX.PredictClusConf--(--ModelName--,--+-InputDataAsXMLString-----+--,--return value--)->< '-InputDataAsApplRowObject-'
This function obtains the cluster ID from results data that is produced when you apply a Clustering model. It identifies the particular cluster in the Clustering model that is the best match for this data.
>>-IDMMX.PredictClusterID--(--ModelName--,--+-InputDataAsXMLString-----+--,--return value--)->< '-InputDataAsApplRowObject-'
This function returns the quality of the result for a given cluster. It measures how good the applied record fits into the given cluster. The returned value is between 0.0 and 1.0. A value close to 0.0 means that the record does not fit at all into the cluster, a value close to 1.0 means that the record fits very well in the given cluster. The quality measurement depends on the algorithm used to score the record, so that a direct comparison between the quality of both clustering algorithm results is not possible. However, both algorithms use a linear, possibly similar quality measurement function.
>>-IDMMX.PredictClusQuality--(--ModelName--,--+-InputDataAsXMLString-----+--,--return value--)->< '-InputDataAsApplRowObject-'
This function obtains the Clustering quality from results data that is produced when you apply a Clustering model. The score is an expression of how closely the data matches the predicted cluster. For Distribution-based Clustering a score value close to 1.0 indicates a good match. For Center-based Clustering a score value close to 0.0 indicates a good match.
>>-IDMMX.PredictClusScore--(--ModelName--,--+-InputDataAsXMLString-----+--,--return value--)->< '-InputDataAsApplRowObject-'
This function obtains the predicted value from results data that is produced when you apply a Regression model. This value is calculated according to relations that are established by the model.
>>-IDMMX.PredictValue--(--ModelName--,--+-InputDataAsXMLString-----+--,--return value--)->< '-InputDataAsApplRowObject-'
This chapter contains full descriptions of all the utilities provided with IM Scoring. They are presented in alphabetical order of the utility names. Data types reference shows which data types are used by functions.
For instructions on how to use the database objects presented here, see Using IM Scoring.
For instructions on how to read the syntax diagrams, see How to read the syntax diagrams.
This function performs the necessary initialization for a user account to enable the application functions for this user. It must be called once for every schema that is used to execute application functions.
If you do not use this function before the first invocation of an application function, the latter displays an error message. The message requests you to call DM_initialize first.
In SQL*Plus you call this function as follows:
execute IDMMX.DM_initialize
This function clears the model cache and closes open files (the error file and optionally the trace file).
The function reports an error if there was no cache to be cleared and no file to be closed. You might want to call this function in the following situations:
This function uses functions of the Oracle package DBMS_OUTPUT to write its output. To display the text in SQL*Plus, you must first call the SQL*Plus command set serverout before you call the DM_printenv function.
set serverout on execute IDMMX.DM_printenv
This function displays the names of the models that are currently in the model cache. The cache holds a maximum of two models.
This function uses functions of the Oracle package DBMS_OUTPUT to write its output. To display the text in SQL*Plus, you must first call the SQL*Plus command set serverout before you call the DM_printModelCache function.
set serverout on execute IDMMX.DM_printModelCache
When you use one of the DM_applXXXModel functions to perform a scoring run, the model passed to this function must be first parsed and analyzed. This must happen before the input data records can be applied to the model. The model-parsing step can be time consuming. For this reason, the parsed model is saved in a cache to be reusable in subsequent SQL statements that use the same model. The cache can hold up to two models. The cache is cleared when the database session ends, or when the user explicitly calls DM_memoryFree. A situation might arise where a model that is not in the cache is used in a DM_applyXXXModel function and the cache is full. In this case, one of the models in the cache is replaced by the new model.
This function sets or resets environment variables for scoring functions.
Currently, this function sets or resets only the environment variables that control error handling and the tracing process. These environment variables are stored in the database; they are not visible in the environment of your operating system. These environment variables are global to all users of the scoring functions; all users share the same set of these variables. See Getting trace information for more details.
Currently this parameter accepts only variable names that control error handling and the tracing process.
See Getting trace information for details about the use of these environment variables.
For the IDM_MX_TRACEFILE environment variable you can specify:
For the IDM_MX_TRACELEVEL environment variable you can specify:
See Getting trace information for details about these variable values.
For the IDM_MX_ERRORFILE environment variable you can specify:
In SQL*Plus you can call this function as:
execute IDMMX.DM_setEnv('variablename','variablevalue')
This chapter contains full descriptions of the commands provided with IM Scoring. Use these commands to:
See The idmxmod command.
See The idmmkSQL command.
See The idmlicm command.
See The idmlevel command.
You can find these commands in the bin directory of your IM Scoring installation.
To execute the script, you must be able to log in to Oracle via SQL*Plus. It performs most of its operations as user SYS, so it asks for the password of SYS in the beginning. Afterwards, it creates several database objects that implement the IM Scoring functionality. The output from the executed commands is displayed and also written to a log file, setup.log. After executing the script, enter exit to leave SQL*Plus.
The idm_setup utility creates two new schemas in the database, as follows:
If you want to prevent regular users from directly connecting to one of these schemas, you should lock the schemas.
You can change the names of some of the database objects that are created. To do this, edit the file idm_setvars.sql before you call idm_setup, but this is recommended only if there are name conflicts with existing database objects. The script idm_setup enables the default database, that is, the database you log in to without specifying an explicit database name. If you want to enable other databases, change the environment variable ORACLE_SID accordingly before you call idm_setup.
A database that has been enabled for IM Scoring by means of idm_setup can be disabled again by running the SQL script idm_uninstall.sql. The script removes all of the database objects that have been created by idm_setup.
To use the idm_uninstall command:
@idm_uninstall
Before you call the command above, you must change to the bin directory of the IM Scoring installation where the script idm_uninstall.sql is located.
The script idm_uninstall disables the default database, that is, the database you log in to without specifying an explicit database name. If you want to disable other databases, change the environment variable ORACLE_SID accordingly before you call SQL*Plus.
Use the command idmlevel to collect information about the software environment (operating system) and IM product version you are using.
idmlevel c:\imscoring.log
idmlevel
More examples are provided in:
Use the idmlicm command to check your license status. IM Scoring uses nodelocked license keys installed in a license file. The full product contains production license keys, which are installed during installation. The 'Try and Buy' version does not include a production license key. You can use the idmlicm command to generate a 'Try and Buy' license key.
The idmlicm command is located in the bin directory. It has no parameters. When invoked, idmlicm checks the license status.
The license for the product "DB2 Intelligent Miner Scoring"
was found in the file "nodelock_sc".
If no production license is installed, idmlicm can generate a temporary license key the first time it is invoked.
W 2771: You are now using a temporary license. You need to enroll "DB2 Intelligent Miner Scoring" within "89" days in the license file "d:\IMinerX\bin\nodelock_sc".
If you invoke idmlicm when a temporary license is already installed, you get the following sample output:
W 2772: The number of days left is "89". You are still using a temporary license. You need to enroll "DB2 Intelligent Miner Scoring" in the license file "d:\IMinerX\bin\nodelock_sc".
The command idmmkSQL analyzes a PMML model, and generates from it a template SQL script that contains the SQL statements necessary to perform a scoring run using the model. It contains placeholders that you replace with the names of concrete database objects in order to finally get the executable SQL script.
If PMML files in the file system are processed, default values are used for tables in which mining models are to be stored. However, you can specify another table to store your models by replacing the following strings:
In the following example the Oracle SQL template theScriptFile.sql is generated using the PMML file thePMMLFile.pmml. The SQL template uses the CONCAT method to build the input records. The encoding of the generated SQL script is iso-8859-1:
idmmkSQL -D ORACLE -M Concat -E iso-8859-1 thePMMLFile.pmml theScriptFile.sql
More examples are provided in:
You can convert a model outside IM for Data from Intelligent Miner format to PMML 2.1 format by using the idmxmod command.
If an error occurs during a scoring run, an error message is displayed.
See DB2 Intelligent Miner Modeling, DB2 Intelligent Miner Scoring: Messages for a list of error messages with explanations of their meanings, and indications about what action you should take.
Errors are logged by default in the file idmMxError.log together with identifiers and time stamps.
When the file gets too large, you must delete it.
You can change the error file name and directory by setting the environment variable IDM_MX_ERRORFILE to the name of an alternative error file. The file name must be given as an absolute path name. The environment variable can be set by means of the function DM_setEnv. To do this, call SQL*Plus and connect to the database. Use any existing user name. Then use the following commands as required. Note that strings are case-sensitive.
execute IDMMX.DM_setEnv('IDM_MX_ERRORFILE', '/tmp/myError.log') execute IDMMX.DM_setEnv('IDM_MX_ERRORFILE', NULL)
execute IDMMX.DM_setEnv('IDM_MX_ERRORFILE', 'NONE')
Before you contact IBM for support, check the information in the release.txt file that comes with the product. It can be found in the installation directory.
To find the latest information about IM Scoring access the Intelligent Miner Web site.
When you contact IBM for support, prepare to answer the questions in the problem identification worksheet. Make yourself familiar with the instructions on how to collect trace information given at Getting trace information.
The IBM Software Support Guide contains the following problem identification worksheet.
Answer the questions in the worksheet before contacting IBM support.
PROBLEM IDENTIFICATION WORKSHEET
Complete this form before calling Technical Support
This form helps you identify problems and assists IBM Technical Support in
finding solutions.
System Information
What is the failing product? _______________________________________________
What is the version and release number?_____________________________________
What machine model, operating system, and version are running?______________
Problem Description
What are the expected results?______________________________________________
What statement or command is being used? ___________________________________
What are the exact symptoms and syntax? ____________________________________
____________________________________________________________________________
What is or isn't happening, including exact error number and message text?
____________________________________________________________________________
____________________________________________________________________________
Is anyone else experiencing the problem? ___________________________________
Is this the first time this operation has been attempted? __________________
Is this the first time this problem has occurred?___________________________
Environment
When did this activity work last? __________________________________________
What has changed since the activity last worked? ___________________________
_____ Hardware type/model _____ Application
_____ Operating system/version _____ Level of usage
_____ New product version/release _____ Maintenance applied
If the problem does not occur every time, under what conditions does the
problem not occur?
____________________________________________________________________________
____________________________________________________________________________
Is there any other software running on the system which may be conflicting
with this product?
____________________________________________________________________________
____________________________________________________________________________
Problem Isolation
Identify the specific feature of the software causing the problem.__________
____________________________________________________________________________
Can the problem be reproduced? If so, please provide a reproducible test case
or instructions on how to reproduce the error condition.____________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________________________________________________
Use the command idmlevel to collect information about the software environment (operating system, version) and IM product version you are using.
For more information on using this command on Windows or UNIX operating systems refer to The idmlevel command.
The trace facility in IM Scoring helps IBM to locate an error by writing information about an error situation to a file. This information consists of trace messages.
The trace facility is configured by means of two environment variables. These are as follows:
IDM_MX_TRACELEVEL determines the filtering of trace messages. IDM_MX_TRACELEVEL is effectively an on/off switch for tracing.
Since trace messages are controlled by means of environment variables, concurrent mining runs write to the same trace file.
The trace message that is written to the trace file consists of the following information:
The basic system information is written once per trace.
You can configure tracing by using special commands in your SQL*Plus session. To issue these commands, call SQL*Plus and connect to the database. Use any existing user name. Then use the following commands as required. Note that strings are case sensitive.
execute IDMMX.DM_setEnv('IDM_MX_TRACELEVEL', 'ALL')
The default log file resides in the directory that is specified by the TEMP environment variable.
execute IDMMX.DM_setEnv('IDM_MX_TRACEFILE', 'filename')
where filename is the name of the
file holding the trace information. filename must
include the absolute path name.
execute IDMMX.DM_setEnv('IDM_MX_TRACEFILE', 'NULL')
execute IDMMX.DM_setEnv('IDM_MX_TRACELEVEL', 'MINIMUM')
set serverout on execute IDMMX.DM_printenv
This shows the values of all variables defined by IDMMX.DM_setEnv(). Note that set serverout on need to be entered only once per session.
Changes to the variables IDM_MX_TRACEFILE and IDM_MX_TRACELEVEL become immediately effective. Scoring function calls following a change consider the new values. In addition, changes to these variables are global to all users of the scoring services. A change affects other users and is visible to other users.
Use the DM_setEnv method to trace errors:
execute IDMMX.DM_setEnv('IDM_MX_TRACELEVEL','ALL') execute IDMMX.DM_setEnv('IDM_MX_TRACELEVEL','')If you want to migrate from IM Scoring V7.1 to IM Scoring V8.2, in general you can start working with IM Scoring V8.2 after performing the following steps:
However, you must use a different database for each product, because you can enable a database for only one product at the same time.
IM Scoring V8.2 stores models in a compressed format in a database, however, it can also work with the uncompressed format that was used for IM Scoring V7.1.
However, if you want to save disk space, you can simply compress the models by using the export and import UDFs that are provided. These UDFs are:
DM_expClasModel DM_impClasModel DM_expClusModel DM_impClusModel DM_expRegModel DM_impRegModel
You can also compress the models by using a sample script, which is available in the directory samples/ScoringOracle. You can directly use the sample if your models are stored in the tables that are provided. These tables are as follows:
If you use tables that are different from these, you must adapt the sample to your needs before you execute it.
To execute the sample:
Center-based Clustering models, Neural Classification models, and Neural Regression models that were imported by IM Scoring V7.1 can no longer be applied by IM Scoring V8.2.
If the models are still available as results in IM for Data, drop them from your tables, and import them again.
If you use the function DM_getClusterID on a DM_ClusResult value that was returned when a Clustering model was applied, the values will differ from those returned by IM Scoring:
To get the mapping between cluster IDs and cluster names, use the DM_getClusters function on the Clustering model.
If you want to migrate from IM Scoring V8.1 to IM Scoring V8.2, in general you can start working with IM Scoring V8.2 after performing the following steps:
PMML is a markup language for data mining. Based on XML, PMML provides a standard that enables data mining models to be shared between the applications of different vendors. It provides a vendor-independent method of defining models. It allows you to exchange models between applications.
You can find more information about PMML on the Web site of the Data Mining Group (DMG).
Here you find information on how IM Scoring conforms to the PMML standard. The following naming conventions of the PMML standard are used:
IM Scoring provides an SQL interface enabling the application of PMML models to data.
For this feature, IM Scoring complies with the PMML consumer conformance clause of the PMML standard for several algorithms. These algorithms are listed below with possible restrictions for their consumer conformance to PMML.
IM Scoring delivers conversion tools that enable models in IM for Data format to be converted to PMML.
IM Scoring conversion tools comply with the PMML producer conformance clause of the PMML standard for center-based clustering, decision trees, neural networks, and regression.
IM Scoring conversion tools also comply with the PMML producer conformance clause of the PMML standard for distribution-based clustering when value weighting was not used to create the model. (For information, see the documentation for IM for Data.) However, if value weighting was used, IM Scoring conversion tools produce non-conforming PMML models with a specific extension for value weighting. This extension can be read only by IM Scoring, which will use value weighting when scoring data on these models. Other PMML consumer tools, however, will ignore the extension, though they will read the model successfully. They will not consider value weighting when scoring data on these models.
IM Scoring conversion tools additionally comply with the PMML producer conformance clause of the PMML standard for association rules. However, taxonomies and name mappings that might have been used to create the models are not written into PMML 2.1.
IM Scoring supports Radial-Basis Function (RBF) prediction and Transform Regression. However, RBF prediction and Transform Regression are not yet part of PMML, and therefore cannot comply with the producer or consumer conformance clause. The RBF prediction models or the Transform Regression models written by IM Scoring conversion tools and used in the IM Scoring application have an XML proprietary format that is very similar to the other PMML formats.
Refer to Table 3 for an overview of all algorithms that are supported.
The following features are supported in addition to PMML 2.1 for interoperability reasons:
Models generated by SAS Enterprise Miner V5.1 (abbreviated to SAS EM in this book) can be used with IM Scoring. The following algorithms are supported: Tree (PROC ARBOR), Regression (PROC DMREG), center-based Clustering (PROC DMVQ), and Neural Networks (PROC NEURAL). You do not need any special options for these models.
For more information refer to the SAS Enterprise Miner V5.1 documentation.
SPSS Clementine V8.5 offers a compatibility mode for generating PMML that can be used with IM Scoring. To activate this option in SPSS Clementine, from the Tools menu select User Options... and set the options as shown in Figure 7.
If you have set the user options as shown in Figure 7, the models exported from SPSS Clementine as PMML can be imported into IM Scoring.
The following algorithms are supported:
To solve this problem rebuild the model, either by scanning the whole dataset in SPSS Clementine or by specifying the correct data type of the respective field manually. This can also happen if the training set only consists of integers, but the floating point decimals are inserted during application.
For more information refer to the SPSS Clementine V8.5 documentation.
When you create an Oracle database, you must specify the database character set. See the release.txt file for the latest information about which of the Oracle character sets can be used together with IM Scoring.
You might want to create a new database in a multilanguage environment and enable this database for the scoring functions. In this case, it is recommended that you create this database using the Unicode character encoding. In a Unicode-enabled database, Oracle supports the following character encoding scheme: UTF-8, that is, the UCS (Universal Character Set) Transformation Format.
If one of the following PMML models are exported by using the IM Scoring export functions, the XML declaration in the PMML model contains an encoding specification:
For some operation systems and locale combinations, for example, Japanese on AIX, the encoding name used is specific to the International components for Unicode.
For example, for Japanese models generated on AIX, the XML declaration might look like this:
<?xml version="1.0" encoding="ibm-942_P120_2000" ?> <PMML version="2.1">
When you exchange these models as a file with other products that can read the PMML format, these products might not support these encoding names.
You can solve the problem by manually editing the PMML model and changing the encoding name to a compatible name supported by your product.
For example:
<?xml version="1.0" encoding="ibm-942" ?> <PMML version="2.1">
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:
UNIX is a registered trademark of The Open Group in the United States and other countries.
Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both.
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.
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 or Oracle publications that are relevant to the contents of this book, and non-IBM publications that might be useful for reference purposes.
To download patches, go to the SUN Solaris home page
\doc\ScoringBean\index.html