Skip to main content

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 user details

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: Use tl.set_user and tl.set_api_key within a script. Be careful not to publicly expose your API key if sharing files.

import twinlab as tl

tl.set_user("<your_username>")
tl.set_api_key("<your_api_key>")

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

echo "TWINLAB_USER=<your_username>" >> .env
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 pd
import twinlab as tl

# 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.

Metadata

Release files for twinlab 2.21.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for twinlab 2.21.0
File Size Uploaded
twinlab-2.21.0.tar.gz 51.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for twinlab 2.21.0
File Interpreter ABI Platform
twinlab-2.21.0-py3-none-any.whl Python 3 none any Details

Total release size: 110.1 kB

Release files / twinlab-2.21.0.tar.gz

Download URL twinlab-2.21.0.tar.gz
Size 51.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c55fdce01d4bdbe984d32a7734c50c4f01882d15b3e58e808d16b881a565bc11
BLAKE2b-256 checksum
How to use checksums
610e96302c41a40ec1d223518040ac1c2b2f87ca98fc9ceb4cfc9eed0e2e9fdc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.13.2 Darwin/24.3.0

Release files / twinlab-2.21.0-py3-none-any.whl

Download URL twinlab-2.21.0-py3-none-any.whl
Size 58.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f707c43a012f6b4a6dc413e8447b00f6f20302d720b8ca4649915a90aa054a2
BLAKE2b-256 checksum
How to use checksums
ff8a01b4f451ccb8d517f96c931196c32ad3d59d3a2e1047c0aa1100410c9455
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.13.2 Darwin/24.3.0

Release history Release notifications | RSS feed

This release

2.21.0 This release

2 release files

2.17.0

2 release files

2.16.0

2 release files

2.15.0

2 release files

2.14.0

2 release files

2.12.0

2 release files

2.10.0

2 release files

2.9.0

2 release files

2.8.0

2 release files

2.7.0

2 release files

2.6.1

2 release files

2.6.0

2 release files

2.5.0

2 release files

2.4.0

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.1

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page