pyOLHS is a Python package that provides Optimal LatinHyperCube sampling.
The introduction of Algorithms is on my WeChat Official Account.
The Python version of the OLHS algorithm is less efficient. In the future, I will release an open-source C++ version optimized with openMP and TBB.
Additionally, I plan to update other multi-disciplinary optimization algorithms, such as Kriging models and other optimization algorithms like Bayesian Optimization.
2024.6.21 更新了采样结果去重方法 unique=True进行去重
bound = [[1, 6, 1], [2, 10, 2], [4, 100, 4]]
a = OLHS(bound, 50, 20, initseed=1, optseed=1,unique=True)
c = a.sampling()
bound = [[0, 1.0, 0.01], [0, 1.0, 0.01]]
#2024.1.4:initseed means to fix the origin lathin sampling result optseed means to fix the optimization method
#if you want to get the same optimization method , fix them both,
a = OLHS(bound, 20, 100,initseed=1,optseed=1)
#if you want to see different optimization result from the same origin latin result, only fix initseed
a = OLHS(bound, 20, 100,initseed=1)
c = a.sampling()
bound = [[0, 1.0,], [0, 1.0]]
a = OLHS(bound, 20, 1000,"center")
c = a.sampling()
Notes:I convert my C++ code into this Python version, but for some reason, the performance is not as good as the C++ version. Below are the results of the C++ execution.
-2024.1.4 add random seed to both origin latin sampling and optimization algorithm
- BiliBili: allenalexyan
- Email:[email protected]
- 微信公众号
Jin R, Chen W, Sudjianto A. An efficient algorithm for constructing optimal design of computer experiments[C]//International design engineering technical conferences and computers and information in engineering conference. 2003, 37009: 545-554.
PyOLHS has a BSD-style license, as found in the LICENSE file.