jpt.distributions.univariate.integer
© Copyright 2021, Mareike Picklum, Daniel Nyga.
Classes
A mapping of external integers to their internal representation and vice versa. |
|
Maps integer labels to their internal values |
|
Maps internal integer values to integer labels. |
|
Abstract supertype of all domains and distributions |
Functions
|
Module Contents
- class jpt.distributions.univariate.integer.IntegerMap(lmin: int | None = None, lmax: int | None = None)
Bases:
jpt.distributions.univariate.distribution.ValueMapA mapping of external integers to their internal representation and vice versa.
- _min
- _max
- __eq__(other: IntegerMap) bool
- __len__()
- __hash__()
- __contains__(item)
- __iter__()
- abstract as_set() jpt.base.intervals.IntSet
- class jpt.distributions.univariate.integer.IntegerLabelToValueMap(lmin: int | None = None, lmax: int | None = None)
Bases:
IntegerMapMaps integer labels to their internal values
- property min
- property max
- __getitem__(label: int) int
- as_set() jpt.base.intervals.IntSet
- class jpt.distributions.univariate.integer.IntegerValueToLabelMap(lmin: int | None = None, lmax: int | None = None)
Bases:
IntegerMapMaps internal integer values to integer labels.
- property min
- property max
- __getitem__(value: int) int
- as_set() jpt.base.intervals.IntSet
- class jpt.distributions.univariate.integer.Integer(**settings)
Bases:
jpt.distributions.univariate.DistributionAbstract supertype of all domains and distributions
- values: IntegerLabelToValueMap | None
- labels
- OPEN_DOMAIN = 'open_domain'
- AUTO_DOMAIN = 'auto_domain'
- SETTINGS
- min() int | None
- max() int | None
- _min() int | None
- _max() int | None
- _params: Dict[int, float] | None = None
- to_json: types.FunctionType
- classmethod hash()
- property cdf: jpt.base.functions.PiecewiseFunction
- classmethod equiv(other: Type[jpt.distributions.univariate.Distribution]) bool
- classmethod type_to_json() Dict[str, Any]
- inst_to_json() Dict[str, Any]
- static type_from_json(data)
- copy()
- property probabilities: Dict[int, float]
- n_values() int | None
- classmethod value2label(value: int | Iterable[int] | jpt.base.intervals.IntSet | jpt.base.intervals.UnionSet) int | Iterable[int] | jpt.base.intervals.IntSet | jpt.base.intervals.UnionSet
- classmethod label2value(label: int | Iterable[int] | jpt.base.intervals.IntSet | jpt.base.intervals.UnionSet) int | Iterable[int] | jpt.base.intervals.IntSet | jpt.base.intervals.UnionSet
- _sample(n: int) Iterable[int]
- _sample_one() int
- sample(n: int) Iterable[int]
- sample_one() int
- property _pdf: types.FunctionType
- property pdf: types.FunctionType
- p(labels: int | Iterable[int]) float
- _p(values: int | Iterable[int]) float
- expectation() float
- _expectation() float
- variance() float
- _variance() float
- _k_mpe(k: int | None = None) Iterable[Tuple[jpt.base.intervals.NumberSet, float]]
Calculate the
kmost probable explanation states.- Parameters:
k – The number of solutions to generate
- Returns:
An list containing a tuple containing the likelihood and state in descending order.
- k_mpe(k: int = None) Iterable[Tuple[jpt.base.intervals.NumberSet, float]]
- mpe()
- _mpe()
- mode()
- _mode()
- __eq__(other) bool
- __str__()
- __repr__()
- infinite() bool
- finite() bool
- _sorted(exhaustive: bool = True, reverse: bool = False, max_items: int = None) Iterable[Tuple[int, float]]
- sorted(exhaustive: bool = True, reverse: bool = False, max_items: int = None) Iterable[Tuple[int, float]]
- _items(exhaustive: bool = False, max_items: int = None) Iterable[Tuple[int, float]]
Return a list of (probability, value) pairs representing this distribution.
- items(exhaustive: bool = True, max_items: int = None) Iterable[Tuple[int, float]]
Return a list of (probability, label) pairs representing this distribution.
- number_of_parameters() int
- moment(order: int = 1, center: float = 0) float
Calculate the central moment of the r-th order almost everywhere.
\[\int (x-c)^{r} p(x)\]- Parameters:
order – The order of the moment to calculate
center – The constant to subtract in the basis of the exponent
- plot(engine=None, **kwargs) Any
Plots the distribution using the given engine.
- Parameters:
engine – Can be either one of
["plotly", "matplotlib"], or an instance of a rendering engine subclassingDistributionRendering.kwargs – The keyword arguments to pass to the engine as defined in the
.plot_integer()function ofDistributionRenderingor its respective subclass defined byengine.
- Returns:
the figure object of the plotting engine