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 for some reason

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 cloud 

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

You need to have a local server for the (private) twinlab-cloud repository running for local testing. But local testing can then be run with

poetry run python scripts/test.py local

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 twinLab cloud
df = pd.DataFrame({'X': [1, 2, 3, 4], 'y': [1, 4, 9, 16]})
tl.upload_dataset('test.csv', df)

# Train a machine-learning model for the data
params = {
    'filename': 'test.csv',
    'inputs': ['X'],
    'outputs': ['y'],
}
tl.train_campaign(params, campaign='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='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 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.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

twinlab-1.1.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: twinlab-1.1.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.11.3 Darwin/22.4.0

File hashes

Hashes for twinlab-1.1.1.tar.gz
Algorithm Hash digest
SHA256 b954e35c3b84cde09f7dbaa3a81236a9a388c520c1fa99bb950be5682760b144
MD5 1dc1a25ba875137283a0f0723fbdf7ef
BLAKE2b-256 2a4dbcfa78c1dc25a85bbe70ecd7d6b8e5d3c667164ba1b90986bb26bb87e3fb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: twinlab-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.11.3 Darwin/22.4.0

File hashes

Hashes for twinlab-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 de916092010ea802c4c572c427d41ee2ba0c2dbd836abc9dfd041d6f461a6a0b
MD5 930941d3d5150dd40d83b97fd6fdf0dc
BLAKE2b-256 3a50caf60f886718366e2660b54ca888c92d9be691bb024f4f7fcfdafbb5f6d2

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