Skip to main content

Standard Development Kit for interacting with the Rhino Health Federated Learning Platform

Project description

Rhino Health SDK

Programmatic interface for interacting with the Rhino Health Federated Learning Platform.

Example Usage

Please see the sample notebook files provided to you by the Rhino Health Team for additional use cases.

Create a session

import rhino_health

my_username = "rhino_user@rhinohealth.com" # Replace me
my_password = "ASecurePasswordYouSet321" # Replace me
session = rhino_health.login(username=my_username, password=my_password)

There will be three ways to interact with the API after you have a session

  1. Use defined endpoints under lib/endpoints for single actions
  2. Use our library functions for commonly performed advanced features
  3. Use our low level API Interface (advanced users)

Interact with the API via defined endpoints

We've included convenience functions for our most commonly used endpoints in the library with required input and output data classes. These can be found in rhino_health/lib/endpoints.

my_projects = session.project.get_projects()
my_first_project = my_projects[0]
my_first_project.add_collaborator(collaborating_workgroup_uid)

my_cohort = session.cohort.get_cohort(my_cohort_uid)
cohort_project = my_cohort.project
my_cohort_info = my_cohort.cohort_info

Library Functions

RhinoHealth also provides library functions which combine our basic building blocks to perform common actions.

Example:

from rhino_health.lib.metrics import RocAucWithCI

metric_configuration = RocAucWithCI(y_true_variable="label", y_pred_variable="pred", confidence_interval=95, timeout_seconds=600)
"""
data_filters=[{
        "filter_column":"is_roc",
        "filter_value":1
    }]
"""
result = my_cohort.get_metric(metric_configuration)
print(f"{result.output}")

Interact using the low level API

Please contact us for support with interacting with our low level API.

Rate Limits

The Rhino SDK handles rate limits of the API for you if you use the same session between threads and will attempt to queue requests. Excess requests will be sent with exponential backoff. If you send requests to our server from multiple locations then you may run into exceptions.

Development Notes

Please install libyaml required by our testing library (see https://vcrpy.readthedocs.io/en/latest/installation.html)

brew install libyaml
pip uninstall pyyaml
pip --no-cache-dir install pyyaml

You may need to use pip install -r requirements.txt --no-cache-dir on M1 Macs

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

rhino_health-0.2.23.tar.gz (68.6 kB view details)

Uploaded Source

Built Distribution

rhino_health-0.2.23-py3-none-any.whl (78.6 kB view details)

Uploaded Python 3

File details

Details for the file rhino_health-0.2.23.tar.gz.

File metadata

  • Download URL: rhino_health-0.2.23.tar.gz
  • Upload date:
  • Size: 68.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for rhino_health-0.2.23.tar.gz
Algorithm Hash digest
SHA256 83297991cbddc1df8f3f035c234b53a1c9919cd2d255673dfa0b69c76395e4a6
MD5 4242b522f160fec9663bcbf81ab0fb83
BLAKE2b-256 60d6157e5014b670b95b12c855b935c96c31595c697588a98741c3e8b81a4658

See more details on using hashes here.

File details

Details for the file rhino_health-0.2.23-py3-none-any.whl.

File metadata

File hashes

Hashes for rhino_health-0.2.23-py3-none-any.whl
Algorithm Hash digest
SHA256 de2358c1eed853993a164001840ee21c1df98cf6ebfc1f22c5e9cd0373b19b1c
MD5 9643be8bc934cb9196fa33c4557de4be
BLAKE2b-256 5bd4b97ac554d4966d842cf4405212d07737e769e99b23e1be5e16d6933a8f0a

See more details on using hashes here.

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