Wrappers around the Tonic.ai API
Project description
Overview
This library contains useful wrappers around the Tonic.ai API.
Usage
Instantiate the API wrapper using the following code:
from tonic_api.api import TonicApi
# Do not include trailing backslash in TONIC_URL
api = TonicApi(TONIC_URL, API_KEY)
Once instantiated, the following endpoints are available for consumption. Note that available endpoints and response types are limited. Available fields may be severely limited compared to the current Tonic API.
TonicApi:
get_workspace(workspace_id) => Workspace
Workspace:
id => string
name => string
models => Model[]
train(force_train) => existing or new job ID (if force_train or no Completed jobs)
get_most_recent_training_job(with_status) => TrainingJob (by default any status)
get_most_recent_training_job_by_model_id(model_id) => TrainingJob
get_most_recent_training_job_by_model_name(model_name) => TrainingJob
get_training_job_by_id(job_id) => TrainingJob
get_historical_training_jobs() => TrainingJob[]
describe() => debugger helper for printing fields
Model:
id => string
name => string
query => string
parameters => {}
encodings => {}
describe() => debugger helper for printing fields
TrainingJob:
id => string
published_time => string
get_training_status() => TrainingStatus
tail_training_status() => tails and prints status updates on training
get_trained_models() => TrainedModel[]
get_trained_model_by_model_id(model_id) => TrainedModel
get_trained_model_by_model_name(model_name) => TrainedModel
describe() => debugger helper for printing fields
TrainedModel:
id => string
model => Model
sample(num_rows) => pandas DataFrame (defaults to 1 row if num_rows not provided)
sample_source(num_rows) => pandas DataFrame (defaults to 1 row if num_rows not provided). Note: NOT randomized. Upper limit is limited to row count in source.
get_numeric_columns() => string[]
get_categorical_columns() => string[]
describe() => debugger helper for printing fields
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
tonic-api-1.2.0.tar.gz
(6.7 kB
view hashes)
Built Distribution
Close
Hashes for tonic_api-1.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2bbb8e74c28477caeebcf47f3350e4d67affdc6d9fe41ab661792bd2c95ccba |
|
MD5 | 177de48edf534984cadc8168dd667d47 |
|
BLAKE2b-256 | 47852bc06e48e4ee8b80ccf8aef1291bf4090ce03f695ae6d9e0b448a175c63c |