digital_twinning
A comprehensive Python package for digital twin model updating and predictive modeling using machine learning and uncertainty quantification techniques.
- Website: https://buildchain.ilab.sztaki.hu/
- Source code: https://github.com/TRACE-Structures/digital_twinning
- Bug reports: https://github.com/TRACE-Structures/digital_twinning/issues
Overview
The Digital Twinning package provides tools for creating data-driven predictive models and updating them with measurement data using Bayesian inference (MCMC). It combines surrogate modeling, machine learning, and probabilistic model updating for structural health monitoring and digital twin applications.
Installation
pip install digital-twinning
Features
Predictive Models
- Deep Neural Networks (DNN): Flexible neural network architectures with customizable layers and activation functions
- Gradient Boosted Trees (GBT): Support for multiple implementations (XGBoost, CatBoost, LightGBM, scikit-learn)
- Linear Regression: Basic linear regression models for baseline comparisons
- gPCE Models: Generalized Polynomial Chaos Expansion for uncertainty quantification
Model Updating
- Bayesian Model Updating: MCMC-based parameter estimation using emcee
- Multi-Building Updates: Joint parameter estimation across multiple structures
- Prior and Posterior Analysis: Tools for analyzing parameter distributions
Model Interpretability
- SHAP Analysis: Feature importance and explanation using SHAP values
- Sobol Sensitivity Analysis: Global sensitivity analysis for parameter importance
- Visualization Tools: Comprehensive plotting utilities for model analysis
Key Classes
PredictiveModel
The base class for all predictive models. Supports training, prediction, cross-validation, and model interpretability.
Methods:
train(): Train the model with optional k-fold cross-validationpredict(): Make predictions on new dataget_shap_values(): Compute SHAP values for feature importanceget_sobol_sensitivity(): Perform Sobol sensitivity analysissave_model()/load_model(): Serialize and deserialize models
DigitalTwin
MCMC-based Bayesian model updating for parameter estimation.
Methods:
update(): Update parameters using measurement dataget_mean_and_var_of_posterior(): Get posterior statisticsget_MAP(): Get maximum a posteriori estimateloglikelihood(): Compute log-likelihood of measurementslogprior(): Compute log-prior of parameters
JointManager
Manage joint model updating for multiple buildings with shared parameters.
Methods:
update(): Perform joint update across all buildingsget_joint_paramset_and_indices(): Create joint parameter spacegenerate_joint_stdrn_simparamset(): Generate joint simulation parameter sets
DNNModel
Deep Neural Network implementation with PyTorch backend.
Features:
- Flexible architecture with customizable layers
- Multiple activation functions (ReLU, GELU, Tanh, etc.)
- Dropout regularization
- Early stopping
- GPU support
GBTModel
Gradient Boosted Decision Trees with multiple backend options.
Supported Backends:
- XGBoost
- CatBoost
- LightGBM
- scikit-learn GradientBoostingRegressor
Authors and acknowledgment
The code is developed by András Urbanics, Áron Friedman, Bence Popovics, Emese Vastag, Elmar Zander and Noémi Friedman in the TRACE-Structures group.
This work has been funded by the European Commission Horizon Europe Innovation Action project 101092052 BUILDCHAIN
License
This project is licensed under the GNU General Public License v3.0 (GPL-3.0-only). See the LICENSE file for details.
Related Projects
- gPCE_model: Generalized Polynomial Chaos Expansion
- uncertain_variables: Probabilistic variable management
Support
For issues, questions, or contributions, please refer to the project repository or contact the authors.
Release files for digital-twinning 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| digital_twinning-1.0.3.tar.gz | 73.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| digital_twinning-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 159.6 kB
Release files / digital_twinning-1.0.3.tar.gz
| Download URL | digital_twinning-1.0.3.tar.gz |
|---|---|
| Size | 73.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fa21a9139672cddebf9982319a007f98c656a3a077e92687d70d85c742041805
|
|
BLAKE2b-256 checksum How to use checksums |
9af5e358221c4dd8c4341d97b92469c4eb5426499c4d63953b3af787ca74f040
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency logRelease files / digital_twinning-1.0.3-py3-none-any.whl
| Download URL | digital_twinning-1.0.3-py3-none-any.whl |
|---|---|
| Size | 86.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3f6da9608e90423030b0d6486b176f15eacdfc4cfd36468423e43b281186a264
|
|
BLAKE2b-256 checksum How to use checksums |
f8beb2316d7cecb51aa0468f06a0905bd85d17dd542f8d8e85aa7530aac66220
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency log