UQPyL 2.1.2__tar.gz → 2.1.3__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 (134) hide show
  1. {UQPyL-2.1.2 → UQPyL-2.1.3}/PKG-INFO +205 -137
  2. {UQPyL-2.1.2 → UQPyL-2.1.3}/README.md +204 -136
  3. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/DoE/samplerABC.py +1 -0
  4. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/__init__.py +1 -1
  5. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/multi_objective/moea_d.py +1 -2
  6. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/multi_objective/nsga_ii.py +1 -1
  7. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/multi_objective/nsga_iii.py +1 -1
  8. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/multi_objective/rvea.py +1 -1
  9. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/result.py +1 -1
  10. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/problems/single_objective/single_simple_problem.py +1 -1
  11. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/mars/core/_basis.c +180 -198
  12. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/mars/core/_forward.c +180 -198
  13. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/mars/core/_knot_search.c +180 -198
  14. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/mars/core/_pruning.c +180 -198
  15. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/mars/core/_qr.c +180 -198
  16. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/mars/core/_record.c +180 -198
  17. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/mars/core/_types.c +180 -198
  18. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/mars/core/_util.c +180 -198
  19. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/regression/lasso/lasso_fast.c +181 -199
  20. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL.egg-info/PKG-INFO +205 -137
  21. {UQPyL-2.1.2 → UQPyL-2.1.3}/pyproject.toml +1 -1
  22. {UQPyL-2.1.2 → UQPyL-2.1.3}/setup.py +1 -1
  23. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/DoE/__init__.py +0 -0
  24. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/DoE/fast_sequence.py +0 -0
  25. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/DoE/full_fact.py +0 -0
  26. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/DoE/lhs.py +0 -0
  27. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/DoE/morris_sequence.py +0 -0
  28. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/DoE/random.py +0 -0
  29. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/DoE/saltelli_sequence.py +0 -0
  30. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/DoE/sobol_sequence.py +0 -0
  31. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/__init__.py +0 -0
  32. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/algorithmABC.py +0 -0
  33. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/metric/__init__.py +0 -0
  34. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/metric/gd.py +0 -0
  35. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/metric/hv.py +0 -0
  36. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/metric/igd.py +0 -0
  37. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/multi_objective/__init__.py +0 -0
  38. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/multi_objective/moasmo.py +0 -0
  39. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/population.py +0 -0
  40. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/single_objective/__init__.py +0 -0
  41. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/single_objective/abc.py +0 -0
  42. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/single_objective/asmo.py +0 -0
  43. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/single_objective/csa.py +0 -0
  44. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/single_objective/de.py +0 -0
  45. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/single_objective/ego.py +0 -0
  46. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/single_objective/ga.py +0 -0
  47. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/single_objective/ml_sce_ua.py +0 -0
  48. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/single_objective/pso.py +0 -0
  49. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/single_objective/sce_ua.py +0 -0
  50. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/utility_functions/__init__.py +0 -0
  51. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/utility_functions/crowding_distance.py +0 -0
  52. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/utility_functions/ndsort.py +0 -0
  53. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/utility_functions/operation_GA.py +0 -0
  54. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/utility_functions/tournament_selection.py +0 -0
  55. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/optimization/utility_functions/uniform_point.py +0 -0
  56. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/problems/__init__.py +0 -0
  57. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/problems/multi_objective/DTLZ.py +0 -0
  58. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/problems/multi_objective/ZDT.py +0 -0
  59. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/problems/multi_objective/__init__.py +0 -0
  60. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/problems/problem.py +0 -0
  61. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/problems/problemABC.py +0 -0
  62. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/problems/single_objective/__init__.py +0 -0
  63. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/problems/single_objective/single_constraint_problem.py +0 -0
  64. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/problems/utility_functions/NDsort.py +0 -0
  65. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/problems/utility_functions/__init__.py +0 -0
  66. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/problems/utility_functions/uniformPoint.py +0 -0
  67. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/sensibility/__init__.py +0 -0
  68. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/sensibility/delta_test.py +0 -0
  69. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/sensibility/fast.py +0 -0
  70. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/sensibility/mars_sa.py +0 -0
  71. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/sensibility/morris.py +0 -0
  72. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/sensibility/rbd_fast.py +0 -0
  73. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/sensibility/rsa.py +0 -0
  74. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/sensibility/saABC.py +0 -0
  75. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/sensibility/sobol.py +0 -0
  76. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/__init__.py +0 -0
  77. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/auto_tuner.py +0 -0
  78. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/fnn/__init__.py +0 -0
  79. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/fnn/_activation_funcs.py +0 -0
  80. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/fnn/base.py +0 -0
  81. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/fnn/fully_connect_neural_network.py +0 -0
  82. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/gp/__init__.py +0 -0
  83. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/gp/gaussian_process.py +0 -0
  84. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/gp/kernel/__init__.py +0 -0
  85. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/gp/kernel/base_kernel.py +0 -0
  86. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/gp/kernel/c_kernel_.py +0 -0
  87. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/gp/kernel/dot_kernel_.py +0 -0
  88. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/gp/kernel/matern_kernel.py +0 -0
  89. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/gp/kernel/rbf_kernel.py +0 -0
  90. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/gp/kernel/rq_kernel.py +0 -0
  91. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/kriging/__init__.py +0 -0
  92. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/kriging/kernel/__init__.py +0 -0
  93. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/kriging/kernel/base_kernel.py +0 -0
  94. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/kriging/kernel/cubic_kernel.py +0 -0
  95. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/kriging/kernel/exp_kernel.py +0 -0
  96. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/kriging/kernel/guass_kernel.py +0 -0
  97. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/kriging/kriging.py +0 -0
  98. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/mars/__init__.py +0 -0
  99. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/mars/core/__init__.py +0 -0
  100. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/mars/mars.py +0 -0
  101. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/rbf/__init__.py +0 -0
  102. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/rbf/kernel/__init__.py +0 -0
  103. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/rbf/kernel/base_kernel.py +0 -0
  104. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/rbf/kernel/cubic_kernel.py +0 -0
  105. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/rbf/kernel/gaussian_kernel.py +0 -0
  106. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/rbf/kernel/linear_kernel.py +0 -0
  107. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/rbf/kernel/multiquadric_kernel.py +0 -0
  108. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/rbf/kernel/thin_plate_spline_kernel.py +0 -0
  109. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/rbf/radial_basis_function.py +0 -0
  110. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/regression/__init__.py +0 -0
  111. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/regression/lasso/__init__.py +0 -0
  112. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/regression/linear_regression.py +0 -0
  113. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/regression/polynomial_regression.py +0 -0
  114. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/setting.py +0 -0
  115. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/surrogateABC.py +0 -0
  116. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/svr/__init__.py +0 -0
  117. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/svr/core/__init__.py +0 -0
  118. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/svr/core/libsvm_interface.cpp +0 -0
  119. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/svr/core/svm.cpp +0 -0
  120. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/svr/support_vector_machine.py +0 -0
  121. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/util/__init__.py +0 -0
  122. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/util/adam.py +0 -0
  123. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/surrogates/util/boxmin.py +0 -0
  124. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/utility/__init__.py +0 -0
  125. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/utility/data_selections.py +0 -0
  126. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/utility/metrics.py +0 -0
  127. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/utility/polynomial_features.py +0 -0
  128. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/utility/scalers.py +0 -0
  129. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL/utility/verbose.py +0 -0
  130. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL.egg-info/SOURCES.txt +0 -0
  131. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL.egg-info/dependency_links.txt +0 -0
  132. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL.egg-info/requires.txt +0 -0
  133. {UQPyL-2.1.2 → UQPyL-2.1.3}/UQPyL.egg-info/top_level.txt +0 -0
  134. {UQPyL-2.1.2 → UQPyL-2.1.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: UQPyL
3
- Version: 2.1.2
3
+ Version: 2.1.3
4
4
  Summary: A python package for parameter uncertainty quantification and optimization
5
5
  Author: wmtSky
6
6
  Author-email: wmtSky <wmtsky@hhu.edu.cn>
@@ -16,13 +16,15 @@ Description-Content-Type: text/markdown
16
16
 
17
17
  # UQPyL: Uncertainty Quantification Python Lab
18
18
 
19
- <p align="center"><img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/UQ.svg" width="400"/></p>
19
+ <p align="center"><img src="./docs/UQ.svg" width="400"/></p>
20
20
 
21
21
  [![PyPI version](https://badge.fury.io/py/UQPyL.svg?icon=si%3Apython&icon_color=%2331aadd)](https://badge.fury.io/py/UQPyL) ![PyPI - Downloads](https://img.shields.io/pypi/dm/UQPyL) ![PyPI - License](https://img.shields.io/pypi/l/UQPyL) ![GitHub last commit](https://img.shields.io/github/last-commit/smasky/UQPyL) ![Static Badge](https://img.shields.io/badge/Author-wmtSky-orange) ![Static Badge](https://img.shields.io/badge/Contact-wmtsmasky%40gmail.com-blue)
22
22
 
23
23
  **UQPyL** is a Python package for **Uncertainty Quantification** and **Optimization** of computational models and their associated problems (e.g., model calibration, resource scheduling, product design). It includes a wide range of methods and algorithms for Design of Experiments, Sensitivity Analysis, Optimization (Single- and Multi-objective). Additionally, **Surrogate Models** are built-in for solving computationally expensive problems.
24
24
 
25
- 👉[中文文档](./README_CN.md)
25
+ 👉[中文简介](https://github.com/smasky/UQPyL/blob/dev/README_CN.md)
26
+
27
+ 👉[Documentation](https://uqpyl.readthedocs.io/en/latest/)
26
28
 
27
29
  ## Contents
28
30
 
@@ -41,10 +43,10 @@ Description-Content-Type: text/markdown
41
43
 
42
44
 
43
45
  ## ✨ Main Features
44
- 1. **Comprehensive Sensitivity Analysis and Optimization**: Implements widely used sensitivity analysis methodologies and optimization algorithms.
46
+ 1. **Comprehensive Sensitivity Analysis and Optimization**: Implements widely used sensitivity analysis methods and optimization algorithms.
45
47
  2. **Running Display and Result Save**: Enable users to track and save the history and results of their running.
46
- 3. **Advanced Surrogate Modeling**: Integrates diverse surrogate models and auto-tunning tool to enhance these model performances.
47
- 4. **Rich Application Resources**: Provides a comprehensive suite of benchmark problems and practical case studies, enabling users to get started quickly. (👉**Recent Planing:** For water science research, we plan to customize the interface to integrate water-related models with UQPyL, enhancing usability and functionality, like [SWAT-UQ](https://github.com/smasky/SWAT-UQ). So, **if you have interest, please contact us to collaborate.**).
48
+ 3. **Advanced Surrogate Modeling**: Integrate various surrogate models and an auto-tunning tool to enhance these model performances.
49
+ 4. **Rich Application Resources**: Provides a suite of benchmark problems and practical case studies, enabling users to get started quickly. (👉**Recent Planing:** For water science research, we plan to customize the interface to integrate water-related models with UQPyL, enhancing usability and functionality, like [SWAT-UQ](https://github.com/smasky/SWAT-UQ). So, **if you have interest, please contact us to collaborate.**).
48
50
  5. **Modular and Extensible Architecture**: Encourages and facilitates the development of novel methods or algorithms by users, aligning with our commitment to openness and collaboration. (**We appreciate and welcome contributions**)
49
51
 
50
52
  ## ⚙️ Installation
@@ -73,8 +75,8 @@ pip install .
73
75
 
74
76
  - **Website**: [UQPyL Official Site](http://www.uq-pyl.com) (**TODO**: Needs update)
75
77
  - **Source Code**: [GitHub Repository](https://github.com/smasky/UQPyL/)
76
- - **Documentation**: [ReadTheDocs](https://uqpyl.readthedocs.io/en/latest/) (**TODO**: Being updating )
77
- - **Citation Infos**: [UQPyL 2.0](**TODO**: Needs update), [UQPyL 1.0](https://www.sciencedirect.com/science/article/pii/S1364815215300955)
78
+ - **Documentation**: [ReadTheDocs](https://uqpyl.readthedocs.io/en/latest/)
79
+ - **Citation Infos**: [UQPyL 2.0](Future update), [UQPyL 1.0](https://www.sciencedirect.com/science/article/pii/S1364815215300955)
78
80
 
79
81
  ---
80
82
 
@@ -92,7 +94,7 @@ pip install .
92
94
  |Morris| \ |[Morris, (2012)](https://www.tandfonline.com/doi/abs/10.1080/00401706.1991.10484804)|
93
95
  |RSA| Regional Sensitivity Analysis | [Hornberger, Spear, (1981)](https://www.osti.gov/biblio/6396608), [Pianosi (2016)](https://www.sciencedirect.com/science/article/pii/S1364815216300287) |
94
96
 
95
- 💡 **Noted:** All methods now support for using surrogate models.
97
+ 💡 **Noted:** All methods now support for integrating surrogate models. (Please check [this tutorial](https://uqpyl.readthedocs.io/en/latest/surrogate_model.html#sensitivity-analysis-with-surrogate-models))
96
98
 
97
99
  🚀 **Credits:** Special thanks to the [SALib](https://github.com/SALib/SALib) project for inspiring parts of the implementation.
98
100
 
@@ -108,7 +110,7 @@ pip install .
108
110
  | DE | Differential Evolution | Single | [Storn and Price (1997)](https://link.springer.com/article/10.1023/a:1008202821328) |
109
111
  | ABC |Artificial Bee Colony | Single | [Karaboga (2005)](https://abc.erciyes.edu.tr/pub/tr06_2005.pdf) |
110
112
  | ASMO | Adaptive Surrogate Modelling based Optimization | Single, Surrogate | [Wang et al.(2014)](https://www.sciencedirect.com/science/article/pii/S1364815214001698) |
111
- | EGO | Efficient Global Optimization | Single, Surrogate | [Jones (1998)](https://link.springer.com/article/10.1023/A:1008306431147)
113
+ | EGO | Efficient Global Optimization | Single, Surrogate | [Jones (1998)](https://link.springer.com/article/10.1023/A:1008306431147) |
112
114
  | MOEA/D | Multi-objective Evolutionary Algorithm based on Decomposition | Multiple | [Zhang, Li (2007)](https://ieeexplore.ieee.org/document/4358754)|
113
115
  | NSGA-II| Nondominated Sorting Genetic Algorithm II | Multiple | [Deb et al. (2002)](https://ieeexplore.ieee.org/document/996017)|
114
116
  | NSGA-III| Nondominated Sorting Genetic Algorithm III| Multiple | [Deb, Jain (2014)](https://ieeexplore.ieee.org/document/6600851)|
@@ -137,21 +139,21 @@ pip install .
137
139
 
138
140
  | Name | Formula | Optimal Solution | Optima |
139
141
  |------|---------|------------------|--------|
140
- |Sphere| <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Sphere.svg" /> | ( 0, 0, 0 ... 0 ) | 0.0 |
141
- |Schwefel_2_22| <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Schwefel_2_22.svg" /> | ( 0, 0, 0 ... 0 ) | 0.0 |
142
- |Schwefel_1_22| <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Schwefel_1_22.svg" /> | ( 0, 0, 0 ... 0 ) | 0.0 |
143
- |Schwefel_2_21| <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Schwefel_2_21.svg" /> | ( 0, 0, 0 ... 0 ) | 0.0 |
144
- |Schwefel_2_26 | <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Schwefel_2_26.svg" /> | (420.9687 ... 420.9687) | -12569.5 |
145
- | Rosenbrock | <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Rosenbrock.svg" /> | ( 0, 0, 0 ... 0 ) | 0.0 |
146
- | Step | <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Step.svg" /> | ( 1, 1, 1 ... 1) | 0.0 |
147
- | Quartic | <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Quartic.svg" /> | ( 1, 1, 1 ... 1) | 0.0 |
148
- | Rastrigin | <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Rastrigin.svg" /> | ( 0, 0, 0 ... 0 ) | 0.0 |
149
- | Ackley | <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Ackley.svg" /> | ( 0, 0, 0 ... 0 ) | 0.0 |
150
- | Griewank | <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Griewank.svg" /> | ( 0, 0, 0 ... 0) | 0.0 |
151
- | Trid | <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Trid.svg" /> | <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Trid_solution.svg">| `-D(D+4)(D-1)/6` |
152
- | Bent_Cigar | <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Bent_Cigar.svg" /> |(0, 0, 0 ... 0) | 0.0 |
153
- | Discus | <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Discus.svg" /> | (0, 0, 0 ... 0) | 0.0 |
154
- | Weierstrass | <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Weierstrass.svg" /> | (0, 0, 0 ... 0) | 0.0 |
142
+ |Sphere| <img src="./docs/pic/Sphere.svg" /> | ( 0, 0, 0 ... 0 ) | 0.0 |
143
+ |Schwefel_2_22| <img src="./docs/pic/Schwefel_2_22.svg" /> | ( 0, 0, 0 ... 0 ) | 0.0 |
144
+ |Schwefel_1_22| <img src="./docs/pic/Schwefel_1_22.svg" /> | ( 0, 0, 0 ... 0 ) | 0.0 |
145
+ |Schwefel_2_21| <img src="./docs/pic/Schwefel_2_21.svg" /> | ( 0, 0, 0 ... 0 ) | 0.0 |
146
+ |Schwefel_2_26 | <img src="./docs/pic/Schwefel_2_26.svg" /> | (420.9687 ... 420.9687) | -12569.5 |
147
+ | Rosenbrock | <img src="./docs/pic/Rosenbrock.svg" /> | ( 0, 0, 0 ... 0 ) | 0.0 |
148
+ | Step | <img src="./docs/pic/Step.svg" /> | ( 1, 1, 1 ... 1) | 0.0 |
149
+ | Quartic | <img src="./docs/pic/Quartic.svg" /> | ( 1, 1, 1 ... 1) | 0.0 |
150
+ | Rastrigin | <img src="./docs/pic/Rastrigin.svg" /> | ( 0, 0, 0 ... 0 ) | 0.0 |
151
+ | Ackley | <img src="./docs/pic/Ackley.svg" /> | ( 0, 0, 0 ... 0 ) | 0.0 |
152
+ | Griewank | <img src="./docs/pic/Griewank.svg" /> | ( 0, 0, 0 ... 0) | 0.0 |
153
+ | Trid | <img src="./docs/pic/Trid.svg" /> | <img src="docs/pic/Trid_solution.svg">| `-D(D+4)(D-1)/6` |
154
+ | Bent_Cigar | <img src="./docs/pic/Bent_Cigar.svg" /> |(0, 0, 0 ... 0) | 0.0 |
155
+ | Discus | <img src="./docs/pic/Discus.svg" /> | (0, 0, 0 ... 0) | 0.0 |
156
+ | Weierstrass | <img src="./docs/pic/Weierstrass.svg" /> | (0, 0, 0 ... 0) | 0.0 |
155
157
 
156
158
  ### Multi-objective Problems
157
159
 
@@ -178,140 +180,189 @@ pip install .
178
180
 
179
181
  ## 🍭 Quick Start
180
182
 
181
- To effectively use UQPyL, the **first step** is to define the problem you solve:
182
- 1. The **basic information** of the problem, e.g., the dimension, range, value type (float, int, or discrete) of each variable, name of the problem, decisions, objectives.
183
- 2. The **function** from input variables `x` to output objective `obj` named `objFunc` in UQPyL, i.e., how the output `obj` is obtained from the inputs `x`, which could be an analytical function, or include running computational model, external black-box process. If necessary, the constraint functions named `concFunc` should be implemented.
183
+ To effectively use UQPyL, the key is to define the solved problem, including:
184
184
 
185
- Following problem is a variant of the Rosenbrock function, which adds additional constraint functions ($x_1^2+x_2^2+x_3^2 \ge 4$) and changes the variable types, from the origin `continuous` and `float` to `int` ($x_2$) and `discrete` ($x_3$). Take this as an example to illustrate the specific steps of problem definition.
185
+ 1. The **basic information** of the problem, e.g., the dimension, range, type (float, int, or discrete) of each variable, the name of the problem, decisions, objectives, constraints.
186
186
 
187
- <p align="center"><img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Problem1.svg" width=500/></p>
187
+ 2. The **objective function** that describe how the output `obj` is obtained from the inputs `x`, referred to as `objFunc` in UQPyL. The `objFunc` can be a mathematical formula, computational model with pre- and post-processing, or external black-box process.
188
188
 
189
- UQPyL provide a python class named `Problem` to simplify the workflow of defining problems.
189
+ 3. If required, the **constraint function** should be implemented, referred to as `conFunc`, which contains one or more constraints that the inputs x must satisfy.
190
190
 
191
+ Take the variant of the Rosenbrock function as example:
191
192
 
192
- <a href="https://nbviewer.org/github/smasky/UQPyL/blob/dev/notebooks/defefine_problem.ipynb" target="_blank">📘 View Jupyter Notebook example online </a>
193
+ <p align="center"><img src="./docs/pic/Problem1.svg" width=500/></p>
194
+
195
+ Compared to original Rosenbrock, this problem involve extra constraint functions ( $x_1^2+x_2^2+x_3^2 \ge 4$ ) and changes the variable types, from the origin `continuous` and `float` to `int` ( $x_2$ ) and `discrete` ( $x_3$ ).
193
196
 
197
+ Now, we use this problem to specifically introducing:
198
+
199
+ <a href="https://nbviewer.org/github/smasky/UQPyL/blob/dev/notebooks/defefine_problem.ipynb" target="_blank">📘 View Jupyter Notebook example online </a>
194
200
 
195
201
  ```python
196
- # Step 1: import Problem class from UQPyL's problem module
202
+ # For simplifying the process of defining problem, UQPyL provide a `Problem` class
203
+
204
+ # Step 1: Import `Problem` class from the `problems` module of UQPyL
197
205
  from UQPyL.problems import Problem
198
206
 
199
- # Step 2: define objFunc Function
200
- # The 'objFunc' function is one that accepts a 2D numpy array 'X' as input and returns a 2D numpy array 'objs'. Specifically:
201
- # The rows of the 2D array 'X' represent a set of decision variables, while the columns correspond to different values of the same variable.
202
- # The returned 2D array 'objs' should have the same number of rows as 'X', and the number of columns should equal the number of objectives in the problem.
203
- # For a single-objective problem, the shape of the 2D array 'objs' should be (N, 1), where 'N' is the number of input variables.
204
- # For a multi-objective problem, the shape of the 2D array 'objs' should be (N, M), where 'M' is the number of objective functions.
205
- # Users should ensure that the returned 2D array 'objs' satisfies the above shape requirements.
207
+ # Step 2: Defining the `objFunc` function
208
+ # The `objFunc` function takes a 2-dimensional(2D) NumPy array `X` as input and
209
+ # returns a 2D NumPy array `objs` as output.
210
+ #
211
+ # Input:
212
+ # X = [ [1, 2, 3], # Each row represents a decision (or solution)
213
+ # [4, 5, 6], # Each column represents a specific variable
214
+ # [7, 8, 9] ]
215
+ #
216
+ # Output:
217
+ # objs = [ [1], # Each row represents the objective value(s)
218
+ # [2], corresponding to a decision in `X`
219
+ # [3] ]
220
+ #
221
+ # Note:
222
+ # - If there are N decisions and M objectives, the shape of `objs` should be (N, M)
223
+ # - Users must ensure that `objs` is a 2D NumPy array
224
+
225
+ def objFunc(X):
226
+ # If possible, advise vectorizing operations on matrix X
227
+ # to improve computational efficiency.
206
228
 
207
- def objFunc(X):
208
- # If possible, advise vectorizing operations on matrix X to improve computational efficiency.
209
229
  objs =100 * (X[:, 2] - X[:, 1]**2)**2+ 100 * (X[:, 1] - X[:, 0]**2)**2 + \
210
- (1 - X[:, 1])**2 + (1 - X[:, 0])**2
211
- return objs[:, None] # Although UQPyL performs further checks, please ensure the returned `objs` is a 2D array.
230
+ (1 - X[:, 1])**2 + (1 - X[:, 0])**2
231
+
232
+ return objs[:, None] # Ensure the returned `objs` is a 2D numpy array.
233
+
212
234
 
213
- # UQPyL also supports an alternative way of defining the objFunc function.
214
- # For problems involving numerical simulation models, it's often not feasible to vectorize operations on matrix 'X'.
215
- # To address this, UQPyL provides a decorator function @singleFunc that enables single running mode.
216
- # In single running mode, The 'objFunc' function only accepts a Python list or 1D numpy array as input.
217
- # It processes one decision variable combination at a time, making it suitable for complex or non-vectorizable objective functions.
235
+ # Alternative Usage:
236
+ #
237
+ # When using computational models where vectorized operations on the input `X` are not feasible,
238
+ # UQPyL provides a convenient alternative: the `@singleFunc` decorator.
239
+ #
240
+ # This decorator enables "single-run" mode, where `objFunc` accepts
241
+ # a single input at a time. The input should be a Python list or 1D NumPy array.
242
+ #
243
+ # `objFunc` would returns a scalar value (int or float) for single-objective problems,
244
+ # or a list / 1D NumPy array for multi-objective problems.
218
245
 
219
- # First, import the decorator that enables singleton mode from UQPyL
246
+ # First, import the decorator from UQPyL.problems
220
247
  from UQPyL.problems import singleFunc
221
248
 
222
249
  @singleFunc
223
- def objFunc_(X): # Input X should be a 1D numpy array or Python list
224
- # Perform calculations for each element in X
250
+ def objFunc_(X):
251
+
252
+ # Perform calculations for each element in X
253
+
225
254
  obj = 100 * (X[2] - X[1]**2)**2 + 100 * (X[1] - X[0]**2)**2 + \
226
255
  (1 - X[1])**2 + (1 - X[0])**2
227
- return obj # Return the objective value: a scalar for single-objective, or a 1D array/list for multi-objective
228
256
 
229
- # Step 3: Define concFunc Function
230
- # Similar to objFunc, the conFunc function supports two definition modes.
231
- # Note: The return value of conFunc indicates whether the constraints are satisfied:
232
- # - A negative value indicates a violation of the constraint — the smaller the value, the more severe the violation.
233
- # - A positive value indicates the constraint is satisfied, i.e., the solution is feasible.
234
- # As a result, users may need to reformulate their original constraint expressions to follow this convention.
257
+ return obj
258
+
235
259
 
236
- # Matrix Mode
260
+ # Step 3: Define `conFunc` function
261
+ # Similar to `objFunc`, `conFunc` also supports two modes.
262
+ #
263
+ # Note:
264
+ # The return of `conFunc` require whether the constraints are satisfied:
265
+ # - A negative value indicates a violation of the constraint — the smaller the
266
+ # value, the more severe the violation.
267
+ # - A positive value indicates the constraint is satisfied, i.e., the solution
268
+ # is feasible.
269
+ # Therefore, users need to reformulate their original constraint expressions
270
+ # to follow this convention.
271
+
272
+ # Array Mode
237
273
  def conFunc(X):
274
+
238
275
  cons = X[:, 0]**2 + X[:, 1]**2 + X[:, 2]**2 - 4
239
- return cons[:, None]
240
276
 
241
- # Single Running Mode
277
+ return cons[:, None] #keep 2D numpy array
278
+
279
+ # Single-run Mode
242
280
  @singleFunc
243
281
  def conFunc(X):
282
+
244
283
  con = X[0]**2 + X[1]**2 + X[2]**2 - 4
245
- return con
246
284
 
247
- # Step 4: describe the properties of X
285
+ return con # scaler value is feasible
248
286
 
249
- nInput = 3 # number of input variables (X), here it's 3 inputs.
250
- nOutput = 1 # number of outputs (objective functions), here it's 1 objective.
287
+ # Step 4: Describe the properties of X
251
288
 
252
- #Upper bound of X.
253
- ub = [10, 10, 10] # It can be a float, int, list, or numpy array.
289
+ nInput = 3 # number of input variables, here it's 3 inputs.
290
+ nOutput = 1 # number of outputs, here it's 1 objective.
291
+
292
+ # Upper bound of X.
293
+ # It can be a float, int, list, or numpy array.
294
+ ub = [10, 10, 10]
254
295
  # In this case, both input variables have an upper bound of 10.
296
+ # Optional way:
297
+ ub_ = 10
255
298
 
256
299
  # Lower bound of X.
257
- lb = [0, 0, 0] # It can also be a float, int, list, or numpy array.
258
- # In this case, both input variables have a lower bound of 0.
300
+ lb = [0, 0, 0]
301
+ lb_ = 0
259
302
 
260
- # Types of variables.
261
- # type 0 for continuous, 1 for integer, and 2 for discrete.
303
+ # Type of variables.
304
+ # Where `0` for continuous, `1` for integer, and `2` for discrete.
262
305
  varType = [0, 1, 2]
263
- # varType[0] = 0: The first input (X[0]) is a float.
264
- # varType[1] = 1: The second input (X[1]) is an integer variable.
265
- # varType[2] = 2: The second input (X[2]) is a discrete variable.
306
+ # corresponding to float, integer, discrete
266
307
 
267
- # The set of possible values for discrete variables.
268
- varSet = {2: [2, 3.4, 5.1, 7]}
269
- # varSet is a dictionary where the key indicates the index of the variable (2 refers to the third variable, x3). It follows Python's zero-based indexing.
270
- # The value associated with key 2 specifies the set of possible values for X[2]: [2, 3.4, 5.1, 7].
271
- # This means that X[2] can only take one of these four values: 2, 3.4, 5.1, or 7.
308
+ # For discrete variables, users should indicate the set of possible values
309
+ varSet = {2: [2, 3.4, 5.1, 7]}
310
+ # Here, following Python zero-based indexing, `2` refers to the third variable.
311
+ # This means that x3 can only take one of these four values: 2, 3.4, 5.1, or 7.
272
312
 
273
- # The optimization type: 'min' for minimization, 'max' for maximization.
313
+ # Optimization type:
314
+ # Where 'min' for minimization, 'max' for maximization.
274
315
  optType = 'min'
316
+ # Note:
317
+ # For multi-objective problems, users can specify the optimization direction
318
+ # (e.g., `min` or `max`)
319
+ # for each objective individually using a list,
320
+ # or define a global direction that applies to all objectives.
275
321
 
276
- # Names (or labels) for the input variables.
322
+ # Labels of each input variables.
277
323
  xLabels = ['x1', 'x2', 'x3']
278
- # If the optimization problem has named variables, you can set them here.
279
- # Otherwise, default names like 'x1', 'x2', 'x3', etc., can be used.
324
+ # If the optimization problem includes named variables, you can define them here.
325
+ # Otherwise, default names such as 'x1', 'x2', 'x3', etc., will be automatically generated.
326
+
280
327
 
281
- # Names (or labels) for the objective functions.
282
- yLabels = ['obj1'] # Similar to xLabel, if your objective(s) have specific names, you can set them here.
283
- # Otherwise, use default labels like 'obj1', 'obj2', etc.
328
+ # Labels of each objective.
329
+ yLabels = ['obj1']
330
+ # Similar to `xLabel`, if your objective(s) have specific names, you can define them here.
331
+ # Otherwise, default labels such as 'obj1', 'obj2', etc., will be used.
284
332
 
285
333
  # Name of the optimization problem
286
- name = 'Rosenbrock'
287
- # Useful for identifying the problem instance, organizing results, saving files, etc.
334
+ name = 'Rosenbrock'
335
+ # Useful for identifying the problem instance, managing results, saving files, etc.
288
336
 
289
337
  #Step 5: Initialize the problem instance
290
338
  problem = Problem(
291
- nInput=nInput,
292
- nOutput=nOutput,
293
- objFunc=objFunc,
294
- conFunc=conFunc,
295
- ub=ub,
296
- lb=lb,
297
- varType=varType,
298
- varSet=varSet,
299
- xLabels=xLabels,
300
- yLabels=yLabels,
301
- name=name
339
+ nInput = nInput,
340
+ nOutput = nOutput,
341
+ objFunc = objFunc,
342
+ conFunc = conFunc,
343
+ ub = ub,
344
+ lb = lb,
345
+ varType = varType,
346
+ varSet = varSet,
347
+ xLabels = xLabels,
348
+ yLabels = yLabels,
349
+ name = name
302
350
  )
303
351
 
304
- # Step 6: Use optimization methods from UQPyL
305
- # All methods and algorithms in UQPyL operate by reading the 'problem' object
306
- # In this example, we are using the Genetic Algorithm (GA) for optimization
352
+ # Step 6: Optimization
353
+ # All methods and algorithms of UQPyL run by reading the `problem` objective
354
+ # Use the Genetic Algorithm (GA) as example
307
355
  from UQPyL.optimization.single_objective import GA
308
356
 
309
- # Create an instance of the Genetic Algorithm (GA). By default, GA will output optimization history
357
+ # Create an instance of GA.
358
+ # By default, GA would output optimizing history
310
359
  # and final results in the command line.
360
+ # please check tutorial for specific usage.
311
361
  ga = GA()
312
362
 
313
- # Run the Genetic Algorithm optimization by passing the defined 'problem' object
363
+ # Run `ga` by input `problem` object
314
364
  ga.run(problem = problem)
365
+
315
366
  # Output:
316
367
  # Time: 0.0 day | 0.0 hour | 0.0 minute | 1.17 second
317
368
  # Used FEs: 50000 | Iters: 999
@@ -329,43 +380,54 @@ ga.run(problem = problem)
329
380
  ```
330
381
 
331
382
  ### Benchmark Problems
332
- UQPyL provides built-in benchmark problems (inheriting from `Problem` class) to test methods.
383
+
384
+ UQPyL provides some built-in benchmark problems (inheriting from `Problem` class) to test algorithms.
385
+
333
386
  ```python
387
+
388
+ # Import single-objective problems from UQPyL.problems.single_objective
334
389
  from UQPyL.problems.single_objective import Sphere, Ackley
390
+
391
+ # Import multi-objective problems from UQPyL.problems.multi_objective
335
392
  from UQPyL.problems.multi_objective import ZDT1, DTLZ1
336
393
 
337
- # Create benchmark problems for testing algorithms
338
- # You can easily customize the input dimension and variable bounds as needed
394
+ # Users can easily customize the input dimension and variable bounds as needed
339
395
 
340
396
  # Single-objective benchmark problems
341
- problem1 = Sphere(nInput=10, ub=100, lb=-100) # Sphere function with 10 dimensions, bounds [-100, 100]
342
- problem2 = Ackley(nInput=10, ub=np.ones(10)*100, lb=np.ones(10)*-100) # Ackley function with 10 dimensions
397
+ # Sphere function with 10 dimensions, bounds of all variables is [-100, 100]
398
+ problem1 = Sphere(nInput=10, ub=100, lb=-100)
343
399
 
344
- # Multi-objective benchmark problems
345
- problem3 = ZDT1(nInput=5) # ZDT1 problem with 5 decision variables
346
- problem4 = DTLZ1(nInput=15) # DTLZ1 problem with 15 decision variables
400
+ # Ackley function with 15 dimensions, bounds of all variables is [-100, 100]
401
+ problem2 = Ackley(nInput=15, ub=np.ones(10)*100, lb=np.ones(10)*-100) #
347
402
 
348
- # UQPyL provides ready-to-use benchmark problems for both single and multi-objective optimization.
349
- # You can easily adjust input dimensions and variable bounds to suit your testing needs.
350
- ```
403
+ # Multi-objective benchmark problems
404
+ # ZDT1 problem with 5 decision variables, bounds use default.
405
+ problem3 = ZDT1(nInput=5)
351
406
 
407
+ # DTLZ1 problem with 15 decision variables, bounds use default.
408
+ problem4 = DTLZ1(nInput=15)
352
409
 
410
+ ```
353
411
 
354
412
  ### Sensitivity Analysis
355
413
 
356
- Here, use Ishigami Function as example.
357
- <p align="center"><img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Problem2.svg" width=400 /></p>
414
+ Take Ishigami Function as example.
415
+ <p align="center"><img src="./docs/pic/Problem2.svg" width=400 /></p>
358
416
 
359
417
  The theoretical sensitivity indices of the Ishigami function are as follows:
418
+
360
419
  First-order sensitivity indices: x1 = 0.314, x2 = 0.442, x3 = 0.000
420
+
361
421
  Total-order sensitivity indices: x1 = 0.558, x2 = 0.442, x3 = 0.244
362
422
 
363
423
  <a href="https://nbviewer.org/github/smasky/UQPyL/blob/dev/notebooks/sensitivity_analysis.ipynb" target="_blank">📘 View Jupyter Notebook example online </a>
364
424
 
365
425
  ```python
366
426
  import numpy as np
427
+
367
428
  from UQPyL.problems import Problem
368
- # Define Ishigami Function
429
+
430
+ # Define Ishigami problem
369
431
  def objFunc(X):
370
432
  objs = np.sin(X[:, 0]) + 7 * np.sin(X[:, 1])**2 + \
371
433
  0.1 * X[:, 2]**4 * np.sin(X[:, 0])
@@ -374,24 +436,25 @@ def objFunc(X):
374
436
  Ishigami = Problem(nInput = 3, nOutput = 1, objFunc = objFunc,
375
437
  ub = np.pi, lb = -1*np.pi, varType = [0, 0, 0],
376
438
  name = "Ishigami")
377
-
439
+
440
+ # Import sensibility analysis methods from UQPyL.sensibility
378
441
  from UQPyL.sensibility import Sobol
379
442
 
380
- # Instantiate a Sobol sensitivity analysis object
443
+ # Create a instance of `Sobol`
381
444
  sobol = Sobol()
445
+
446
+ # Sampling sample
382
447
  # N = 512 defines the base sample size;
383
- # total number of evaluations will be larger due to Sobol' method structure
384
448
  X = sobol.sample(problem = Ishigami, N = 512)
385
449
 
386
- # Evaluate the objective function (i.e., Ishigami function) on the sample points
387
- # Returns an array of function outputs corresponding to each input in X
450
+ # Evaluate the objective of sample points
388
451
  Obj = problem.objFunc(X)
389
452
 
390
453
  # Perform Sobol' sensitivity analysis
391
454
  # Inputs:
392
455
  # - problem: the problem instance (defines bounds and function)
393
456
  # - X: the input samples
394
- # - Obj: the function evaluations at X
457
+ # - Obj: the objective of X
395
458
  sobol.analyze(problem, X, Obj)
396
459
 
397
460
  # By default, the following results will be obtained:
@@ -414,6 +477,7 @@ sobol.analyze(problem, X, Obj)
414
477
  # +-------------------+-------------------+-------------------+
415
478
 
416
479
  ```
480
+
417
481
  ### Optimization
418
482
 
419
483
  Here's an example using SCE-UA to optimize the Sphere function
@@ -422,20 +486,21 @@ Here's an example using SCE-UA to optimize the Sphere function
422
486
 
423
487
  ```python
424
488
 
425
- # Import the Sphere benchmark function
489
+ # Import Sphere
426
490
  from UQPyL.problems.single_objective import Sphere
427
491
 
428
- # Instantiate the problem with 10 input dimensions; other settings use defaults
429
- sphere = Sphere(nInput = 10) #Other settings use default
492
+ # Create an instance of Sphere
493
+ sphere = Sphere(nInput = 10)
430
494
 
431
- # Import the SCE-UA optimization algorithm
495
+ # Import SCE-UA from UQPyL.optimization.single_objective
432
496
  from UQPyL.optimization.single_objective import SCE_UA
433
497
 
434
- # Instantiate the optimizer with default settings
498
+ # Create an instance of Sphere
435
499
  sce = SCE_UA()
436
500
 
437
- # Run the optimization on the Sphere problem
501
+ # Run
438
502
  res = sce.run(sphere)
503
+ # Return object `res` is a python dict, which containing optimization history and the best results
439
504
 
440
505
  # Extract the best decision variables and objective values
441
506
  bestDecs = res.bestDecs
@@ -470,8 +535,9 @@ Use RBF model to predict Sphere Function as an example
470
535
  <a href="https://nbviewer.org/github/smasky/UQPyL/blob/dev/notebooks/surrogate_modelling.ipynb" target="_blank">📘 View Jupyter Notebook example online </a>
471
536
 
472
537
  ```python
538
+
539
+ # Generating training data
473
540
  from UQPyL.problems import Sphere
474
- #Instantiate the problem
475
541
  sphere = Sphere(nInput = 10)
476
542
 
477
543
  # Import Latin Hypercube Sampling (LHS) for generating design of experiments
@@ -481,26 +547,28 @@ from UQPyL.DoE import LHS
481
547
  lhs = LHS()
482
548
  xTrain = lhs.sample(200, problem.nInput, problem = sphere)
483
549
 
484
- # Evaluate the true objective function at training points
550
+ # Evaluate the true objective of training points
485
551
  yTrain = sphere.objFunc(xTrain)
486
552
 
487
553
  # Generate 50 test samples for model validation
488
554
  xTest = lhs.sample(50, problem.nInput, problem = sphere)
489
- # Evaluate the true function at test points
555
+ # Evaluate the true objective of test points
490
556
  yTest = sphere.objFunc(xTest)
491
557
 
492
558
  # Import Radial Basis Function (RBF) surrogate model
493
559
  from UQPyL.surrogate.rbf import RBF
494
560
 
495
- # Initialize and fit the RBF surrogate model
561
+ # Create an instance of RBF
496
562
  rbf = RBF()
563
+ # fit the model
497
564
  rbf.fit(xTrain, yTrain)
498
565
 
499
- # Use the trained RBF model to predict outputs on test inputs
566
+ # Use the trained RBF model to predict outputs of test inputs
500
567
  yPred = rbf.predict(xTest)
501
568
 
502
- # Import R² metric to evaluate surrogate model performance
569
+ # Import R² to evaluate surrogate model performance
503
570
  from UQPyL.utility.metric import r_square
571
+
504
572
  # Compute R² score between true and predicted test outputs
505
573
  r2 = r_square(yTest, yPred)
506
574
  print(r2)