Skip to main content

twinLab - Probabilistic Machine Learning for Engineers

Project description

twinLab Banner

twinLab - Probabilistic Machine Learning for Engineers

twinLab is a tool for augmenting engineering workflows with Probabilistic Machine Learning. It enables users to quickly and easily build real-time emulators of their simulations, experimental set-ups, or sensor networks. Then they can make predictions, make recommendations, perform optimisations, and calibrate physics parameters from data.

twinLab comes with built-in uncertainty quantification (UQ), which means that even with sparse or noisy data, users can maximise their understanding of the design space and surrogate model with confidence.

For help, or to arrange a trial, please email: twinlab@digilab.co.uk or fill in the contact form here.

Getting Started

Step 1: Install the Python Interface

pip install twinlab

Step 2: Configure your API Key

If you don't yet have one, you'll need to request a trial. Please email twinlab@digilab.co.uk or fill in the contact form here.

Method 1: tl.set_api_key. Be careful not to publicly expose your API key if sharing files.

import twinlab as tl
tl.set_api_key('<your_api_key>')

Method 2: Create a .env file containing TWINLAB_API_KEY in your working directory, and then import twinlab as tl in your Python script / notebook as normal. The API key will be read from .env automatically.

echo "TWINLAB_API_KEY=<your_api_key>" > .env

Step 3: Run an Example

Here’s an example script to get you started:

# Import pandas as well
import pandas as pd

# Load an example dataset and upload to twinLab
dataset = tl.Dataset("quickstart")
df = tl.load_example_dataset("quickstart")
dataset.upload(df)

# Train a machine-learning emulator for the data
emulator = tl.Emulator("test-emulator")
emulator.train(dataset, ["x"], ["y"])

# Evaluate the emulator on some unseen data
sample_points = pd.DataFrame({"x": [0.25, 0.5, 0.75]})
predict_mean, predict_std = emulator.predict(sample_points)

# Explore the results
print(predict_mean)
print(predict_std)

Documentation

Find more examples, tutorials, and the full reference guide for our Python Interface in our documentation.

Speak to an Expert

Our Solution Engineers are here to provide technical support and help you maximise the value of twinLab. Please email twinlab@digilab.co.uk or fill in the contact form here.

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-2.6.1.tar.gz (41.4 kB view details)

Uploaded Source

Built Distribution

twinlab-2.6.1-py3-none-any.whl (45.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: twinlab-2.6.1.tar.gz
  • Upload date:
  • Size: 41.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.0 Darwin/22.5.0

File hashes

Hashes for twinlab-2.6.1.tar.gz
Algorithm Hash digest
SHA256 4ac26e527db8c3bd48c5f1f16299fcf5dbfc2bbd148f1e5e908c3ed54475db86
MD5 80eee8bc6f4a870957af444abc16a07c
BLAKE2b-256 9ec38f9288e0272a4db542e3eda40eb1cd24db761ce28791c04ccb4169bb5475

See more details on using hashes here.

File details

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

File metadata

  • Download URL: twinlab-2.6.1-py3-none-any.whl
  • Upload date:
  • Size: 45.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.0 Darwin/22.5.0

File hashes

Hashes for twinlab-2.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 21ea13beb78947e924fdbdff04f9c01fb4b91cdbd2c01bb495daa0c1e1e79fac
MD5 aad622b3b61655d8cdacf9f7a8fec869
BLAKE2b-256 a9006a67d5fa0532d8e15029ff3dbb790c9bff2e7a888907089ba948027ff5cd

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