Inference-tools

Latest version: v0.13.4

Safety actively analyzes 688486 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 5

0.13.4

- Improved the numerical stability of the PDF model in `UnimodalPdf`
- `UnimodalPdf` now determines sensible bounds on it's model parameters, which are used in the model fitting, and can be accessed through a new instance attribute `bounds`.
- A new `UnimodalPdf` instance method `evaluate_model` has been added which allows the model to be evaluated for specified parameter values.
- Improved type-hinting throughout `UnimodalPdf`.

0.13.3

- Improved the numerical efficiency of calculating the posterior covariance in `GpRegressor.build_posterior`.
- Added a new keyword argument `mean_only` to `GpRegressor.build_posterior` which allows for only the posterior mean to be calculated and returned.
- Swapped the use of `numpy.dot` with the `` operator for matrix products in the `inference.gp.regression` module.

0.13.2

- Various small updates to make `inference-tools` compatible with the recently released `numpy` 2.0.0.
- Fixed a bug where `inference.approx.get_conditionals` sometimes would fail to evaluate all of the high-probability areas of a given conditional distribution.

0.13.1

`pdf` module updates
- Converted `DensityEstimator` to an abstract base class.
- Added a `cdf()` method to density estimators for calculating the cumulative distribution function.
- Redesigned the `interval()` method of `DensityEstimator` and changed the name of the `frac` argument to `fraction` to match naming with `sample_hdi`.
- Renamed the `GaussianKDE` instance attribute `s` to `sample` to standardize naming across density estimator classes.
- Various improvements to type-hinting in the `pdf` module.

`plotting` module updates
- Improvements to `plotting` module documentation.
- Replaced deprecated `matplotlib.cm.get_cmap` with recommended `matplotlib.colormaps`.
- The `ax` argument of `transition_matrix_plot` has been re-named to `axis` for consistency within the module.
- Gradual type-hinting of the `plotting` module.

0.13.0

Minimum python version increase
- The minimum python version for `inference-tools` has been increased to `3.9`.

Backwards-incompatible changes in `inference.mcmc`
- Specification of parameter bounds has been standardised across `HamiltonianChain`, `PcaChain` and `EnsembleSampler`. On initialisation they now each have an optional `bounds` keyword argument, which takes an instance of `inference.mcmc.Bounds` or a sequence of two `numpy.ndarray`. Depending on which sampler is being used, the name of the keyword argument and/or the format in which the bounds are specified may have changed in this release, which will break code written for previous releases.
- Standardised the naming of some instance attributes across the MCMC samplers. These attributes typically would not be accessed directly by a user, but the changes also affect how chain data are saved and loaded, meaning that chain data saved using previous releases may not load correctly.
- Standardised the returned type of the `get_probabilities`, `get_parameter` and `get_sample` methods of MCMC samplers to be a `numpy.ndarray`. Previously, these methods returned either a list or a `numpy.ndarray` depending on which sampler was used.
- Removed the `burn` and `thin` instance attributes of MCMC samplers used to set global burn and thin values. This means burn and thin values must now be passed explicitly to `MarkovChain` methods, but avoids potentially error-prone behavior of burning / thinning being applied implicitly even when the `burn` and `thin` kwargs are not specified. `burn` and `thin` have been added to the `MarkovChain` base class as properties which raise an error when accessed or set. This will prevent bugs where the burn / thin attributes are set but have no effect as they are no longer used by any methods.

Other changes
- Converted `MarkovChain` to an abstract base-class for MCMC samplers. All sampler classes now inherit from `MarkovChain`, so it can be used for type checking / hinting when expecting one of the samplers as an input. Some additional standardisation across the samplers has allowed more functionality to be moved from individual classes to the base class, improving code re-use.
- Improved type-hinting across various modules.
- All project meta-data has been moved to the `pyproject.toml`, and `setup.cfg` has been removed.

0.12.0

- Added a new module `inference.approx` for approximate inference tools.
- Currently contains the `get_conditionals` and `conditional_sample` functions for evaluating and sampling from conditional distributions.

Page 1 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.