Skip to main content

A python package for parameter uncertainty quantification and optimization

Project description

Uncertainty Quantification Python Laboratory (UQPyL)

UQPyL: The Uncertainty Quantification Python Laboratory provides comprehensive workflows tailored for Uncertainty Quantification and Optimization of computational models and their associated applications (e.g., model calibration, resource scheduling, product design).

Main Characteristics

  1. Comprehensive Sensitivity Analysis and Optimization Algorithm: Implements widely used sensitivity analysis methodologies and optimization algorithms.
  2. Advanced Surrogate Modeling: Integrates diverse surrogate models equipped to solve computationally expensive problems.
  3. Rich Application Resources: Provides a comprehensive suite of benchmark problems and practical case studies, enabling users to get started quickly.
  4. 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)

Quick Links


Included Methods and Algorithms

Sensitivity Analysis

(All methods support surrogate models)

  • Sobol'
  • Delta Test (DT)
  • Extended Fourier Amplitude Sensitivity Test (eFAST)
  • Random Balance Designs - Fourier Amplitude Sensitivity Test (RBD-FAST)
  • Multivariate Adaptive Regression Splines-Sensitivity Analysis (MARS-SA)
  • Morris
  • Regional Sensitivity Analysis (RSA)

Optimization Algorithms

(* indicates solving computational expensive optimization problem)

  • Single Objective Optimization: SCE-UA, ML-SCE-UA, GA, CSA, PSO, DE, ABC, ASMO*, EGO*
  • Multi-Objective Optimization: MOEA/D, NSGA-II, RVEA, MOASMO*

Note: The library is still being updated. If you need other algorithms, please contact us.

Surrogate Models

  • Fully Connected Neural Network (FCNN)
  • Kriging (KRG)
  • Gaussian Process (GP)
  • Linear Regression (LR)
  • Polynomial Regression (PR)
  • Radial Basis Function (RBF)
  • Support Vector Machine (SVM)
  • Multivariate Adaptive Regression Splines (MARS)

Installation

Recommended (PyPi or Conda):

pip install UQPyL
conda install UQPyL

Alternatively:

git clone https://github.com/smasky/UQPyL.git 
cd UQPyL
pip install .

Quick Start

To use UQPyL, define the problem you want to solve. The problem usually contains three important properties:

  1. func (the mapping from X to Y)
  2. The dimensions of decisions and outputs
  3. The bounds of decisions (ub, lb)

Benchmark Problems

from UQPyL.problems.single_objective import Sphere

problem = Sphere(nInput=10, ub=100, lb=-100)
problem = Sphere(nInput=10, ub=np.ones(10)*100, lb=np.ones(10)*-100)

Practical Problems

Define the evaluation function:

from UQPyL.problems import PracticalProblem

def func(X):
    Y = np.sum(X, axis=1).reshape(-1, 1)
    return Y

problem = PracticalProblem(func=func, nInput=10, nOutput=1, ub=100, lb=-100, name="Sphere")

Note: The func needs to accept a matrix of X and return a matrix of Y, with columns equal to dimensions and rows equal to samples. X and Y should be np.ndarray.

After defining the problem, you can use any methods in UQPyL.

Sensitivity Analysis

from UQPyL.sensibility import Sobol

sobol = Sobol()  # Instantiate and set hyper-parameters
sobol.analyze(problem)

Optimization

from UQPyL.optimization.single_objective import SCE_UA

sce = SCE_UA()
res = sce.run(problem)
bestDec = res.bestDec
bestObj = res.bestObj

Surrogate Modeling

from UQPyL.DoE import LHS

lhs = LHS(problem)
xTrain = lhs.sample(200, problem.nInput)
yTrain = problem.evaluate(xTrain)

xTest = lhs.sample(50, problem.nInput)
yTest = problem.evaluate(xTest)

from UQPyL.surrogate.rbf import RBF

rbf = RBF()
rbf.fit(xTrain, yTrain)
yPred = rbf.predict(xTest)

from UQPyL.utility.metric import r_square
r2 = r_square(yTest, yPred)

For more advanced usage, please refer to the documentation (#TODO).


Call for Contributions

We welcome contributions to expand our library with more sophisticated UQ methods, optimization algorithms and engineering problems.


Contact

For any inquiries or contributions, please contact:

wmtSky
Email: wmtsky@hhu.edu.cn, wmtsmasky@gmail.com


This project is licensed under the MIT License - see the LICENSE file for details.

GitHub Stars GitHub Forks

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

UQPyL-2.0.7.tar.gz (1.6 MB view hashes)

Uploaded Source

Built Distributions

UQPyL-2.0.7-cp312-cp312-win_amd64.whl (2.7 MB view hashes)

Uploaded CPython 3.12 Windows x86-64

UQPyL-2.0.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.0 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

UQPyL-2.0.7-cp311-cp311-win_amd64.whl (2.7 MB view hashes)

Uploaded CPython 3.11 Windows x86-64

UQPyL-2.0.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.1 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

UQPyL-2.0.7-cp310-cp310-win_amd64.whl (2.7 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

UQPyL-2.0.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.7 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

UQPyL-2.0.7-cp39-cp39-win_amd64.whl (2.7 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

UQPyL-2.0.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.7 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

UQPyL-2.0.7-cp38-cp38-win_amd64.whl (2.7 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

UQPyL-2.0.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.8 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

UQPyL-2.0.7-cp37-cp37m-win_amd64.whl (2.6 MB view hashes)

Uploaded CPython 3.7m Windows x86-64

UQPyL-2.0.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.2 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

UQPyL-2.0.7-cp36-cp36m-win_amd64.whl (1.2 MB view hashes)

Uploaded CPython 3.6m Windows x86-64

UQPyL-2.0.7-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.5 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page