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

OML feature highlight: Deploy an XGBoost Model ...

OML feature highlight: Deploy an XGBoost Model using OML Services

In this Session Sherry LaMonica, Principal Member of Technical Staff at Oracle Machine Learning team explained how to train a Python SciKit-learn Xgboost model, properly convert the model to ONNX format and then deploy the model to OML Services on Autonomous Database.

OML Services extends OML functionality to support model deployment and model lifecycle management for both in-database OML models and third-party Open Neural Networks Exchange (ONNX) machine learning models via REST APIs.

The REST API for Oracle Machine Learning Services provides REST API endpoints hosted on Oracle Autonomous Database. These endpoints enable the storage of machine learning models along with its metadata, and the creation of scoring endpoints for the model.

These third-party classification or regression models can be built using tools that support the ONNX format, which includes packages like Scikit-learn and TensorFlow, among several others.

In addition, OML Services supports proprietary cognitive text capabilities, with capabilities for topic discovery, keywords, summary, sentiment, and feature extraction. The initial languages supported include English, Spanish, French and Italian (based on a Wikipedia knowledgebase using embeddings).

OML Services cognitive image functionality, supported through the ONNX format third-party model deployment feature, supports scoring using images or tensors.

Marcos Arancibia

August 10, 2021
Tweet

More Decks by Marcos Arancibia

Other Decks in Technology

Transcript

  1. OML feature highlight: Deploy a Python XGBoost Model using OML

    Services OML Office Hours Sherry LaMonica Principal Member of Technical Staff, Oracle Machine Learning Supported by Marcos Arancibia and Mark Hornick Product Management, Oracle Machine Learning Move the Algorithms; Not the Data! Copyright © 2021, Oracle and/or its affiliates. This Session will be Recorded
  2. • Motivation • Overview of OML Services • Overview of

    ONNX • Demo • Train a Python XGBoost model • Materialize the model to ONNX format • Deploy the ONNX model using OML Services on Autonomous Database • Q&A Topics for today Copyright © 2021, Oracle and/or its affiliates 2
  3. • Simplifies the task of putting models into production •

    Algorithm not available in-database • Very fast scoring • Cost effective • Requirement to separate development and deployment environments, for example, web applications • OML Services contains ONNX support for classification and regression models Motivation 4 Why deploy an ONNX model using OML Services? Copyright © 2021, Oracle and/or its affiliates.
  4. Oracle Machine Learning OML4SQL OML Notebooks OML4R Oracle Data Miner

    OML4Py OML4Spark OML AutoML UI OML Services Interfaces for 3 popular data science languages: SQL, R, and Python Collaborative notebook environment based on Apache Zeppelin with Autonomous Database SQL Developer extension to create, schedule, and deploy ML solutions through a drag-and-drop interface ML for the big data environment from R with scalable algorithms Code-free AutoML interface on Autonomous Database Model Deployment and Management, Cognitive Text 6 Copyright © 2021, Oracle and/or its affiliates
  5. Oracle Machine Learning Key Attributes Automated Get better results faster

    with less effort– even non-expert users Scalable Handle big data volumes using parallel,distributed algorithms – no data movement Production-ready Deploy and update data science solutions faster with integrated ML platform Increase productivity, Achieve enterprise goals, Innovate more 7 Copyright © 2021, Oracle and/or its affiliates
  6. Oracle Machine Learning Services architecture Connectivity and use from Client

    REST Client user/pass Token + Actions & T ext/Objects GET POST DELETE Oracle Autonomous Database GET Token 8 Copyright © 2021, Oracle and/or its affiliates /omlusers PDB /omlmod OM L Services
  7. Oracle Machine Learning Services - Methods Components with built-in Oracle

    Machine Learning Deployment POST • Create Model Endpoint • Score Model using Endpoint GET • Endpoints • Endpoint Details • Open API Specification for Endpoint DELETE • Endpoint Repository POST • Store Model • Update Model Namespace GET • Models list • Model Info • Model Metadata • Model Content DELETE • Model Cognitive Text POST • Get Most Relevant Topics • Get Most Relevant Keywords • Get Summaries • Get Sentiments • Get Semantic Similarities • Numeric Features GET • Get Endpoints Generic GET • Metadata for all Versions: Version 1 Metadata • Open API Specification Admin POST • Token using ADB user and password 9 Copyright © 2021, Oracle and/or its affiliates
  8. ONNX is an open standard format for representing and storing

    machine learning models. It is the basis of an open ecosystem with interchangeable ML models. Benefits include: • Promoting interoperability, portability, and efficiency • Integration into different machine learning frameworks and tools - XGBoost, SciKit-Learn, PyTorch, TensorFlow, and others • ONNX models run on a variety of ONNX compliant tools and frameworks for scoring 11 Copyright © 2021, Oracle and/or its affiliates ONNX
  9. ONNX Copyright © 2021, Oracle and/or its affiliates 12 Oracle

    Machine Learning Services Other Frameworks and Devices Train Export Deploy
  10. Architecture Copyright © 2020, Oracle and/or its affiliates | Confidential:

    Internal/Restricted/Highly Restricted 13 On an external Python engine, build XGBoost model and export in ONNX format Deploy Oracle Machine Learning Services Oracle Autonomous Database
  11. Python dependencies on external Python engine Package requirements Copyright ©

    2021, Oracle and/or its affiliates 14 $ pip install onnx $ pip install onnxmltools The model is represented in ONNX format and can be deployed to OML Services Export the model to ONNX format using ONNXMLtools Train a model using XGBoost in Python $ pip install xgboost XGBoost ONNXMLtools ONNX
  12. Helpful Links 17 ORACLE MACHINE LEARNING ON O.COM https://www.oracle.com/machine-learning OML

    TUTORIALS OML LiveLab: https://apexapps.oracle.com/pls/apex/dbpm/r/livelabs/view-workshop?p180_id=560 OML4Py LiveLab: https://apexapps.oracle.com/pls/apex/dbpm/r/livelabs/view-workshop?wid=786 Interactive tour: https://docs.oracle.com/en/cloud/paas/autonomous-database/oml-tour OML OFFICE HOURS https://asktom.oracle.com/pls/apex/asktom.search?office=6801#sessionss ORACLE ANALYTICS CLOUD https://www.oracle.com/solutions/business-analytics/data-visualization/examples.html OML4PY ORACLE AUTOML UI OML SERVICES Oracle Machine Learning AutoML UI (2m video) Oracle Machine Learning Demonstration (6m video) OML AutoML UI Technical Brief Blog: Introducing Oracle Machine Learning AutoML UI Oracle Machine Learning Services (2m video) OML Services Technical Brief Oracle Machine Learning Services Documentation Blog: Introducing Oracle Machine Learning Services GitHub Repository with OML Services examples OML4Py (2m video) OML4Py Introduction (17m video) OML4Py Technical Brief OML4Py User’s Guide Blog: Introducing OML4Py GitHub Repository with Python notebooks
  13. On our GitHub, you can find: Copyright © 2021, Oracle

    and/or its affiliates 18 https://github.com/oracle/oracle-db-examples/tree/master/machine-learning • Example Notebooks in OML4SQL and OML4Python • SQL code examples for DB 18c, 19c and 21c • Labs folder with OML4Py HOL Labs • OML Services demos including ONNX and Cognitive Text Demos, in PostMan collections
  14. Info page: https://github.com/onnx/sigs/tree/master/models-tutorials The ONNX Model Zoo is a collection

    of pre-trained models in the ONNX format contributed by community members. Accompanying each model are Jupyter notebooks for model training and running inference with the trained model.