Skip to main content

Oracle Accelerated Data Science SDK

Project description

Oracle Accelerated Data Science SDK (ADS)

PyPI

The Oracle Accelerated Data Science (ADS) SDK 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 Model Catalog.
  • Deploy those 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.
  • Manage the lifecycle 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 use ADS within a Notebook Session of the OCI Data Science service:

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

For machine learning tasks install

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

To work on text related tasks run

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

For access to a broad set of data formats (for example, Excel, Avro, etc.) run

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

Note

Multiple extra dependencies can be installed together. For example:

  $ python3 -m pip install  oracle-ads[notebook,boosted,text]

Documentation

Examples

Load data from Object Storage

  import ads
  from ads.common.auth import default_signer
  import oci

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

Load data from ADB (simple)

  connection_parameters = {
      "user_name": "<username>",
      "password": "<password>",
      "service_name": "<service_name_{high|med|low}>",
      "wallet_location": "/full/path/to/my_wallet.zip",
  }
  import pandas as pd
  import ads

  # simple read of a SQL query into a dataframe with no bind variables
  df = pd.DataFrame.ads.read_sql(
      "SELECT * FROM SH.SALES",
      connection_parameters=connection_parameters,
  )

Load data from ADB (using sql-injection-safe bind variables)

  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

Please consult the security guide for our responsible security vulnerability disclosure process.

License

Copyright (c) 2020, 2022 Oracle and/or its affiliates. Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/

Project details


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.5.10.tar.gz (939.9 kB view hashes)

Uploaded Source

Built Distribution

oracle_ads-2.5.10-py3-none-any.whl (1.2 MB view hashes)

Uploaded Python 3

Supported by

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