Learn Predictive Analytics In 2 Hours!

Transcription

Learn PredictiveAnalytics in 2 Hours!Oracle Advanced Analytics/Oracle Data Miner Hands on LabCharlie Berger, MS Engineering, MBA, Sr. Director ProductManagement, Advanced Analytics and Machine harlieDataMineTim Vlamis, Consultant, Vlamis Software Solutions, Inc.Karl Rexer, President, Rexer AnalyticsCopyright 2016, Oracle and/or its affiliates. All rights reserved.

Learn Predictive Analytics in 2 Hours!Oracle Advanced Analytics Hands on Lab Lessons—Novices1.OAA Quick Overview2.Data Mining Concepts Briefly3.Quick Oracle Data Miner GUI Demo4.Take off! Do as many Tutorials as youcan in the 2 hours HOL5.Ask questions! We’re all here to helpand discuss use cases! Take off!—Intermediate/Experts1.Environment Oracle 12c on the Oracle Database Cloud Will be using SQL Developer 4.2 EA2.Do 3-5 Tutorials Instructors will walk around helpingCopyright 2016 Oracle and/or its affiliates. All rights reserved. 2

Oracle’s Advanced AnalyticsAdvanced AnalyticsFastest Way to Deliver Scalable Enterprise-wide Predictive AnalyticsKey Features Parallel, scalable data mining algorithmsand R integration In-Database Hadoop—Don’t move thedata Data analysts, data scientists & developers Drag and drop workflow, R and SQL APIs Extends data management into powerfuladvanced/predictive analytics platform Enables enterprise predictive analyticsdeployment applicationsCopyright 2016, Oracle and/or its affiliates. All rights reserved.

Google “Oracle Advanced Analytics”Oracle Data MinerAdvanced AnalyticsCopyright 2016, Oracle and/or its affiliates. All rights reserved. 4

Oracle Data Mining/ Machine Learning/Predictive AnalyticsData Preparation & Adv. Analytical Process Runs In-DatabaseAdditional relevant dataand “engineered features”Historical or Current Data tobe “scored” for predictionsOracle Database 12cHistorical dataAssembledhistorical dataPredictions & InsightsSensor data, Text, unstructured data,transactional data, spatial data, etc.Copyright 2016, Oracle and/or its affiliates. All rights reserved. Confidential – Oracle Internal/Restricted/Highly Restricted5

Oracle Advanced Analytics 12.2Prelim/UnofficialModel Build Time PerformanceOAA 12.2 AlgorithmsRows (Ms)T7-4 (Sparc & Solaris)X5-4 (Intel and Linux)Model Build Time (Secs / Degree of Parallelism)Wow! That’s Fast!Attributes Importance64028s / 51244s / 72K Means ClusteringExpectation Maximization640159161s / 256455s / 512268s / 144588s / 144Naive Bayes ClassificationGLM ClassificationGLM Regression32064064017s / 256154s / 51255s / 51223s / 72363s / 14493s / 144Support Vector Machine (IPM solver) 640Support Vector Machine (SGD solver) 640404s / 51284s / 2561411s / 144188s / 72The way to read their results is that they compare 2 chips: X5 (Intel and Linux) and T7 (Sparc and Solaris). They are measuring scalability (time in seconds) with increase degreeof parallelism (dop). The data also has high cardinality categoricalcolumnswhichin 9K AllminingattributesCopyright 2016,Oracletranslatesand/or its affiliates.rights reserved. (when algorithms require explosion). There are nocomparisons to 12.1 and it is fair to say that the 12.1 algorithms could not run on data of this size.

Oracle’s Advanced Analytics and Machine Learning PlatformMultiple interfaces across platforms — SQL, R, GUI, Dashboards, AppsInformation ProducersUsersR programmersR ClientInformation ConsumersData & Business AnalystsBusiness Analysts/Mgrs Domain End Users (HCM, CRM)SQLDEV/Oracle Data allel,distributedalgorithmsOracle Database Enterprise EditionOracle Advanced Analytics - Database OptionSQL Data Mining, ML & Analytic Functions R Integrationfor Scalable, Distributed, Parallel in-DB ML ExecutionOracle CloudCopyright 2017, Oracle and/or its affiliates. All rights reserved. Oracle Database 12c

Oracle Data Miner GUIAdvanced AnalyticsEasy to Use for “Citizen Data Scientist” Easy to use todefine analyticalmethodologiesthat can beshared SQL DeveloperExtension Workflow APIand generatesSQL code forimmediatedeploymentCopyright 2016 Oracle and/or its affiliates. All rights reserved. 8

Take off!—Intermediate/ExpertsQuick Set up OverviewCopyright 2016 Oracle and/or its affiliates. All rights reserved.

Learn Predictive Analytics in 2 Hours!Oracle Advanced Analytics Hands on Lab We’re using the Oracle Database Cloud!Oracle CloudOracle Advanced Analytics Copyright 2016 Oracle and/or its affiliates. All rights reserved. 10

Learn Predictive Analytics in 2 Hours!Oracle Advanced Analytics Hands on Lab We’re using the Oracle Database Cloud!Oracle CloudOracle Advanced AnalyticsCopyright 2016 Oracle and/or its affiliates. All rights reserved. 11

Learn Predictive Analytics in 2 Hours!Oracle Advanced Analytics Hands on LabCopyright 2016 Oracle and/or its affiliates. All rights reserved. 12

Learn Predictive Analytics in 2 Hours!Oracle Advanced Analytics Hands on LabCopyright 2016 Oracle and/or its affiliates. All rights reserved. 13

Check your connection! Service nameshould be simply “DEMOS”1. Change & Save Connection2. Restart SQLDEV & ODMrCopyright 2016 Oracle and/or its affiliates. All rights reserved.

Learn Predictive Analytics in 2 Hours!Oracle Advanced Analytics Hands on Lab Step 1—Install SQLDEV 4.1.3 Step 2—Connect to OracleDatabase Cloud– 1. Go to Oracle Data Miner & create aNEW Connection e.g. HOL”N”– Select HOL”N” from drop down menu– Optionally may need to upgradeolder Data Mining repository (maytake 3 mins)– You are done!Copyright 2016 Oracle and/or its affiliates. All rights reserved.

Learn Predictive Analytics in 2 Hours!Oracle Advanced Analytics Hands on Lab Step 1—Install SQLDEV 4.1.3 Step 2—Connect to OracleDatabase Cloud– Connect as SYS/Welcome#1– Start to run task– Running task (may take 3 mins)Copyright 2016 Oracle and/or its affiliates. All rights reserved.

Learn Predictive Analytics in 2 Hours!Oracle Advanced Analytics Hands on Lab Step 1—Install SQLDEV 4.1.3 Step 2—Connect to Oracle Database Cloud Step 3—Start HOL!– dmuser/dmuser– Demo data for learning– Follow 3-5 OBE Online Tutorials1. Using Oracle Data Miner 4.12. Star Schema Mining Using Oracle Data Miner 4.13. Text Mining with an EM Clustering Model Using Data Miner 4.14. Anomaly Detection (CLAIMS) See Instructor for assistance5. Market Basket Analysis (SH.SALES) See Instructor for assistanceCopyright 2016 Oracle and/or its affiliates. All rights reserved.

OAA/Oracle Data Miner 4.2 HOLWe’re Using the Oracle by Example Free Online Tutorials Google “Oracle Data Miner” Scroll down to bottom of page &launch tutorials– https://apexapps.oracle.com/pls/apex/f?p 44785:24:::NO::P24 CONTENT ID,P24 PREV PAGE:11925,2Copyright 2016 Oracle and/or its affiliates. All rights reserved.

OAA/Oracle Data Miner 4.1 HOLUses Oracle by Example Free Online Tutorials There are 6 Tutorials– The first tutorial is alreadydone for you– Recommend doing 3-5TutorialsP1. Using Oracle Data Miner 4.12. Star Schema Mining Using Oracle DataMiner 4.13. Text Mining with an EM Clustering ModelUsing Data Miner 4.14. Anomaly Detection (CLAIMS) See Instructorfor assistance5. Market Basket Analysis (SH.SALES) SeeInstructor for assistanceCopyright 2016 Oracle and/or its affiliates. All rights reserved.

Great book on Oracle Advanced AnalyticsAvailable on Amazon or from Author Predictive AnalyticsUsing Oracle DataMiner: Develop forODM in SQL & PL/SQLCopyright 2016 Oracle and/or its affiliates. All rights reserved.

OAA/Oracle Data Miner 4.1 HOLSetting Up Oracle Data MinerDonePCopyright 2016 Oracle and/or its affiliates. All rights reserved.

OAA/Oracle Data Miner 4.1 HOLSetting Up Oracle Data MinerDonePCopyright 2016 Oracle and/or its affiliates. All rights reserved.

Introducing the Data Miner Interface4172356Copyright 2016 Oracle and/or its affiliates. All rights reserved. 8

Examining Oracle Data Miner NodesDataTransformsTextCopyright 2016 Oracle and/or its affiliates. All rights reserved.

Examining Oracle Data Miner NodesModelsEvaluate and ApplyLinkingCopyright 2016 Oracle and/or its affiliates. All rights reserved.

Previewing a Data Miner WorkflowCopyright 2016 Oracle and/or its affiliates. All rights reserved.

Rapidly Build, Evaluate & Deploy Analytical MethodologiesLeveraging a Variety of Data Sources and TypesTransactionalPOS dataSQL Joins and arbitrary SQLtransforms & queries – power of SQLModelingApproachesInline predictivemodel to augmentinput dataAdvanced AnalyticsConsider: DemographicsGenerates SQL scripts Past purchasesand workflow API for Recent purchasesdeploymentUnstructured data Comments & tweetsalso mined byalgorithmsCopyright 2016, Oracle and/or its affiliates. All rights reserved.

Previewing a 4.2 FeatureWorkflow SchedulerCopyright 2016 Oracle and/or its affiliates. All rights reserved.

Previewing a 4.2 FeatureWorkflow SchedulerCopyright 2016 Oracle and/or its affiliates. All rights reserved.

Previewing a 4.2 FeatureWorkflow SchedulerCopyright 2016 Oracle and/or its affiliates. All rights reserved.

Previewing a 4.2 FeatureWorkflow SchedulerCopyright 2016 Oracle and/or its affiliates. All rights reserved.

Previewing a 4.2 FeatureWorkflow SchedulerCopyright 2016 Oracle and/or its affiliates. All rights reserved.

Previewing a 4.2 FeatureWorkflow Scheduler—Email NotificationsCopyright 2016 Oracle and/or its affiliates. All rights reserved.

The Data Mining Sample Programs The Data Mining Sample Programs 12c Documentation– You can learn a great deal about the Oracle Data Mining API from the data miningsample programs. The programs illustrate typical approaches to data preparation,algorithm selection, algorithm tuning, testing, and scoring.– The programs are easy to use. They include extensive inline comments to help youunderstand the code. They delete all temporary objects on exit; you can run theprograms repeatedly without setup or cleanup.– The data mining sample programs are installed with Oracle Database Examples in thedemo directory under Oracle Home. The demo directory contains sample programsthat illustrate many features of Oracle Database. You can locate the data mining filesby doing a directory listing of dm*.sql.Copyright 2016 Oracle and/or its affiliates. All rights reserved.

The Data Mining Sample ProgramsAttribute Importance Sample CodeCopyright 2016 Oracle and/or its affiliates. All rights reserved.

Learn Predictive Analytics in 2 Hours!Oracle Advanced Analytics Hands on Lab READY, SET, GO!!!! Recommend doing 3-5 Tutorials1.Using Oracle Data Miner 4.12.Star Schema Mining Using Oracle Data Miner 4.13.Text Mining with an EM Clustering Model Using Data Miner 4.14.Anomaly Detection (CLAIMS) See Instructor for assistance5.Market Basket Analysis (SH.SALES) See Instructor for assistanceCopyright 2016 Oracle and/or its affiliates. All rights reserved.

Novice/Introductory/OverviewsQuick Overview of Concepts, Process and Use CasesCopyright 2016 Oracle and/or its affiliates. All rights reserved.

What is Machine Learning, Data Mining & PredictiveAnalytics?Automatically sifting through large amounts of data tocreate models that find previously hidden patterns,discover valuable new insights and make predictions Identify most important factor (Attribute Importance) Predict customer behavior (Classification) Predict or estimate a value (Regression) Find profiles of targeted people or items (Decision Trees) Segment a population (Clustering) Find fraudulent or “rare events” (Anomaly Detection) Determine co-occurring items in a “baskets” (Associations)Copyright 2016 Oracle and/or its affiliates. All rights reserved. A1 A2 A3 A4 A5 A6 A7

Predictive Analytics & Data MiningTypical Use Cases Targeting the right customer with the right offer How is a customer likely to respond to an offer? Finding the most profitable growth opportunities Finding and preventing customer churn Maximizing cross-business impact Security and suspicious activity detection Understanding sentiments in customer conversations Reducing medical errors & improving quality of health Understanding influencers in social networksCopyright 2014 Oracle and/or its affiliates. All rights reserved.

Data Mining ProvidesBetter Information, Valuable Insights and PredictionsLease Churnersvs. Loyal CustomersSegment #3IF CUST MO 7 AND INCOME 175K, THENPrediction Lease Churner,Confidence 83%Support 6/39Insight & PredictionSegment #1IF CUST MO 14 AND INCOME 90K, THEN Prediction LeaseChurnerConfidence 100%Support 8/39Customer MonthsSource: Inspired from Data Mining Techniques: For Marketing, Sales, and Customer Relationship Management by Michael J. A. Berry, Gordon S. LinoffCopyright 2014 Oracle and/or its affiliates. All rights reserved.

Oracle Advanced Analytics DB OptionIn-Database Machine Learning Algorithms*—SQL &Classification Decision Tree Logistic Regression (GLM) Naïve Bayes Support Vector Machine (SVM) Random ForestRegression Multiple Regression (GLM) Support Vector Machine (SVM) Stepwise Linear Regression Linear Model Generalized Linear Model Multi-Layer Neural NetworksAnomaly Detection 1-Class Support Vector MachineAdvanced Analytics& GUI AccessClusteringPredictive Queries Hierarchical k-Means Clustering Orthogonal Partitioning Clustering Regression Expectation-Maximization Anomaly Detection Feature ExtractionAttribute ImportanceFeature Extraction & Creation Minimum Description Length Nonnegative Matrix Factorization Unsupervised pair-wise KL div. Principal Component AnalysisMarket Basket Analysis Singular Value Decomposition Apriori – Association RulesTime Series Single & Double Exp. SmoothingText MiningA1 A2 A3 A4 A5A6 A7 All OAA/ODM SQL ML support Explicit Semantic AnalysisOpen Source R Algorithms Ability to run any R package(9,000 )via Embedded R mode Ability to Mine Unstructured, Structured & Transactional data Partitioned ModelsCopyright 2016, Oracle and/or its affiliates. All rights reserved.

Oracle University’s Learn Predictive AnalyticsUsing Oracle Data Mining Course AgendaCopyright 2016 Oracle and/or its affiliates. All rights reserved.

The Data Mining ProcessCopyright 2016 Oracle and/or its affiliates. All rights reserved.

Data Mining AttributesCopyright 2016 Oracle and/or its affiliates. All rights reserved.

Building and Evaluating ModelsCopyright 2016 Oracle and/or its affiliates. All rights reserved.

Model Building TasksCopyright 2016 Oracle and/or its affiliates. All rights reserved.

Model Train & Test: Supervised LearningCopyright 2016 Oracle and/or its affiliates. All rights reserved.

Model Evaluation: Supervised LearningCopyright 2016 Oracle and/or its affiliates. All rights reserved.

Applying the Selected Model(s)Copyright 2016 Oracle and/or its affiliates. All rights reserved.

Oracle Advanced AnalyticsBrief DemosCopyright 2014 Oracle and/or its affiliates. All rights reserved.

Copyright 2014 Oracle and/or its affiliates. All rights reserved. 53

Copyright 2014 Oracle and/or its affiliates. All rights reserved. 54

Copyright 2014 Oracle and/or its affiliates. All rights reserved. 55

Copyright 2014 Oracle and/or its affiliates. All rights reserved. 56

Copyright 2014 Oracle and/or its affiliates. All rights reserved. 57

Copyright 2014 Oracle and/or its affiliates. All rights reserved. 58

Copyright 2014 Oracle and/or its affiliates. All rights reserved. 59

Copyright 2014 Oracle and/or its affiliates. All rights reserved. 60

Copyright 2014 Oracle and/or its affiliates. All rights reserved. 61

Copyright 2014 Oracle and/or its affiliates. All rights reserved. 62

Copyright 2014 Oracle and/or its affiliates. All rights reserved. 63

Copyright 2014 Oracle and/or its affiliates. All rights reserved. 64

Copyright 2014 Oracle and/or its affiliates. All rights reserved. 65

Copyright 2014 Oracle and/or its affiliates. All rights reserved. 66

Sharing, Automation and DeploymentImmediately Go to “Productionization” of Analytical Methodologies Share ODMr workflows Workflow API for 100% automation Immediate deployment of data analyst’smethodologies SQL Script Generation Deploy methodology as SQL scriptsCopyright 2014 Oracle and/or its affiliates. All rights reserved.

Fraud Prediction DemoAutomated In-DB Analytical Methodologydrop table CLAIMS SET;exec dbms data mining.drop model('CLAIMSMODEL');create table CLAIMS SET (setting name varchar2(30), setting value varchar2(4000));insert into CLAIMS SET values ('ALGO NAME','ALGO SUPPORT VECTOR MACHINES');insert into CLAIMS SET values ('PREP AUTO','ON');commit;begindbms data mining.create model('CLAIMSMODEL', 'CLASSIFICATION','CLAIMS', 'POLICYNUMBER', null, 'CLAIMS SET');end;/-- Top 5 most suspicious fraud policy holder claimsselect * from(select POLICYNUMBER, round(prob fraud*100,2) percent fraud,rank() over (order by prob fraud desc) rnk from(select POLICYNUMBER, prediction probability(CLAIMSMODEL, '0' using *) prob fraudfrom CLAIMSwhere PASTNUMBEROFCLAIMS in ('2to4', 'morethan4')))where rnk 5order by percent fraud desc;Automated Monthly “Application”!Just add:CreateView CLAIMS2 30AsSelect * from CLAIMS2Where mydate SYSDATE – 30Copyright 2014 Oracle and/or its affiliates. All rights reserved. Time measure: set timing on;

Oracle Advanced AnalyticsReal-Time Scoring, Predictions and Recommendations On-the-fly, single record apply with new data (e.g. from call center)Select prediction probability(CLAS DT 1 64, 'Yes'USING 7800 as bank funds, 125 as checking amount, 20 ascredit balance, 55 as age, 'Married' as marital status,250 as MONEY MONTLY OVERDRAWN, 1 as house ownership)from dual;Social MediaCall CenterLikelihood to respond:Get AdviceBranchOfficeRMobileWebEmailCopyright 2016, Oracle and/or its affiliates. All rights reserved.

OAA/Oracle Data Miner 4.1 HOLUses Oracle by Example Free Online Tutorials There are 6 Tutorials– The first tutorial is alreadydone for you– Recommend doing 3-5TutorialsP1. Using Oracle Data Miner 4.12. Star Schema Mining Using Oracle DataMiner 4.13. Text Mining with an EM Clustering ModelUsing Data Miner 4.14. Anomaly Detection (CLAIMS) See Instructorfor assistance5. Market Basket Analysis (SH.SALES) SeeInstructor for assistanceCopyright 2016 Oracle and/or its affiliates. All rights reserved.

Copyright 2016 Oracle and/or its affiliates. All rights reserved.

Learn Predictive Analytics in 2 Hours! Oracle Advanced Analytics Hands on Lab Step 1—Install SQLDEV 4.1.3 Step 2—Connect to Oracle Database Cloud Step 3—Start HOL! –dmuser/dmuser –Demo data for learning –Follow 3-5 OBE Online Tutorials 1. Using Oracle Data Miner 4.1 2. Star S