autoemulate 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. autoemulate-0.1.0/LICENSE +21 -0
  2. autoemulate-0.1.0/PKG-INFO +115 -0
  3. autoemulate-0.1.0/README.md +86 -0
  4. autoemulate-0.1.0/autoemulate/__init__.py +0 -0
  5. autoemulate-0.1.0/autoemulate/compare.py +503 -0
  6. autoemulate-0.1.0/autoemulate/cross_validate.py +97 -0
  7. autoemulate-0.1.0/autoemulate/data_splitting.py +30 -0
  8. autoemulate-0.1.0/autoemulate/datasets.py +48 -0
  9. autoemulate-0.1.0/autoemulate/emulators/__init__.py +27 -0
  10. autoemulate-0.1.0/autoemulate/emulators/gaussian_process.py +129 -0
  11. autoemulate-0.1.0/autoemulate/emulators/gaussian_process_mogp.py +90 -0
  12. autoemulate-0.1.0/autoemulate/emulators/gradient_boosting.py +138 -0
  13. autoemulate-0.1.0/autoemulate/emulators/light_gbm.py +144 -0
  14. autoemulate-0.1.0/autoemulate/emulators/neural_net_sk.py +163 -0
  15. autoemulate-0.1.0/autoemulate/emulators/neural_net_torch.py +192 -0
  16. autoemulate-0.1.0/autoemulate/emulators/neural_networks/__init__.py +2 -0
  17. autoemulate-0.1.0/autoemulate/emulators/neural_networks/base.py +36 -0
  18. autoemulate-0.1.0/autoemulate/emulators/neural_networks/get_module.py +20 -0
  19. autoemulate-0.1.0/autoemulate/emulators/neural_networks/mlp.py +72 -0
  20. autoemulate-0.1.0/autoemulate/emulators/neural_networks/rbf.py +346 -0
  21. autoemulate-0.1.0/autoemulate/emulators/polynomials.py +96 -0
  22. autoemulate-0.1.0/autoemulate/emulators/random_forest.py +157 -0
  23. autoemulate-0.1.0/autoemulate/emulators/rbf.py +152 -0
  24. autoemulate-0.1.0/autoemulate/emulators/support_vector_machines.py +168 -0
  25. autoemulate-0.1.0/autoemulate/experimental_design.py +91 -0
  26. autoemulate-0.1.0/autoemulate/hyperparam_searching.py +174 -0
  27. autoemulate-0.1.0/autoemulate/logging_config.py +75 -0
  28. autoemulate-0.1.0/autoemulate/metrics.py +36 -0
  29. autoemulate-0.1.0/autoemulate/model_processing.py +148 -0
  30. autoemulate-0.1.0/autoemulate/plotting.py +340 -0
  31. autoemulate-0.1.0/autoemulate/printing.py +156 -0
  32. autoemulate-0.1.0/autoemulate/save.py +107 -0
  33. autoemulate-0.1.0/autoemulate/simulations/__init__.py +0 -0
  34. autoemulate-0.1.0/autoemulate/simulations/epidemic.py +55 -0
  35. autoemulate-0.1.0/autoemulate/simulations/projectile.py +223 -0
  36. autoemulate-0.1.0/autoemulate/utils.py +473 -0
  37. autoemulate-0.1.0/pyproject.toml +56 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 The Alan Turing Institute
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,115 @@
1
+ Metadata-Version: 2.1
2
+ Name: autoemulate
3
+ Version: 0.1.0
4
+ Summary: An emulator platform for Digital Twins
5
+ License: MIT
6
+ Author: Martin Stoffel
7
+ Author-email: mstoffel@turing.ac.uk
8
+ Requires-Python: >=3.10,<3.13
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Provides-Extra: docs
14
+ Requires-Dist: iprogress (>=0.4,<0.5)
15
+ Requires-Dist: ipywidgets (>=8.1.2,<9.0.0)
16
+ Requires-Dist: joblib (>=1.3.2,<2.0.0)
17
+ Requires-Dist: lightgbm (>=4.3.0,<5.0.0)
18
+ Requires-Dist: matplotlib (>=3.7.2,<4.0.0)
19
+ Requires-Dist: mogp-emulator (>=0.7.2,<0.8.0)
20
+ Requires-Dist: numpy (>=1.24,<2.0)
21
+ Requires-Dist: pandas (>=2.1,<3.0)
22
+ Requires-Dist: scikit-learn (>=1.3.0,<2.0.0)
23
+ Requires-Dist: scikit-optimize (>=0.9.0,<0.10.0)
24
+ Requires-Dist: scipy (>=1.11.3,<2.0.0)
25
+ Requires-Dist: skorch (>=0.15.0,<0.16.0)
26
+ Requires-Dist: torch (>=2.1.0,<3.0.0)
27
+ Requires-Dist: tqdm (>=4.66.2,<5.0.0)
28
+ Description-Content-Type: text/markdown
29
+
30
+ # AutoEmulate
31
+
32
+ ![CI](https://github.com/alan-turing-institute/autoemulate/actions/workflows/ci.yaml/badge.svg)
33
+ [![codecov](https://codecov.io/gh/alan-turing-institute/autoemulate/graph/badge.svg?token=XD1HXQUIGK)](https://codecov.io/gh/alan-turing-institute/autoemulate)
34
+ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
35
+ [![All Contributors](https://img.shields.io/github/all-contributors/alan-turing-institute/autoemulate?color=ee8449&style=flat-square)](#contributors)
36
+
37
+ <!-- SPHINX-START -->
38
+
39
+ Simulations of physical systems are often slow and need lots of compute, which makes them unpractical for applications like digital twins, or when they have to run thousands of times to do uncertainty quantification or sensitivity analyses. The goal of `AutoEmulate` is to make it easy to replace simulations with fast, accurate emulators. To do this, `AutoEmulate` automatically fits and compares lots of models, like *Radial Basis Functions*, *Gaussian Processes* or *Neural Networks* to find the best emulator for a simulation.
40
+
41
+ The project is in early development.
42
+
43
+ <img src="https://raw.githubusercontent.com/alan-turing-institute/autoemulate/main/misc/robot2.png" alt="" width="38.2%">
44
+
45
+ ## installation
46
+
47
+ ```bash
48
+ pip install autoemulate
49
+ ```
50
+
51
+ development version from GitHub:
52
+
53
+ ```bash
54
+ pip install git+https://github.com/alan-turing-institute/autoemulate.git
55
+ ```
56
+
57
+ or for contributors using [Poetry](https://python-poetry.org/):
58
+
59
+ ```bash
60
+ git clone https://github.com/alan-turing-institute/autoemulate.git
61
+ cd autoemulate
62
+ poetry install
63
+ ```
64
+
65
+ ## quick start
66
+
67
+ ```python
68
+ import numpy as np
69
+ from autoemulate.compare import AutoEmulate
70
+ from autoemulate.experimental_design import LatinHypercube
71
+ from autoemulate.simulations.projectile import simulate_projectile
72
+
73
+ # sample from a simulation
74
+ lhd = LatinHypercube([(-5., 1.), (0., 1000.)])
75
+ X = lhd.sample(100)
76
+ y = np.array([simulate_projectile(x) for x in X])
77
+ # compare emulator models
78
+ ae = AutoEmulate()
79
+ ae.setup(X, y)
80
+ best_model = ae.compare()
81
+ # training set cross-validation results
82
+ ae.print_results()
83
+ # test set results for the best model
84
+ ae.evaluate_model(best_model)
85
+ # refit on full data
86
+ best_emulator = ae.refit_model(best_model)
87
+ # emulate
88
+ best_emulator.predict(X)
89
+ ```
90
+
91
+ ## documentation
92
+
93
+ You can find tutorials, FAQs and the API reference [here](https://alan-turing-institute.github.io/autoemulate/). The documentation is still work in progress.
94
+
95
+ ## Contributors
96
+
97
+ <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
98
+ <!-- prettier-ignore-start -->
99
+ <!-- markdownlint-disable -->
100
+ <table>
101
+ <tbody>
102
+ <tr>
103
+ <td align="center" valign="top" width="14.28%"><a href="http://www.westerling.nu"><img src="https://avatars.githubusercontent.com/u/7298727?v=4?s=100" width="100px;" alt="Kalle Westerling"/><br /><sub><b>Kalle Westerling</b></sub></a><br /><a href="#doc-kallewesterling" title="Documentation">📖</a> <a href="#code-kallewesterling" title="Code">💻</a> <a href="#content-kallewesterling" title="Content">🖋</a></td>
104
+ <td align="center" valign="top" width="14.28%"><a href="https://bryanli.io"><img src="https://avatars.githubusercontent.com/u/9648242?v=4?s=100" width="100px;" alt="Bryan M. Li"/><br /><sub><b>Bryan M. Li</b></sub></a><br /><a href="#code-bryanlimy" title="Code">💻</a></td>
105
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/mastoffel"><img src="https://avatars.githubusercontent.com/u/7348440?v=4?s=100" width="100px;" alt="martin"/><br /><sub><b>martin</b></sub></a><br /><a href="#code-mastoffel" title="Code">💻</a> <a href="#ideas-mastoffel" title="Ideas, Planning, & Feedback">🤔</a> <a href="#doc-mastoffel" title="Documentation">📖</a> <a href="#maintenance-mastoffel" title="Maintenance">🚧</a> <a href="#research-mastoffel" title="Research">🔬</a> <a href="#review-mastoffel" title="Reviewed Pull Requests">👀</a></td>
106
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/edaub"><img src="https://avatars.githubusercontent.com/u/45598892?v=4?s=100" width="100px;" alt="Eric Daub"/><br /><sub><b>Eric Daub</b></sub></a><br /><a href="#ideas-edaub" title="Ideas, Planning, & Feedback">🤔</a> <a href="#projectManagement-edaub" title="Project Management">📆</a> <a href="#review-edaub" title="Reviewed Pull Requests">👀</a> <a href="#code-edaub" title="Code">💻</a></td>
107
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/snie007"><img src="https://avatars.githubusercontent.com/u/20723650?v=4?s=100" width="100px;" alt="steven niederer"/><br /><sub><b>steven niederer</b></sub></a><br /><a href="#ideas-snie007" title="Ideas, Planning, & Feedback">🤔</a> <a href="#content-snie007" title="Content">🖋</a> <a href="#projectManagement-snie007" title="Project Management">📆</a></td>
108
+ </tr>
109
+ </tbody>
110
+ </table>
111
+
112
+ <!-- markdownlint-restore -->
113
+ <!-- prettier-ignore-end -->
114
+
115
+ <!-- ALL-CONTRIBUTORS-LIST:END -->
@@ -0,0 +1,86 @@
1
+ # AutoEmulate
2
+
3
+ ![CI](https://github.com/alan-turing-institute/autoemulate/actions/workflows/ci.yaml/badge.svg)
4
+ [![codecov](https://codecov.io/gh/alan-turing-institute/autoemulate/graph/badge.svg?token=XD1HXQUIGK)](https://codecov.io/gh/alan-turing-institute/autoemulate)
5
+ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
6
+ [![All Contributors](https://img.shields.io/github/all-contributors/alan-turing-institute/autoemulate?color=ee8449&style=flat-square)](#contributors)
7
+
8
+ <!-- SPHINX-START -->
9
+
10
+ Simulations of physical systems are often slow and need lots of compute, which makes them unpractical for applications like digital twins, or when they have to run thousands of times to do uncertainty quantification or sensitivity analyses. The goal of `AutoEmulate` is to make it easy to replace simulations with fast, accurate emulators. To do this, `AutoEmulate` automatically fits and compares lots of models, like *Radial Basis Functions*, *Gaussian Processes* or *Neural Networks* to find the best emulator for a simulation.
11
+
12
+ The project is in early development.
13
+
14
+ <img src="https://raw.githubusercontent.com/alan-turing-institute/autoemulate/main/misc/robot2.png" alt="" width="38.2%">
15
+
16
+ ## installation
17
+
18
+ ```bash
19
+ pip install autoemulate
20
+ ```
21
+
22
+ development version from GitHub:
23
+
24
+ ```bash
25
+ pip install git+https://github.com/alan-turing-institute/autoemulate.git
26
+ ```
27
+
28
+ or for contributors using [Poetry](https://python-poetry.org/):
29
+
30
+ ```bash
31
+ git clone https://github.com/alan-turing-institute/autoemulate.git
32
+ cd autoemulate
33
+ poetry install
34
+ ```
35
+
36
+ ## quick start
37
+
38
+ ```python
39
+ import numpy as np
40
+ from autoemulate.compare import AutoEmulate
41
+ from autoemulate.experimental_design import LatinHypercube
42
+ from autoemulate.simulations.projectile import simulate_projectile
43
+
44
+ # sample from a simulation
45
+ lhd = LatinHypercube([(-5., 1.), (0., 1000.)])
46
+ X = lhd.sample(100)
47
+ y = np.array([simulate_projectile(x) for x in X])
48
+ # compare emulator models
49
+ ae = AutoEmulate()
50
+ ae.setup(X, y)
51
+ best_model = ae.compare()
52
+ # training set cross-validation results
53
+ ae.print_results()
54
+ # test set results for the best model
55
+ ae.evaluate_model(best_model)
56
+ # refit on full data
57
+ best_emulator = ae.refit_model(best_model)
58
+ # emulate
59
+ best_emulator.predict(X)
60
+ ```
61
+
62
+ ## documentation
63
+
64
+ You can find tutorials, FAQs and the API reference [here](https://alan-turing-institute.github.io/autoemulate/). The documentation is still work in progress.
65
+
66
+ ## Contributors
67
+
68
+ <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
69
+ <!-- prettier-ignore-start -->
70
+ <!-- markdownlint-disable -->
71
+ <table>
72
+ <tbody>
73
+ <tr>
74
+ <td align="center" valign="top" width="14.28%"><a href="http://www.westerling.nu"><img src="https://avatars.githubusercontent.com/u/7298727?v=4?s=100" width="100px;" alt="Kalle Westerling"/><br /><sub><b>Kalle Westerling</b></sub></a><br /><a href="#doc-kallewesterling" title="Documentation">📖</a> <a href="#code-kallewesterling" title="Code">💻</a> <a href="#content-kallewesterling" title="Content">🖋</a></td>
75
+ <td align="center" valign="top" width="14.28%"><a href="https://bryanli.io"><img src="https://avatars.githubusercontent.com/u/9648242?v=4?s=100" width="100px;" alt="Bryan M. Li"/><br /><sub><b>Bryan M. Li</b></sub></a><br /><a href="#code-bryanlimy" title="Code">💻</a></td>
76
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/mastoffel"><img src="https://avatars.githubusercontent.com/u/7348440?v=4?s=100" width="100px;" alt="martin"/><br /><sub><b>martin</b></sub></a><br /><a href="#code-mastoffel" title="Code">💻</a> <a href="#ideas-mastoffel" title="Ideas, Planning, & Feedback">🤔</a> <a href="#doc-mastoffel" title="Documentation">📖</a> <a href="#maintenance-mastoffel" title="Maintenance">🚧</a> <a href="#research-mastoffel" title="Research">🔬</a> <a href="#review-mastoffel" title="Reviewed Pull Requests">👀</a></td>
77
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/edaub"><img src="https://avatars.githubusercontent.com/u/45598892?v=4?s=100" width="100px;" alt="Eric Daub"/><br /><sub><b>Eric Daub</b></sub></a><br /><a href="#ideas-edaub" title="Ideas, Planning, & Feedback">🤔</a> <a href="#projectManagement-edaub" title="Project Management">📆</a> <a href="#review-edaub" title="Reviewed Pull Requests">👀</a> <a href="#code-edaub" title="Code">💻</a></td>
78
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/snie007"><img src="https://avatars.githubusercontent.com/u/20723650?v=4?s=100" width="100px;" alt="steven niederer"/><br /><sub><b>steven niederer</b></sub></a><br /><a href="#ideas-snie007" title="Ideas, Planning, & Feedback">🤔</a> <a href="#content-snie007" title="Content">🖋</a> <a href="#projectManagement-snie007" title="Project Management">📆</a></td>
79
+ </tr>
80
+ </tbody>
81
+ </table>
82
+
83
+ <!-- markdownlint-restore -->
84
+ <!-- prettier-ignore-end -->
85
+
86
+ <!-- ALL-CONTRIBUTORS-LIST:END -->
File without changes