processoptimizer
A tool to optimize real world problems
Science Score: 59.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 6 DOI reference(s) in README -
✓Academic publication links
Links to: acs.org, zenodo.org -
✓Committers with academic emails
8 of 74 committers (10.8%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.2%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
A tool to optimize real world problems
Basic Info
- Host: GitHub
- Owner: novonordisk-research
- License: other
- Language: Jupyter Notebook
- Default Branch: develop
- Homepage: https://github.com/novonordisk-research/ProcessOptimizer
- Size: 50.9 MB
Statistics
- Stars: 107
- Watchers: 5
- Forks: 20
- Open Issues: 12
- Releases: 15
Topics
Metadata Files
README.md
_____ ____ _ _ _
| __ \ / __ \ | | (_) (_)
| |__) | __ ___ ___ ___ ___ ___| | | |_ __ | |_ _ _ __ ___ _ _______ _ __
| ___/ '__/ _ \ / __/ _ \/ __/ __| | | | '_ \| __| | '_ ` _ \| |_ / _ \ '__|
| | | | | (_) | (_| __/\__ \__ \ |__| | |_) | |_| | | | | | | |/ / __/ |
|_| |_| \___/ \___\___||___/___/\____/| .__/ \__|_|_| |_| |_|_/___\___|_|
| |
|_|
Table of Contents
ProcessOptimizer
ProcessOptimizer is intended and tailored for optimization of real world processes. This could e.g. be some complex chemical reaction where no reliable analytical model mapping input variables to the output is readily available. Functionality includes Bayesian optimization, space filling, Design of Experiment algorithms, multi-objective optimization, and more.
ProcessOptimizer is tailored to perform well when observables have non-neglible noise but where the underlying relations between factors and responses follow regular real world behavior.
Installation
ProcessOptimizer can be installed using pip install ProcessOptimizer
The repository and examples can be found at https://github.com/novonordisk-research/ProcessOptimizer
ProcessOptimizer can also be installed by running pip install -e . in top directory of the cloned repository.
How to get started
Below is an illustrative example of minimization of the 2-dimensional Booth function using the ProcessOptimizer package. Notice that in real world applications, we would not know this function beforehand, i.e., it would be "black-box" (and typically we would also have more than 2 input factors).
In this example, uniformly distributed random noise between 0-5% of the function value is added using np.random. The function is defined as follows:
```python
import numpy as np
def Booth(x0, x1): booth = (x0 + 2 * x1 - 7)2 + (2 * x0 + x1 - 5)2 noise = 1 + 0.05 * (2 * np.random.rand() - 1) return (booth * noise) ``` <!-- Below is an image of the Booth function.
-->
You are given the task of finding the minimum of the function without knowing its analytical form. You can perform "experiments", where you provide x0 and x1 and obtain the noisy value of the function. You want to do as few experiments as possible.
Working with the ProcessOptimizer package, you define the experimental Space and create an Optimizer object. In this specific case, we have two continous numerical dimensions both ranging from 0.0 to 5.0.
```python import ProcessOptimizer as po
SPACE = po.Space([[0.0, 5.0], [0.0, 5.0]])
``
TheOptimizerdefined below uses"GP"(Gaussian Process) for Bayesian optimization. Before the Bayesian part of the optimization begins, a number of initial "experiments" (ninitialpoints`) is run to obtain some initial data. After these initial "experiments" and every time new data is added afterwards, a Gaussian Process regression model is fitted to the data we have obtained so far. Based on this model (and an acquisition function that determines our search strategy), the optimizer suggests the next point to evaluate.
python
opt = po.Optimizer(SPACE, base_estimator = "GP", n_initial_points = 2)
The optimizer can be used in steps by calling the .ask() function, evaluating the function at the given point and using .tell() to feed back the result to the Optimizer. In practise it would work like this. First ask the optimizer for the next point to perform an experiment:
```python
opt.ask()
[3.75, 3.75]
Now go to the laboratory or wherever the experiment can be performed and use the values obtained when calling `ask()`. In this example the experiment can simply be performed by evaluating the Booth function using the values above:python Booth(3.75, 3.75) 59.313996676981354When a result has been obtained the user needs to tell the output to the `Optimizer`. This is done using the `.tell()` function:python opt.tell([3.75, 3.75], 59.313996676981354) result = opt.get_result()
po.plotobjective(result)
``
Theresultreturned bytellcontains a model of the Gaussian Process predicted mean. This model can be plotted usingplotobjective(result)`. Below is a gif of the search after 2 initial points and until 20 points have been sampled in total. The orange dots visualise each evaluation of the function. Besides the 2D color plot, there are also 1D plots for each input variable. These show how the function depend on each input variable with other input variables kept constant at the best sampled data point.

Notice that this is an optimization tool and not a modelling tool. This means that the optimizer finds an approximate solution for the global minimum quickly. It does, however, not guarantee that the obtained model is accurate on the entire domain.
<!--
The best observation against the number of observations can be plotted with plot_convergence(result):
python
po.plot_convergence(result)
-->
A full minimal example of use can be found below:
```python import numpy as np import ProcessOptimizer as po
def Booth(x0, x1): booth = (x0 + 2 * x1 - 7)2 + (2 * x0 + x1 - 5)2 noise = 1 + 0.05 * (2 * np.random.rand() - 1) return (booth * noise)
SPACE = po.Space([[0.0, 5.0], [0.0, 5.0]]) opt = po.Optimizer(SPACE, baseestimator = "GP", ninitial_points = 2)
for i in range(20): x = opt.ask() y = Booth(*x) opt.tell(x, y)
result = opt.getresult() po.plotobjective(result) ```
Examples
An introductory walkthough of the package can be found here
Various examples on use and functionality can be found here.
Contributions
Feel free to play around with algorithm. Should you encounter errors while using ProcessOptimizer, please report them
at https://github.com/novonordisk-research/ProcessOptimizer/issues.
To help solve the issues, please:
- Provide minimal amount of code to reproduce the error
- State versions of ProcesOptimizer, sklearn, numpy, ...
- Describe the expected behavior of the code
If you would like to contribute by making anything from documentation to feature-additions, THANK YOU. Please open a pull request
marked as WIP as early as possible and describe the issue you seek to solve and outline your planned solution.
<!-- Pull requests to the develop branch will be automatically tested using pytest and flake8. We'll be happy to help solving potential
issues that could arise here.
-->
Related work
ProcessOptimizer is a fork of scikit-optimize. ProcessOptimizer will fundamentally function like scikit-optimize, yet developments are focussed on bringing improvements to help optimizing real world processes, like chemistry or baking.
Brownie Bee is a web-based platform for Bayesian process optimization intended for non-coders. It uses ProcessOptimizer as the underlying optimization engine.
Citation
If you use the package in relation to published works, please cite: https://doi.org/10.5281/zenodo.5155295 and https://pubs.acs.org/doi/full/10.1021/acs.jcim.4c02240
Please also cite the underlaying package (scikit-optimize).
Owner
- Name: novonordisk-research
- Login: novonordisk-research
- Kind: organization
- Repositories: 2
- Profile: https://github.com/novonordisk-research
GitHub Events
Total
- Create event: 33
- Release event: 1
- Issues event: 41
- Watch event: 37
- Delete event: 36
- Member event: 1
- Issue comment event: 49
- Push event: 202
- Pull request review comment event: 74
- Pull request review event: 68
- Pull request event: 75
- Fork event: 4
Last Year
- Create event: 33
- Release event: 1
- Issues event: 41
- Watch event: 37
- Delete event: 36
- Member event: 1
- Issue comment event: 49
- Push event: 202
- Pull request review comment event: 74
- Pull request review event: 68
- Pull request event: 75
- Fork event: 4
Committers
Last synced: almost 3 years ago
All Time
- Total Commits: 1,374
- Total Committers: 74
- Avg Commits per committer: 18.568
- Development Distribution Score (DDS): 0.829
Top Committers
| Name | Commits | |
|---|---|---|
| Tim Head | b****m@g****m | 235 |
| MechCoder | m****4@g****m | 172 |
| SQBL (Søren Bertelsen) | S****L@n****m | 161 |
| sigurd | s****n@g****m | 116 |
| Gilles Louppe | g****e@g****m | 105 |
| AkselObdrup | 7****p@u****m | 86 |
| Iaroslav Shcherbatyi | i****l@g****m | 68 |
| MechCoder | m****2@n****u | 54 |
| Søren Bertelsen | 3****l@u****m | 48 |
| franck | f****k@s****r | 43 |
| Morten Bormann Nielsen | m****n@t****k | 29 |
| Ze Vinicius | j****a@g****m | 22 |
| AkselObdrup | o****l@g****m | 20 |
| dk-teknologisk-cbb | c****b@t****k | 14 |
| Christopher Schröder | c****3@g****m | 14 |
| Katie Malone | c****8@g****m | 12 |
| nel215 | o****i@g****m | 9 |
| Nuno Campos | n****s@m****m | 8 |
| Thomas Fan | t****n@g****m | 8 |
| Soren Bertelsen | s****n@g****m | 6 |
| Iaroslav Shcherbatyi | i****b@g****m | 6 |
| stefanocereda | c****e@g****m | 6 |
| René Rex | r****x@k****m | 6 |
| drace | d****e@g****m | 6 |
| Christian Schell | m****l@c****e | 5 |
| Anders B. Blichfeld | a****l@t****k | 5 |
| Kejia (KJ) Shi | k****i@c****u | 5 |
| carlos | c****s@g****m | 5 |
| Søren Furbo | 1****N@u****m | 5 |
| Magnus | m****s@h****g | 5 |
| and 44 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 101
- Total pull requests: 207
- Average time to close issues: 6 months
- Average time to close pull requests: about 1 month
- Total issue authors: 15
- Total pull request authors: 11
- Average comments per issue: 1.22
- Average comments per pull request: 0.87
- Merged pull requests: 151
- Bot issues: 0
- Bot pull requests: 30
Past Year
- Issues: 24
- Pull requests: 86
- Average time to close issues: 16 days
- Average time to close pull requests: 3 days
- Issue authors: 9
- Pull request authors: 8
- Average comments per issue: 1.08
- Average comments per pull request: 0.15
- Merged pull requests: 65
- Bot issues: 0
- Bot pull requests: 1
Top Authors
Issue Authors
- sqbl (32)
- SRFU-NN (28)
- dk-teknologisk-mon (23)
- jespersp (2)
- dk-teknologisk-cbb (2)
- Firefly78 (2)
- rtaaning (2)
- abbl-DTI (2)
- RuneChristensen-NN (2)
- dk-teknologisk-rtfh (1)
- Andreasrygaard (1)
- franktoffel (1)
- AkselObdrup (1)
- MortenSkovsted (1)
- SandorAlbert (1)
Pull Request Authors
- SRFU-NN (65)
- RuneChristensen-NN (40)
- sqbl (35)
- dependabot[bot] (30)
- dk-teknologisk-mon (22)
- abbl-DTI (4)
- CoRiis (3)
- dk-teknologisk-cbb (2)
- AkselObdrup (2)
- Firefly78 (2)
- AndreaKarlova (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 1,630 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 50
- Total maintainers: 5
pypi.org: processoptimizer
Sequential model-based optimization toolbox (forked from scikit-optimize)
- Documentation: https://processoptimizer.readthedocs.io/
- License: BSD
-
Latest release: 1.1.1
published 11 months ago
Rankings
Maintainers (5)
Dependencies
- bokeh *
- deap *
- matplotlib *
- nose *
- numpy *
- pytest *
- scikit-learn >=0.24.2
- scipy *
- six *
- deap *
- matplotlib *
- numpy *
- pyYAML *
- scikit-learn >=0.24.2
- scipy *
- six *
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v3 composite
- actions/setup-python v3 composite
- actions/checkout v3 composite
- actions/dependency-review-action v3 composite