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
- Use defined endpoints under lib/endpoints for single actions
- Use our library functions for commonly performed advanced features
- 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
If you would prefer to interact directly with our backend API, you can hit our backend directly using our low level APIs. This option is valid for any endpoints we do not have full SDK support for yet.
session.get("/alpha/secret/api").raw_response.json()
session.post("/alpha/secret/api", {"arbitrary_payload": "value"}).raw_response.json()
# Can also check out .status_code, etc.
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
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
Built Distribution
File details
Details for the file rhino_health-0.2.10.tar.gz
.
File metadata
- Download URL: rhino_health-0.2.10.tar.gz
- Upload date:
- Size: 52.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c4acf9d9ff49de7574a4d044ad768f6876f6fc6a658c1db8290cea3a47cd827 |
|
MD5 | 86f5958e2427ce2ee2faeabbd4a009cd |
|
BLAKE2b-256 | 6d315b814c5fea82773841d97e86a84f1c1d8e4097bca73248cd71547d049246 |
File details
Details for the file rhino_health-0.2.10-py3-none-any.whl
.
File metadata
- Download URL: rhino_health-0.2.10-py3-none-any.whl
- Upload date:
- Size: 60.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b86fabb413324698a960f9ef3310ee259f399a45a36c4a5c55ebaeb7fc71f6a |
|
MD5 | 30903f0cfabf46344ff4464844a04fa0 |
|
BLAKE2b-256 | be2c8c7c605697b7f55db33eb68577f5c310153bd3192651dbb1e74c0e6126a4 |