Skip to main content

Client interface for twinLab machine-learning in the cloud.

Project description

twinLab Client

digiLab slack

Headless interface to the twinLab library.

Installation

Most users should use pip

pip install twinlab

If you want to modify the client-side code, or have a local installation, you will need to have git, poetry, and a python version of 3.9 or higher installed. Then you can do:

git clone https://github.com/digiLab-ai/twinLab-client.git
cd twinlab-client
poetry install

Environment setup

You will need a .env file in your project directory that looks like the .env.example file in this repository

cp .env.example .env

and fill in your twinLab user details.

Commands

Testing:

poetry run python scripts/test.py

where test.py can be replaced with any of the scripts in the scripts directory.

Example

Here we create some mock data (which has a quadratic relationship between X and y) and use twinLab to create a surrogate model with quantified uncertainty.

# Import libraries
import twinlab as tl
import pandas as pd

# Create a dataset and upload to the twinLab cloud
df = pd.DataFrame({'X': [1, 2, 3, 4], 'y': [1, 4, 9, 16]})
tl.upload_dataset(df, 'test.csv')

# Train a machine-learning model for the data
params = {
    'filename': 'test.csv',
    'inputs': ['X'],
    'outputs': ['y'],
}
tl.train_campaign(params, campaign_name='test')

# Evaluate the model on some unseen data
df = pd.DataFrame({'X': [1.5, 2.5, 3.5]})
df_mean, df_std = tl.predict_campaign(df, campaign_name='test')

Notebooks

Check out the notebooks directory for some additional examples to get started!

Documentation

See the live documentation at https://digilab-ai.github.io/twinLab-client/. Or build a copy locally:

cd docs
yarn install && yarn start

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

twinlab-1.1.6.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

twinlab-1.1.6-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file twinlab-1.1.6.tar.gz.

File metadata

  • Download URL: twinlab-1.1.6.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.3 Darwin/22.5.0

File hashes

Hashes for twinlab-1.1.6.tar.gz
Algorithm Hash digest
SHA256 c6b7af9b4351f5149ee7096123590b99c00ebb1e0745eff07d58cac806dd8b4a
MD5 7d4ae5040fc9af51bb1060297e394888
BLAKE2b-256 e38ab1164ce6ce7eeebe5b8a6b5a6cfd6d305afdbad9312ff90b0e747f5d78b4

See more details on using hashes here.

File details

Details for the file twinlab-1.1.6-py3-none-any.whl.

File metadata

  • Download URL: twinlab-1.1.6-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.3 Darwin/22.5.0

File hashes

Hashes for twinlab-1.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 76dcc179420930447b1a0fba4dc392c5addb5b767d1314a7597e1581093edab6
MD5 2bafad1d7d4a0f034d998b8c860d920b
BLAKE2b-256 5f8fdb961dffb8570537a5f0590d22b31dfe16dff240236024d913b10a3dba1c

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