Skip to main content

Parametrized hierarchical spaces with flexible priors and transformations.

Project description

ParameterSpace

Actions Status PyPI - Wheel PyPI - Python Version License: Apache-2.0 Code style: black

Contents:

About

A package to define parameter spaces consisting of mixed types (continuous, integer, categorical) with conditions and priors. It allows for easy specification of the parameters and their dependencies. The ParameterSpace object can then be used to sample random configurations from the prior and convert any valid configuration into a numerical representation. This numerical representation has the following properties:

  • it results in a Numpy ndarray of type float64
  • transformed representation between 0 and 1 (uniform) including integers, ordinal and categorical parameters
  • inactive parameters are masked as numpy.nan values

This allows to easily use optimizers that expect continuous domains to be used on more complicated problems because parameterspace can convert any numerical vector representation inside the unit hypercube into a valid configuration. The function might not be smooth, but for robust methods (like genetic algorithms/evolutionary strategies) this might still be valuable.

This software is a research prototype. The software is not ready for production use. It has neither been developed nor tested for a specific use case. However, the license conditions of the applicable Open Source licenses allow you to adapt the software to your needs. Before using it in a safety relevant setting, make sure that the software fulfills your requirements and adjust it according to any applicable safety standards (e.g. ISO 26262).

Documentation

Visit boschresearch.github.io/parameterspace

Installation

The parameterspace package can be installed from pypi.org:

pip install parameterspace

Development

Prerequisites

Setup environment

To install the package and its dependencies for development run:

poetry install

Optionally install pre-commit hooks to check code standards before committing changes:

poetry run pre-commit install

Running Tests

The tests are located in the ./tests folder. The pytest framework is used for running them. To run the tests:

poetry run pytest ./tests

Building Documentation

To built documentation run from the repository root:

poetry run mkdocs build --clean

For serving it locally while working on the documentation run:

poetry run mkdocs serve

Architectural Decision Records

Parameter Names

In the context of naming parameters and using their name to fix them to constant values or condition on them via lambda expressions, facing that only valid Python variable names can be used in conditions, and that fixing parameters that do not have a valid parameter name can only be done like fix(**{"invalid-variable:name": "const"}) we decided for requiring all parameter names to be valid Python variable names to achieve early failure and communication of that convention to avoid surprises when fixing and using conditions down the line, accepting that this rules out common parameter names like lambda and might require explicit translation between from and to contexts that require incompatible names (e.g. predefined benchmarks).

License

parameterspace is open-sourced under the Apache-2.0 license. See the LICENSE file for details.

For a list of other open source components included in parameterspace, see the file 3rd-party-licenses.txt.

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

parameterspace-0.9.0.tar.gz (26.2 kB view details)

Uploaded Source

Built Distribution

parameterspace-0.9.0-py3-none-any.whl (36.0 kB view details)

Uploaded Python 3

File details

Details for the file parameterspace-0.9.0.tar.gz.

File metadata

  • Download URL: parameterspace-0.9.0.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.8.16 Linux/5.15.0-1033-azure

File hashes

Hashes for parameterspace-0.9.0.tar.gz
Algorithm Hash digest
SHA256 44e78d0d1e15d3fe9f3d056133abe568bf6650f955d781281ee12d471941712e
MD5 517abec2d4b99d97d82710b2d505e3c5
BLAKE2b-256 6bae596a31e90c347cd3ff04858999d0de87872fcdf91a412ed24d7702b27a43

See more details on using hashes here.

File details

Details for the file parameterspace-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: parameterspace-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 36.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.8.16 Linux/5.15.0-1033-azure

File hashes

Hashes for parameterspace-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d574338064fc177b7daf27406f1a2a57355f1e2555ea4d86add2ee5f34f74a4b
MD5 48d166e1004ff8f18198e20ea9cbbf22
BLAKE2b-256 997828d8d9fd764d4ec9dfa1726e2e1e1a60e2335f6c82c9f942f45ee65f8e5e

See more details on using hashes here.

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