Skip to main content

hdim-opt: High-Dimensional Optimization Toolkit

PyPI Python Versions License

hdim_opt is a lightweight Python toolkit to streamline numerical optimization, sampling, and analysis for high-dimensional functions and datasets. Several functions are provided to address quasi-Monte Carlo sampling, gradient-based & non-parametric optimization, statistical analysis, regression & feature selection, data transformation & visualization.

All core functions, listed below, are single-line executable and depend on three essential parameters: [obj_function, bounds, n_samples]:

Sampling

  • uniform: Generate uniform QMC sample sequences (via scipy.stats.qmc).
  • hyperellipsoid: Non-uniform Hyperellipsoid Density Sampling designed to accelerate high-dimensional optimization.
  • isotropize: Isotropize the input data via zero-phase component analysis (ZCA).
  • encode_bipolar: Bipolar-logarithmic transform, for data (or bounds) spanning both negative values and exponents.

Optimization

  • quasar: Optimization using the QUASAR evolutionary algorithm.
  • minimize: Optimization using gradient-based minimization (via scipy.minimize).
  • symbolic: Symbolic regression to approximate the input data or function (via gplearn).
  • stepAIC: Stepwise feature selection for linear or logistic regression (akin to R's MASS:stepAIC).

Risk

  • volatility: Quantifies the objective function volatility of a solution within its local landscape.
  • risk_analysis: Analyzes the risk metrics for a given 1-D distribution (i.e., the volatility output).

Analysis

  • sensitivity: Sensitivity analysis to quantify each dimension's influence (via SALib).
  • hyperslice: Create a hyperslice of the function's underlying solution space.
  • waveform: Decompose any 2D waveform.
  • analyze: Analyze any input dataset.

Installation

Install hdim_opt from PyPI:

pip install hdim_opt

Example Usage

import hdim_opt as h

### Parameter Space
n_samples = 2**10
n_dimensions = 100
bounds = [(-1,1)] * n_dimensions # Parameter bounds
obj_func = h.test_functions.rastrigin # Test function

### Sampling
uniform_samples = h.uniform(n_samples, bounds) # Uniform sampling
ellipsoid_samples = h.hyperellipsoid(n_samples, bounds, verbose=True) # Hyperellipsoid sampling
iso_samples, iso_params = h.isotropize(ellipsoid_samples) # Isotropize data (ZCA)
bipolar_log_samples = h.encode_bipolar(iso_samples, [b[0] for b in bounds]) # Bipolar-logarithm transform

### Optimization
solution, fitness = h.quasar(obj_func, bounds, init='hyperellipsoid') # Evolutionary optimization
local_sol, local_fit = h.minimize(obj_func, bounds, init=solution) # Gradient-based optimization
all_expr, best_expr = h.symbolic(obj_func, bounds[:2]) # Symbolic regression
opt_features, opt_model = h.stepAIC(iso_samples, [obj_func(x) for x in iso_samples]) # feature selection & regression

### Risk
vol_data, vol_stats = h.volatility(obj_func, bounds, solution, noise=0.01) # Local instability of a solution
risk_stats = h.risk_analysis(vol_data['objective']) # Conditional value at risk for a 1-D distribution

### Analysis
Si, S2 = h.sensitivity(obj_func, bounds) # Sensitivity analysis
slice_data, slice_stats = h.hyperslice(obj_func, bounds, slice_dims=(0,1), n_samples=2**7) # Estimate solution space
signal_data = h.waveform(slice_data['x0'], slice_data['objective']) # Analyze 2D waveform
h.analyze(slice_data) # Analyze any numerical dataset

Research & Methods

  • QUASAR Optimization: Quasi-Adaptive Search with Asymptotic Reinitialization, an evolutionary algorithm for minimizing high-dimensional, non-differentiable, and non-parametric objective functions. Read the paper on arXiv
  • Hyperellipsoid Density Sampling: A non-uniform Quasi-Monte Carlo sampling method designed to exploit promising regions of high-dimensional parameter spaces. Read the paper on arXiv

Issues & Support

Bug reports and feature requests are very welcome, via GitHub Issues.

Metadata

Release files for hdim-opt 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hdim-opt 2.0.0
File Size Uploaded Provenance Actions
hdim_opt-2.0.0.tar.gz 49.7 kB Without provenance Details for hdim_opt-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hdim-opt 2.0.0
File Interpreter ABI Platform Actions
hdim_opt-2.0.0-py3-none-any.whl Python 3 none any Details for hdim_opt-2.0.0-py3-none-any.whl

Total release size: 100.6 kB

Release files / hdim_opt-2.0.0.tar.gz

Download URL hdim_opt-2.0.0.tar.gz
Size 49.7 kB
Tags Source
SHA-256 checksum
How to use checksums
46684130add2f6f0e469c106c27ea0398b8554f1e4fb15c25ffc577485c17f66
BLAKE2b-256 checksum
How to use checksums
9b417bd140789ef8629f2857bc54e41445bb88711c44f1e4205dc2feb269c1ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.1

Release files / hdim_opt-2.0.0-py3-none-any.whl

Download URL hdim_opt-2.0.0-py3-none-any.whl
Size 50.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7b0d619ef21245c4cbe9a355d2f6b6d3d8c369e7cef07757729cc90cb58552a4
BLAKE2b-256 checksum
How to use checksums
24bbed89d326542f1aa9ee0d6cbf59032258304ad84b9b6ce79677f6d127ffd0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.1

Security for hdim-opt 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page