Skip to main content

Oracle Accelerated Data Science SDK

Project description

Oracle Accelerated Data Science (ADS)

PyPI Python Code style: black

The Oracle Accelerated Data Science (ADS) SDK is maintained by the Oracle Cloud Infrastructure (OCI) Data Science service team. It speeds up common data science activities by providing tools that automate and simplify common data science tasks. Additionally, provides data scientists a friendly pythonic interface to OCI services. Some of the more notable services are OCI Data Science, Model Catalog, Model Deployment, Jobs, ML Pipelines, Data Flow, Object Storage, Vault, Big Data Service, Data Catalog, and the Autonomous Database. ADS gives you an interface to manage the life cycle of machine learning models, from data acquisition to model evaluation, interpretation, and model deployment.

With ADS you can:

  • Read datasets from Oracle Object Storage, Oracle RDBMS (ATP/ADW/On-prem), AWS S3 and other sources into Pandas dataframes.
  • Tune models using hyperparameter optimization with the ADSTuner tool.
  • Generate detailed evaluation reports of your model candidates with the ADSEvaluator module.
  • Save machine learning models to the OCI Data Science Model Catalog.
  • Deploy models as HTTP endpoints with Model Deployment.
  • Launch distributed ETL, data processing, and model training jobs in Spark with OCI Data Flow.
  • Train machine learning models in OCI Data Science Jobs.
  • Define and run an end-to-end machine learning orchestration covering all the steps of machine learning lifecycle in a repeatable, continuous ML Pipelines.
  • Manage the life cycle of conda environments through the ads conda command line interface (CLI).

Installation

You have various options when installing ADS.

Installing the oracle-ads base package

  python3 -m pip install oracle-ads

Installing extras libraries

To work with gradient boosting models, install the boosted module. This module includes XGBoost and LightGBM model classes.

  python3 -m pip install 'oracle-ads[boosted]'

For big data use cases using Oracle Big Data Service (BDS), install the bds module. It includes the following libraries, ibis-framework[impala], hdfs[kerberos] and sqlalchemy.

  python3 -m pip install 'oracle-ads[bds]'

To work with a broad set of data formats (for example, Excel, Avro, etc.) install the data module. It includes the fastavro, openpyxl, pandavro, asteval, datefinder, htmllistparse, and sqlalchemy libraries.

  python3 -m pip install 'oracle-ads[data]'

To work with geospatial data install the geo module. It includes the geopandas and libraries from the viz module.

  python3 -m pip install 'oracle-ads[geo]'

Install the notebook module to use ADS within a OCI Data Science service notebook session. This module installs ipywidgets and ipython libraries.

  python3 -m pip install 'oracle-ads[notebook]'

To work with ONNX-compatible run times and libraries designed to maximize performance and model portability, install the onnx module. It includes the following libraries, onnx, onnxruntime, onnxmltools, skl2onnx, xgboost, lightgbm and libraries from the viz module.

  python3 -m pip install 'oracle-ads[onnx]'

For infrastructure tasks, install the opctl module. It includes the following libraries, oci-cli, docker, conda-pack, nbconvert, nbformat, and inflection.

  python3 -m pip install 'oracle-ads[opctl]'

For hyperparameter optimization tasks install the optuna module. It includes the optuna and libraries from the viz module.

  python3 -m pip install 'oracle-ads[optuna]'

Install the tensorflow module to include tensorflow and libraries from the viz module.

  python3 -m pip install 'oracle-ads[tensorflow]'

For text related tasks, install the text module. This will include the wordcloud, spacy libraries.

  python3 -m pip install 'oracle-ads[text]'

Install the torch module to include pytorch and libraries from the viz module.

  python3 -m pip install 'oracle-ads[torch]'

Install the viz module to include libraries for visualization tasks. Some of the key packages are bokeh, folium, seaborn and related packages.

  python3 -m pip install 'oracle-ads[viz]'

See pyproject.toml file [project.optional-dependencies] section for full list of modules and its list of extra libraries.

Note

Multiple extra dependencies can be installed together. For example:

  python3 -m pip install  'oracle-ads[notebook,viz,text]'

Documentation

Examples

Load data from Object Storage

  import ads
  from ads.common.auth import default_signer
  import oci
  import pandas as pd

  ads.set_auth(auth="api_key", oci_config_location=oci.config.DEFAULT_LOCATION, profile="DEFAULT")
  bucket_name = <bucket_name>
  key = <key>
  namespace = <namespace>
  df = pd.read_csv(f"oci://{bucket_name}@{namespace}/{key}", storage_options=default_signer())

Load data from ADB

This example uses SQL injection safe binding variables.

  import ads
  import pandas as pd

  connection_parameters = {
      "user_name": "<user_name>",
      "password": "<password>",
      "service_name": "<tns_name>",
      "wallet_location": "<file_path>",
  }

  df = pd.DataFrame.ads.read_sql(
      """
      SELECT *
      FROM SH.SALES
      WHERE ROWNUM <= :max_rows
      """,
      bind_variables={ max_rows : 100 },
      connection_parameters=connection_parameters,
  )

Contributing

This project welcomes contributions from the community. Before submitting a pull request, please review our contribution guide

Find Getting Started instructions for developers in README-development.md

Security

Consult the security guide SECURITY.md for our responsible security vulnerability disclosure process.

License

Copyright (c) 2020, 2022 Oracle and/or its affiliates. Licensed under the Universal Permissive License v1.0

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oracle_ads-2.9.0rc0.tar.gz (3.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oracle_ads-2.9.0rc0-py3-none-any.whl (4.3 MB view details)

Uploaded Python 3

File details

Details for the file oracle_ads-2.9.0rc0.tar.gz.

File metadata

  • Download URL: oracle_ads-2.9.0rc0.tar.gz
  • Upload date:
  • Size: 3.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for oracle_ads-2.9.0rc0.tar.gz
Algorithm Hash digest
SHA256 f50776438e2f33d5880d43d6367db261d63b41e88ecd37812257da4f06e40105
MD5 7277a2d7866ddd80465f599eb70b271f
BLAKE2b-256 e6c73bf14a751520398f09c8156bc68c73a98a933322044f7d509d5602632983

See more details on using hashes here.

File details

Details for the file oracle_ads-2.9.0rc0-py3-none-any.whl.

File metadata

  • Download URL: oracle_ads-2.9.0rc0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for oracle_ads-2.9.0rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 642a6d5c4cbb6ccc423ccbb0e104eaa387e1e542333b7eed5311ee348c83ecfe
MD5 0222662dd1353f1d8c4ae16522a6f1cc
BLAKE2b-256 da5a155af49717f08104e7eabf682ffcd1344a3d78d63ff8aedb8ef392bebc6c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page