ORACLE Data Mining v Included with ORACLE 10





















- Slides: 21
ORACLE Data Mining v Included with ORACLE 10 g v Freely available for UVic and for personal unlimited evaluation use. Choose the enterprise version! 1
Creating a data mining user v A data mining user is a canonical user, but with a few more privileges than usual. v As ‘system’ create a canonical user: CREATE USER dmuser 1 IDENTIFIED BY dmpsw DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp QUOTA UNLIMITED on users; v Then, grant privileges to this user: q q q q q GRANT GRANT GRANT create procedure to DMUSER 1; create session to DMUSER 1; create table to DMUSER 1; create sequence to DMUSER 1; Now, DMUSER 1 create view to DMUSER 1; is ready to create job to DMUSER 1; perform data create type to DMUSER 1; mining tasks. create synonym to DMUSER 1; execute on ctxsys. ctx_ddl to DMUSER 1; 2
‘sh’ user v To use the examples you have to activate the sh user. q There are the example data v Created during ORACLE installation. v However, it’s not active. v To activate: Open Oracle Enterprise Manager. Login as ‘system’. Go to ‘administration’ tab, then click on users, find the ‘sh’ user and activate it. 3
Using the data of ‘sh’ v Connect (login) as sh and grant SELECT privilege to dmuser 1 for these tables: q q q COUNTRIES CUSTOMERS PRODUCTS SUPPLEMENTARY_DEMOGRAPHICS SALES v In other words execute: GRANT SELECT dmuser 1; q GRANT SELECT q q ON ON customers TO dmuser 1; sales TO dmuser 1; products TO dmuser 1; supplementary_demographics TO ON countries TO dmuser 1; v Now, dmuser 1 is able to execute SELECT on these tables, and create views on them. 4
DMUSER 1: Creating views on ‘sh’ data CREATE VIEW mining_data_build_v AS SELECT a. CUST_ID, a. CUST_GENDER, 2003 -a. CUST_YEAR_OF_BIRTH AGE, a. CUST_MARITAL_STATUS, c. COUNTRY_NAME, a. CUST_INCOME_LEVEL, b. EDUCATION, b. OCCUPATION, b. HOUSEHOLD_SIZE, b. YRS_RESIDENCE, b. AFFINITY_CARD, b. BULK_PACK_DISKETTES, b. FLAT_PANEL_MONITOR, b. HOME_THEATER_PACKAGE, b. BOOKKEEPING_APPLICATION, b. PRINTER_SUPPLIES, b. Y_BOX_GAMES, b. OS_DOC_SET_KANJI FROM sh. customers a, sh. supplementary_demographics b, sh. countries c WHERE a. CUST_ID = b. CUST_ID AND a. country_id = c. country_id AND a. cust_id between 101501 and 103000; v You can find other view creation statements in dmsh. sql that will be in the web. 5
Oracle Data Miner GUI v It’s a Java application. Connects through JDBC to the ORACLE database. v Installed in SENG Windows lab. v Can also be freely downloaded from Oracle. 6
Connecting 7
The Problem v An electronics store chain wants to distribute a discount card to its customers, but only to those customers who are expected to increase their buying (and thus the company’s revenue) because of this card. v A test campaign was run on a sample of customers and the results were compiled into a table containing the customer demographics, purchasing patterns, and a measure of revenue produced by each customer. 8
Structure 9
A fragment of data 10
Getting a feeling about the data 11
Build a classifier I 12
Build a classifier II 13
Build a classifier III 14
Build a classifier IV I am selecting this 15
Build a classifier V 16
Build a classifier VI 17
Build a classifier VII 18
Build a classifier VIII P(A=1|…) will be used for sorting tuples, as opposed to P(A=0|…). 19
Build a classifier IX 20
Build a classifier X 21