Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Predicting Good Wine in the Database with Oracle Machine Learning

A23789f299ed06fe7d9f1c6940440bfa?s=47 FTisiot
September 11, 2020

Predicting Good Wine in the Database with Oracle Machine Learning

How To use Oracle Machine Learning in the Oracle Database to predict Good and Bad Wine.
Contains also:
- Oracle Analytics Cloud Analysis
- Oracle APEX
- Oracle REST APIs

A23789f299ed06fe7d9f1c6940440bfa?s=128

FTisiot

September 11, 2020
Tweet

Transcript

  1. Francesco Tisiot Brendan Tierney Predicting good wine in the database

    with oracle machine learning @Ftisiot @BrendanTierney Rittman Mead Oralytics
  2. Francesco Tisiot Rittman Mead @Ftisiot Brendan Tierney ORALYTICS @Brendantierney

  3. Data Engineering Analytics Data Science www.rittmanmead.com info@rittmanmead.com @rittmanmead

  4. Can I have a glass of Wine? Yes Sir, what

    kind of wine? tell me what you have there! @Ftisiot @BrendanTierney
  5. Can I have a glass of Wine? Yes Sir, what

    kind of wine? Red Wine! @Ftisiot @BrendanTierney
  6. Can I have a glass of Wine? Yes, Do you

    like this Nice English pinot noir?? hell no! @Ftisiot @BrendanTierney
  7. Can I have a glass of Wine? Yes, Do you

    like this Nice croatian cabernet?? Let me check…. 95% Yes! @Ftisiot @BrendanTierney
  8. Dataset https://www.kaggle.com/zynicide/wine-reviews @Ftisiot @BrendanTierney

  9. The Data @Ftisiot @BrendanTierney

  10. Bad Good wine score @Ftisiot @BrendanTierney

  11. wine description @Ftisiot @BrendanTierney

  12. wine SAMPLES by country @Ftisiot @BrendanTierney

  13. wine price by country @Ftisiot @BrendanTierney

  14. good/bad wine by price @Ftisiot @BrendanTierney

  15. From insights to predictions @Ftisiot @BrendanTierney

  16. CLASSIFICATION Naïve Bayes Logistic Regression (GLM) Decision Tree Random Forest

    Neural Network Support Vector Machine Explicit Semantic Analysis CLUSTERING Hierarchical K-Means Hierarchical O-Cluster Expectation Maximization (EM) ANOMALY DETECTION One-Class SVM
 TIME SERIES Forecasting - Exponential Smoothing Includes popular models 
 e.g. Holt-Winters with trends, 
 seasonality, irregularity, missing data REGRESSION Linear Model Generalized Linear Model Support Vector Machine (SVM) Stepwise Linear regression Neural Network LASSO ATTRIBUTE IMPORTANCE Minimum Description Length Principal Comp Analysis (PCA) Unsupervised Pair-wise KL Div CUR decomposition for row & AI ASSOCIATION RULES A priori/ market basket PREDICTIVE QUERIES Predict, cluster, detect, features SQL ANALYTICS SQL Windows
 SQL Patterns
 SQL Aggregates •Includes support for Partitioned Models, Transactional, Unstructured, Geo-spatial, Graph data. etc, Oracle Machine Learning Algorithms FEATURE EXTRACTION Principal Comp Analysis (PCA) Non-negative Matrix Factorization Singular Value Decomposition (SVD) Explicit Semantic Analysis (ESA) TEXT MINING SUPPORT Algorithms support text Tokenization and theme extraction Explicit Semantic Analysis (ESA) for document similarity STATISTICAL FUNCTIONS Basic statistics: min, max, 
 median, stdev, t-test, F-test, Pearson’s, Chi-Sq, ANOVA, etc. R PACKAGES Third-party R Packages 
 through Embedded Execution Spark MLlib algorithm integration MODEL DEPLOYMENT SQL—1st Class Objects Oracle RESTful API (ORDS) OML Microservices (for Apps) X1 X2 A1 A2 A3 A4 A5 A6 A7 Copyright © 2019 Oracle and/or its affiliates.
  17. STATISTICAL FUNCTIONS Descriptive statistics (e.g. median, stdev, mode, sum, etc.)


    Hypothesis testing 
 (t-test, F-test, Kolmogorov-Smirnov test, Mann Whitney test, Wilcoxon Signed Ranks test
 Correlations analysis 
 (parametric and nonparametric e.g. 
 Pearson’s test for correlation, Spearman's rho coefficient, Kendall's tau-b correlation coefficient)
 Ranking functions
 Cross Tabulations with Chi-square statistics
 Linear regression
 ANOVA (Analysis of variance) Test Distribution fit 
 (e.g., Normal distribution test, 
 Binomial test, Weibull test, 
 Uniform test, Exponential test, 
 Poisson test) Statistical Aggregates 
 (min, max, mean, median, stdev, 
 mode, quantiles, plus x sigma, 
 minus x sigma, top n outliers, 
 bottom n outliers) Statistical Functions and Analytical SQL ANALYTICAL SQL SQL Windows
 SQL Aggregate functions LAG/LEAD functions SQL for Pattern Matching
 Additional approximate query processing: APPROX_COUNT, APPROX_SUM, APPROX_RANK Regular Expressions Copyright © 2019 Oracle and/or its affiliates.
  18. Oracle Machine Learning Multiple Languages UIs Supported for End Users

    & Apps Development Application Developers DBAs R & Python Data Scientists “Citizen” Data Scientists Notebook Users & DS Teams Coming soon
  19. BEGIN DBMS_DATA_MINING.CREATE_MODEL( model_name => 'Wine_CLASS_MODEL', mining_function => dbms_data_mining.classification, data_table_name =>

    ''Wine_TRAIN_DATA', case_id_column_name => 'ID', target_column_name => 'POINTS_BIN', settings_table_name => 'Wine_build_settings'); END; / CREATE ML MODEL BEGIN DBMS_DATA_MINING.CREATE_MODEL( model_name => 'Wine_CLASS_MODEL', mining_function => dbms_data_mining.classification, data_table_name => ''Wine_TRAIN_DATA', case_id_column_name => 'ID', target_column_name => 'POINTS_BIN', settings_table_name => 'Wine_build_settings'); END; / BEGIN DBMS_DATA_MINING.CREATE_MODEL( model_name => 'Wine_CLASS_MODEL', mining_function => dbms_data_mining.classification, data_table_name => ''Wine_TRAIN_DATA', case_id_column_name => 'ID', target_column_name => 'POINTS_BIN', settings_table_name => 'Wine_build_settings'); END; / BEGIN DBMS_DATA_MINING.CREATE_MODEL( model_name => 'Wine_CLASS_MODEL', mining_function => dbms_data_mining.classification, data_table_name => ''Wine_TRAIN_DATA', case_id_column_name => 'ID', target_column_name => 'POINTS_BIN', settings_table_name => 'Wine_build_settings'); END; / BEGIN DBMS_DATA_MINING.CREATE_MODEL( model_name => 'Wine_CLASS_MODEL', mining_function => dbms_data_mining.classification, data_table_name => ''Wine_TRAIN_DATA', case_id_column_name => 'ID', target_column_name => 'POINTS_BIN', settings_table_name => 'Wine_build_settings'); END; / BEGIN DBMS_DATA_MINING.CREATE_MODEL( model_name => 'Wine_CLASS_MODEL', mining_function => dbms_data_mining.classification, data_table_name => ''Wine_TRAIN_DATA', case_id_column_name => 'ID', target_column_name => 'POINTS_BIN', settings_table_name => 'Wine_build_settings'); END; / BEGIN DBMS_DATA_MINING.CREATE_MODEL( model_name => 'Wine_CLASS_MODEL', mining_function => dbms_data_mining.classification, data_table_name => ''Wine_TRAIN_DATA', case_id_column_name => 'ID', target_column_name => 'POINTS_BIN', settings_table_name => 'Wine_build_settings'); END; / @Ftisiot @BrendanTierney
  20. apply ML MODEL SELECT PREDICTION_PROBABILITY( Wine_CLASS_MODEL, 'GT_90_POINTS' USING 25 as

    PRICE, ‘MALBEC' as VARIETY, ‘SPAIN' as COUNTRY ) FROM dual; SELECT PREDICTION_PROBABILITY( Wine_CLASS_MODEL, 'GT_90_POINTS' USING 25 as PRICE, ‘MALBEC' as VARIETY, ‘SPAIN' as COUNTRY ) FROM dual; SELECT PREDICTION_PROBABILITY( Wine_CLASS_MODEL, 'GT_90_POINTS' USING 25 as PRICE, ‘MALBEC' as VARIETY, ‘SPAIN' as COUNTRY ) FROM dual; SELECT PREDICTION_PROBABILITY( Wine_CLASS_MODEL, 'GT_90_POINTS' USING 25 as PRICE, ‘MALBEC' as VARIETY, ‘SPAIN' as COUNTRY ) FROM dual; @Ftisiot @BrendanTierney
  21. None
  22. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | Confidential – Oracle Internal/Restricted/Highly Restricted 22
  23. None
  24. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | Confidential – Oracle Internal/Restricted/Highly Restricted 24
  25. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | Confidential – Oracle Internal/Restricted/Highly Restricted 25
  26. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | Confidential – Oracle Internal/Restricted/Highly Restricted 26
  27. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | Confidential – Oracle Internal/Restricted/Highly Restricted 27
  28. Optional: Include Wine Reviews

  29. Optional: Include Wine Reviews

  30. Oracle APEX @Ftisiot @BrendanTierney

  31. Oracle APEX @Ftisiot @BrendanTierney

  32. Oracle APEX @Ftisiot @BrendanTierney

  33. @Ftisiot @BrendanTierney

  34. @Ftisiot @BrendanTierney

  35. @Ftisiot @BrendanTierney

  36. @Ftisiot @BrendanTierney

  37. @Ftisiot @BrendanTierney

  38. @Ftisiot @BrendanTierney

  39. ML Model Deployment via ORDS REST API Launch Developmentà APEX

    @Ftisiot @BrendanTierney
  40. None
  41. ML Model Deployment via ORDS REST API @Ftisiot @BrendanTierney

  42. ML Model Deployment via ORDS REST API Launch RESTful Services

    @Ftisiot @BrendanTierney
  43. ML Model Deployment via ORDS REST API @Ftisiot @BrendanTierney

  44. ML Model Deployment via ORDS REST API Schema enables for

    ORDS RESTful Services @Ftisiot @BrendanTierney
  45. ML Model Deployment via ORDS REST API Helpful example templates

    provided @Ftisiot @BrendanTierney
  46. ML Model Deployment via ORDS REST API Helpful example templates

    provided Build your own custom API For What-IF ML predictions / Scoring – micro-services @Ftisiot @BrendanTierney
  47. ML Model Deployment via ORDS REST API RESTful API for

    calling 
 OML model to make predictions @Ftisiot @BrendanTierney
  48. Real-time Wine Recommendation App + OpenDiningTable App Copyright © 2019

    Oracle and/or its affiliates. @Ftisiot @BrendanTierney
  49. ML in database Summary analytics security governance prod deployment knowledge

    sharing data exploration visualisations storytelling easy reuse @Ftisiot @BrendanTierney
  50. What about the money? FREE! @Ftisiot @BrendanTierney

  51. Francesco Tisiot Brendan Tierney Predicting good wine in the database

    with oracle machine learning @Ftisiot @BrendanTierney Rittman Mead Oralytics