Oracle Accelerated Data Science (ADS)#

PyPI Python Notebook Examples

Oracle Accelerated Data Science (ADS)

Oracle Accelerated Data Science (ADS) is maintained by the Oracle Cloud Infrastructure Data Science service team. It speeds up common data science activities by providing tools that automate and/or simplify common data science tasks, along with providing a data scientist friendly pythonic interface to Oracle Cloud Infrastructure (OCI) services, most notably OCI Data Science, Data Flow, Object Storage, and the Autonomous Database. ADS gives you an interface to manage the lifecycle 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.

  • Easily compute summary statistics on your dataframes and perform data profiling.

  • 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 Models.

  • Deploy those models as HTTPS 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.

  • Manage the lifecycle of conda environments through the ads conda command line interface (CLI).

  • Distributed Training with PyTorch, Horovod and Dask

Installation

python3 -m pip install oracle-ads

>>> import ads
>>> ads.hello()
>>> import ads
>>> ads.hello()


  O  o-o   o-o
 / \ |  \ |
o---o|   O o-o
|   ||  /     |
o   oo-o  o--o

ads v2.10.1
oci v2.122.0
ocifs v1.3.1


Additional Documentation#

Examples#

Load data from Object Storage#

import ads
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>"
path = "<path>"
namespace = "<namespace>"
df = pd.read_csv(
   f"oci://{bucket_name}@{namespace}/{path}", storage_options=ads.auth.default_signer()
)

Load data from Autonomous DB#

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,
)

More Examples#

See quick start guide for more examples

Contributing#

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

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