Skip to content

API Reference

The public API is exported from the top-level dicex package; the exact solutions, the scaler and the optimizer live in their submodules.

Explainer

Class Description
Dicex High-level explainer: fits the scaler and returns the recommended direction for a record.
ExplanationResult The direction, its robust value, the risk level and the details of the search.

Perturbation laws

Distributions of the random step length \(T\) and of the additive noise \(\varepsilon\) in the execution of a direction.

Class Description
GaussianPerturbation Gaussian step length (i.i.d., per-feature, or full covariance) plus additive noise.
UniformPerturbation Step length with i.i.d. uniform coordinates on [mu - delta, mu + delta], plus additive noise.
CustomPerturbation Step length given by a user-defined sampling function.

Exact solutions

Function Description
linear_directional_functional, linear_optimal_direction Closed-form objective and optimal direction for linear models under Gaussian perturbations.
logistic_directional_functional, logistic_optimal_direction The same for logistic models.

Preprocessing and optimizer

Class Description
DicexScaler Standardization used by Dicex; maps directions back to the original units.
VmfVns The vMF-VNS optimizer; its options can be passed to Dicex as keyword arguments.

Exceptions

Module Description
dicex.exceptions Errors and warnings raised by the library.