twinLab - Probabilistic Machine Learning for Engineers
Project description
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.
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
Built Distribution
File details
Details for the file twinlab-2.14.0.tar.gz
.
File metadata
- Download URL: twinlab-2.14.0.tar.gz
- Upload date:
- Size: 46.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.3 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e249bdd2cffabb569f66e1ee10810f8a6045b06c2652f3ca3c6d8dfc3ef8308 |
|
MD5 | aaddca2c78be94fecb013e94cd33369a |
|
BLAKE2b-256 | ee8a71ada800453bb0805292a13ff663fd52e3807d1d1a2cfb5bc228b1a26726 |
File details
Details for the file twinlab-2.14.0-py3-none-any.whl
.
File metadata
- Download URL: twinlab-2.14.0-py3-none-any.whl
- Upload date:
- Size: 52.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.3 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e42fbe350e3e3849593c8eb55e39ec26e05999c2f8dc8198de91f53494046cbf |
|
MD5 | 78f799247fe555d417e4529070741752 |
|
BLAKE2b-256 | 81a7dd7c789f44ecb39a4f0d23b164e97321c8459d358809794e6ef1a015ad47 |