contents at a glanceoracle-regular / predictive analytics using oracle data miner / brendan tierney...

9
Contents at a Glance PART I Oracle Data Miner Fundamentals 1 Oracle Data Miner 3 2 The Predictive Modeling Lifecycle 23 3 How to Install, Set Up, and Get Started 37 PART II Using the Oracle Data Miner Tool 4 ODM Menus, Projects, and Workflows 51 5 Exploring Your Data 67 6 Data Preparation 87 7 Association Rule Analysis 113 8 Classification 135 9 Clustering 161 10 Regression 187 11 Anomaly Detection 215 PART III Data Mining Using SQL and PL/SQL 12 The ODM Data Dictionary, SQL, and PL/SQL Packages 233 13 Data Preparation 253 v

Upload: others

Post on 23-Mar-2020

16 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Contents at a GlanceOracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8 Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan

Contents at a Glance

PART IOracle Data Miner Fundamentals

1 Oracle Data Miner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 The Predictive Modeling Lifecycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

3 How to Install, Set Up, and Get Started . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

PART IIUsing the Oracle Data Miner Tool

4 ODM Menus, Projects, and Workflows . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

5 Exploring Your Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

6 Data Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

7 Association Rule Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

8 Classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135

9 Clustering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161

10 Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187

11 Anomaly Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215

PART IIIData Mining Using SQL and PL/SQL

12 The ODM Data Dictionary, SQL, and PL/SQL Packages . . . . . . . . . . . . . . . 233

13 Data Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253

Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8 / Blind folio: v

v

00-FM.indd 5 6/18/14 2:34 PM

Page 2: Contents at a GlanceOracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8 Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan

Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8 Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8 Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8

vi Predictive Analytics Using Oracle Data Miner

14 Association Rule Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279

15 Classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293

16 Clustering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317

17 Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343

18 Anomaly Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369

PART IVMigration and Implementations

19 How to Migrate Your ODM Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385

20 Implementation-Related Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419

00-FM.indd 6 6/18/14 2:34 PM

Page 3: Contents at a GlanceOracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8 Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan

Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8 Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8 Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8

Contents

Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviiIntroduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix

PART IOracle Data Miner Fundamentals

1 Oracle Data Miner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3In-Database Data Mining with Oracle Data Mining . . . . . . . . . . . . . . . . . . . 5Oracle Advanced Analytics Option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Oracle Data Mining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Oracle R Enterprise (ORE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

History of Data Mining in Oracle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10Oracle Data Mining Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

Oracle Data Mining Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Oracle Data Miner GUI Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14Oracle Data Mining Using SQL and PL/SQL . . . . . . . . . . . . . . . . . . . 15

Oracle Statistical Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17Applications Powered by Oracle Data Mining . . . . . . . . . . . . . . . . . . . . . . . 18How Are Customers Using Oracle Advanced Analytics . . . . . . . . . . . . . . . . 19

Customer Success Stories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

2 The Predictive Modeling Lifecycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23Predictive Modeling Lifecycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

Knowledge Discovery in Data (KDD) Process . . . . . . . . . . . . . . . . . . 24SEMMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

CRISP-DM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26Business Understanding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29Data Understanding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29Data Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

vii

00-FM.indd 7 6/18/14 2:34 PM

Page 4: Contents at a GlanceOracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8 Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan

Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8 Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8

viii Predictive Analytics Using Oracle Data Miner

Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

3 How to Install, Set Up, and Get Started . . . . . . . . . . . . . . . . . . . . . . . . . . . 37Enabling the Oracle Advanced Analytics Option . . . . . . . . . . . . . . . . . . . . . 38Creating a Data Mining Tablespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39Creating an ODM Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39Creating a Connection for Your DM User in SQL Developer . . . . . . . . . . . . 40Creating the Oracle Data Mining Repository . . . . . . . . . . . . . . . . . . . . . . . . 41

Using SQL Developer to Create the ODM Repository . . . . . . . . . . . . 42Using SQL Scripts to Create the ODM Repository . . . . . . . . . . . . . . . 44

Setting Up Additional Users to Access ODM . . . . . . . . . . . . . . . . . . . . . . . . 44ODM Schema System Privileges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46Setting Up and Using the Pre-built Database Appliance . . . . . . . . . . . . . . . . 47Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

PART IIUsing the Oracle Data Miner Tool

4 ODM Menus, Projects, and Workflows . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51The ODM Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52Creating a Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53Creating, Exporting, and Importing a Workflow . . . . . . . . . . . . . . . . . . . . . . 54

Creating a Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55Exporting a Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55Importing a Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

Adjusting the Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59The ODM Workflow Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60The Components Workflow Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

5 Exploring Your Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67Gathering Statistics and Exploring Your Data . . . . . . . . . . . . . . . . . . . . . . . . 68Adding a Data Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

Data Source Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69The Explore Data Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

Building Up a Story About the Data . . . . . . . . . . . . . . . . . . . . . . . . . 74Exploring the Data Based on Attribute Grouping . . . . . . . . . . . . . . . . 77

Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78Creating a Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

SQL Query Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81Feature Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

00-FM.indd 8 6/18/14 2:34 PM

Page 5: Contents at a GlanceOracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8 Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan

Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8 Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8

Contents ix

6 Data Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87Aggregate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

Using the Aggregation Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89Adding a New Aggregation-Level Attribute . . . . . . . . . . . . . . . . . . . . 92Adding an Aggregation Expression . . . . . . . . . . . . . . . . . . . . . . . . . . 95

Filter Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97Filter Columns Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98Filter Rows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100Join . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101Sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105Transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109Automatic Data Preparation (ADP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112

7 Association Rule Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113What Is Association Rule Analysis? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114Association Rule Analysis in Oracle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116Building Association Rules Using ODM . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116Defining the Data Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117Creating the Association Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119

Model Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121Association Node Properties Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122

Viewing the Association Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123Generated Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124Generated Itemsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125

Adding a Data Source Node for Transaction Descriptions . . . . . . . . . . . . . . 126Applying Filters to the Association Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . 129Outputting and Persisting the Association Rules . . . . . . . . . . . . . . . . . . . . . . 131Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134

8 Classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135What Is Classification? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136Classification Methods Available in Oracle . . . . . . . . . . . . . . . . . . . . . . . . . 138Building Classification Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138

Model Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140Property Inspector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146Using Different Build and Test Data Sets . . . . . . . . . . . . . . . . . . . . . . 147Creating Additional Models and Removing Unwanted Models . . . . . 149

Generating the Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150Evaluating the Classification Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151

Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151Performance Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152

00-FM.indd 9 6/18/14 2:34 PM

Page 6: Contents at a GlanceOracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8 Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan

Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8 Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8

x Predictive Analytics Using Oracle Data Miner

ROC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153Lift . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154Profit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156

Applying a Classification Model to New Data . . . . . . . . . . . . . . . . . . . . . . . 158Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160

9 Clustering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161What Is Clustering? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162Clustering Methods Available in Oracle . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163Building Clustering Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165

Model Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167Property Inspector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172Creating Additional Models and Removing Unwanted Models . . . . . 173

Generating the Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174Evaluating the Classification Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175

View Your Cluster Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175Cluster Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177Comparing Clusters: Multicluster-Multivariable Comparison . . . . . . . 180Renaming Clusters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182

Applying a Clustering Model to New Data . . . . . . . . . . . . . . . . . . . . . . . . . . 183Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185

10 Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187What Is Regression? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188Regression Methods Available in Oracle . . . . . . . . . . . . . . . . . . . . . . . . . . . 190Preparing Your Data for Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191Building Regression Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193

Regression Model Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194Property Inspector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199

Generating the Regression Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200Viewing the Regression Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201Regression Model Test Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206Applying a Regression Model to New Data . . . . . . . . . . . . . . . . . . . . . . . . . 209Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213

11 Anomaly Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215What Is Anomaly Detection? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216Anomaly Detection in Oracle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217Building an Anomaly Detection Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217

Model Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219Property Inspector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222Generating the Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223

00-FM.indd 10 6/18/14 2:34 PM

Page 7: Contents at a GlanceOracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8 Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan

Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8 Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8

Contents xi

Evaluating the Anomaly Detection Model . . . . . . . . . . . . . . . . . . . . . . . . . . 224Applying the Model to Your Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230

PART IIIData Mining Using SQL and PL/SQL

12 The ODM Data Dictionary, SQL, and PL/SQL Packages . . . . . . . . . . . . . . . 233ODM Data Dictionary Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234ODM SQL Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236ODM PL/SQL Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238

DBMS_DATA_MINING PL/SQL Package . . . . . . . . . . . . . . . . . . . . . . . . 239DBMS_PREDICTIVE_ANALYTICS PL/SQL Package . . . . . . . . . . . . . . 242

Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252

13 Data Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253Data Preparation for Data Mining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254

Data Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254Data Aggregation and Pivoting the Data . . . . . . . . . . . . . . . . . . . . . . 256Handling Missing Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258Histograms and Binning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259Creating a Target Variable/Attribute . . . . . . . . . . . . . . . . . . . . . . . . . . 261

Automatic Data Preparation in ODM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262ADP with Transformation Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262

Using DBMS_DATA_MINING_TRANSFORM PL/SQL Package . . . . . . . . . . . . . . 264List of Package Procedures and Functions . . . . . . . . . . . . . . . . . . . . . 266Example of Using the

DBMS_DATA_MINING_TRANSFORM Package . . . . . . . . . . . . . . . . . 268Embedding Transformation List into the Model . . . . . . . . . . . . . . . . . . . . . . . 275Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278

14 Association Rule Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279Setting Up Your Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280Settings Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281Creating the Association Rule Analysis Model . . . . . . . . . . . . . . . . . . . . . . . 284Viewing the Association Rule Model Item Sets and Rule . . . . . . . . . . . . . . . 286

Viewing the Frequent Item Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286Viewing the Association Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289

Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292

15 Classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293Setting Up Your Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294Settings Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295Creating the Classification Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300

00-FM.indd 11 6/18/14 2:34 PM

Page 8: Contents at a GlanceOracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8 Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan

Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8 Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8

xii Predictive Analytics Using Oracle Data Miner

Evaluating the Classification Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304Preparing the Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304Computing the Confusion Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . 305Computing the Lift . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307Computing the ROC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308

Applying the Model to New Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310Applying the Model in Real Time . . . . . . . . . . . . . . . . . . . . . . . . . . . 310Applying the Model in Batch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313

Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315

16 Clustering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317Setting Up Your Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318Viewing Your Existing Cluster Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319Settings Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321Creating a Cluster Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325Examining the Cluster Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328

Querying the Cluster Models in Your Schema . . . . . . . . . . . . . . . . . . 329Examining the Cluster Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330

Applying the Cluster Model to New Data . . . . . . . . . . . . . . . . . . . . . . . . . . . 334Applying the Cluster Model in Real Time . . . . . . . . . . . . . . . . . . . . . . 334Applying the Cluster Model in Batch Mode . . . . . . . . . . . . . . . . . . . . 337

Combining Clusters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341

17 Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343Examining the Existing Regression Model(s) . . . . . . . . . . . . . . . . . . . . . . . . . 344Settings Table for Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346Creating a Regression Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350Examining and Evaluating the Regression Models . . . . . . . . . . . . . . . . . . . . 354

Global Statistics for a GLM Regression Model . . . . . . . . . . . . . . . . . . 354GLM Regression Model Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355SVM Regression Model Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358Residual Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361

Applying Regression Model to Your Data . . . . . . . . . . . . . . . . . . . . . . . . . . . 364Using the Regression Model in Real Time . . . . . . . . . . . . . . . . . . . . . 364Using the Regression Model in Batch Mode . . . . . . . . . . . . . . . . . . . 366

Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367

18 Anomaly Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369Examining the Existing Anomaly Detection Model(s) . . . . . . . . . . . . . . . . . . 370Settings Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372Creating an Anomaly Detection Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375

00-FM.indd 12 6/18/14 2:34 PM

Page 9: Contents at a GlanceOracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8 Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan

Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8 Oracle-Regular / Predictive Analytics Using Oracle Data Miner / Brendan Tierney / 167-8

Contents xiii

Applying the Anomaly Detection Model to Your Data . . . . . . . . . . . . . . . . . 378Using the Anomaly Detection Model in Real Time . . . . . . . . . . . . . . 378Using the Anomaly Detection Model in Batch Mode . . . . . . . . . . . . . 380

Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382

PART IVMigration and Implementations

19 How to Migrate Your ODM Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385Oracle Data Miner Script Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386

Running the ODM Workflow Scripts . . . . . . . . . . . . . . . . . . . . . . . . . 387PL/SQL Procedures for ODM Model Migration . . . . . . . . . . . . . . . . . . . . . . 389

System Privileges Needed for Exporting and Importing ODM Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390

Exporting an ODM Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391Importing and the ODM Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394Dropping an ODM Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397Renaming an ODM Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398

Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400

20 Implementation-Related Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401How to Add Your ODM Models to Your OBI Dashboards . . . . . . . . . . . . . . . 402

Importing the ODM Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402Creating a View to Include the ODM Model . . . . . . . . . . . . . . . . . . . 402Importing the View to the Physical

Layer of the BI Repository (RPD) . . . . . . . . . . . . . . . . . . . . . . . . . . 403Adding New Columns to the Business Model Layer . . . . . . . . . . . . . . 404Adding to the OBI Dashboards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404

How to Build and Apply ODM Models in Parallel . . . . . . . . . . . . . . . . . . . . 405How to Run Your ODM

Workflows and ODM Models in Parallel . . . . . . . . . . . . . . . . . . . . 405How to Run Your ODM Model in

Real Time Using Parallel Query . . . . . . . . . . . . . . . . . . . . . . . . . . . 408How to Run Your ODM Model in

Batch Mode Using Parallel Query . . . . . . . . . . . . . . . . . . . . . . . . . 409Predictive Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419

00-FM.indd 13 6/18/14 2:34 PM