Oracle9i Data Mining Concepts Release 2 (9.2) Part Number A95961-01 |
|
The sample programs for ODM consist of Java classes and property files, along with the data required to run the programs. There are also scripts to compile and execute the sample programs. The sample programs and how to compile and execute them are briefly described in this appendix. The data used by the sample programs is installed when you install ODM.
After ODM is installed on your system, the sample programs, property files, and scripts are in the directory $ORACLE_HOME/dm/demo/sample
; t
he data used by the sample programs is in the directory $ORACLE_HOME/dm/demo/data
. The data required by the sample programs is also installed in the ODM_MTR
schema.
This appendix does not include a detailed description of the ODM API classes and methods. For detailed information about the ODM API, see the ODM Javadoc in the directory $ORACLE_HOME/dm/doc
on any system where ODM is installed.
ODM sample programs are provided to illustrate the features of ODM.
The sample programs, except for the "short" sample programs, use property files to specify values that control program execution. Each program has at least one property file; most sample programs have an (input) data set. There is also one special property file, Sample_Global.property
, that is used to specify the characteristics of the environment in which the programs run. The rest of this section lists the ODM sample programs, arranged according to the ODM features that they illustrate.
The following sample programs are the programs that are discussed in detail in Chapter 3:
Neither of these sample programs uses either a property file or Sample_Global.property
.
The following sample programs illustrate building a Decision Tree (Adaptive Bayes Network) Model, calculating lift for the model and testing it, and applying the model:
Sample_AdaptiveBayesNetworkBuild.java
Sample_AdaptiveBayesNetworkLiftAndTest.java
Sample_AdaptiveBayesNetworkApply.java
The following programs illustrate building a Naive Bayes Model, calculating lift for the model and testing it, applying the model, and cross validating the model:
Sample_NaiveBayesBuild.java
Sample_NaiveBayesLiftAndTest.java
Sample_NaiveBayesApply.java
Sample_NaiveBayesCrossValidate.java
The following sample program illustrates how to use Model Seeker to identify a "best" model:
The following sample programs illustrate building a clustering model and applying it:
The following sample program illustrates building an Association Rules model:
Sample_AssociationRules.java
The property file depends on the format of the data:
The following sample programs illustrate importing and exporting PMML Models:
The following sample programs illustrate how to build and attributes importance model and use the results to build another model:
The following sample programs show to discretize (bin) data by creating a bin boundaries table and how to use the bin boundaries table:
This section provides a brief description of how to compile and execute the ODM sample programs. There are two cases:
Sample_NaiveBayesBuild_short.java
and Sample_NaiveBayesApply_short.java
Follow these steps to compile and execute the programs Sample_NaiveBayesBuild_short.java
and Sample_NaiveBayesApply_short.java
:
ORACLE_HOME
environment variable setup.
ODM depends on the following Oracle9i Java Archive files; ensure that they are in your CLASSPATH
:
$ORACLE_HOME/jdbc/lib/classes12.jar $ORACLE_HOME/lib/xmlparserv2.jar $ORACLE_HOME/rdbms/jlib/jmscommon.jar $ORACLE_HOME/rdbms/jlib/aqapi.jar $ORACLE_HOME/rdbms/jlib/xsu12.jar $ORACLE_HOME/dm/lib/odmapi.jar
You may also need to include
$ORACLE_HOME/jdbc/lib/nls_charset12.zip
in your CLASSPATH. See Section 2.1 for details.
odm_mtr
. If the default name is not correct for your installation, replace the schema name in the program.JAVA_HOME
environment variable setup.To specify the data mining server, substitute appropriate values for the italicized items in the following line:
dms = new DataMiningServer(DB_URL
,user_name
,password
);
To specify location access data, substitute appropriate values for the italicized items in the following line:
LocationAccessData("CENSUS_2D_BUILD_UNBINNED", schema_name
);
For Sample_NaiveBayesApply_short.java
, you must also specify a location for the output table; substitute appropriate values for the italicized item in the following line:
LocationAccessData ladOutput =
new LocationAccessData("CENSUS_NB_APPLY_RESULT", output_schema_name
)
exec odm_start_monitor
Follow these steps to compile all of the sample programs that use Sample_Global.property
:
ORACLE_HOME
environment variable setup.
ODM depends on the following Oracle9i Java Archive files; ensure that they are in your CLASSPATH
:
$ORACLE_HOME/jdbc/lib/classes12.jar $ORACLE_HOME/lib/xmlparserv2.jar $ORACLE_HOME/rdbms/jlib/jmscommon.jar $ORACLE_HOME/rdbms/jlib/aqapi.jar $ORACLE_HOME/rdbms/jlib/xsu12.jar $ORACLE_HOME/dm/lib/odmapi.jar
You may also need to include
$ORACLE_HOME/jdbc/lib/nls_charset12.zip
in your CLASSPATH. See Section 2.1 for details.
Sample_Global.property
file to replace generic placeholders with the details for your database installation. Mining Server details must point to the schema where the Mining Server is installed on your system.
You must replace the following tags: MyHost
, MyPort
, MySid
(the SERVICE_NAME for your database), MyName
(the default is ODM
), and MyPW
(the default is ODM
).
For example:
miningServer.url=jdbc:oracle:thin:@odmserver.company.com:orcl:1521 miningServer.userName=odm miningServer.password=odm inputDataSchemaName=odm_mtr outputSchemaName=odm_mtr
odm_mtr
. If the default name is not correct for your installation, replace the schema name in Sample_Global.property
.JAVA_HOME
environment variable setup.ModelSeeker.java
, you should edit Sample_ModelSeeker.property
./usr/bin/sh compileSampleCode.sh
program-name
For example, to compile Sample_ModelSeeker.java
, type
/usr/bin/sh compileSampleCode.sh Sample_ModelSeeker.java
compileSampleCode.bat program-name
For example, to compile Sample_ModelSeeker.java
, type
compileSampleCode.bat Sample_ModelSeeker.java
exec odm_start_monitor
executeSampleCode.batclassname
[property_ file
]
For example, to execute Sample_ModelSeeker.java
with the property file myFile.property
, type
executeSampleCode.bat Sample_ModelSeeker myFile.property
|
Copyright © 2002 Oracle Corporation. All Rights Reserved. |
|