jpt.distributions.univariate.distribution

© Copyright 2021, Mareike Picklum, Daniel Nyga.

Attributes

SYMBOLIC

NUMERIC

CONTINUOUS

DISCRETE

Classes

ValueMap

Identity

Simple identity mapping that mimics the __getitem__ protocol of dicts.

Distribution

Abstract supertype of all domains and distributions

Module Contents

jpt.distributions.univariate.distribution.SYMBOLIC = 'symbolic'
jpt.distributions.univariate.distribution.NUMERIC = 'numeric'
jpt.distributions.univariate.distribution.CONTINUOUS = 'continuous'
jpt.distributions.univariate.distribution.DISCRETE = 'discrete'
class jpt.distributions.univariate.distribution.ValueMap

Bases: collections.abc.Hashable

abstract __iter__()
abstract __len__()
abstract __getitem__(label: Any)
abstract __hash__()
property map
abstract __eq__(other)
abstract __contains__(item)
class jpt.distributions.univariate.distribution.Identity

Bases: ValueMap

Simple identity mapping that mimics the __getitem__ protocol of dicts.

__getitem__(item)
property map
__eq__(o)
__hash__()
__contains__(item)
class jpt.distributions.univariate.distribution.Distribution(**settings)

Abstract supertype of all domains and distributions

values: ValueMap = None
labels: ValueMap = None
SETTINGS
_cl = 'jpt.distributions.univariate.distribution.Distribution'
settings
__getattr__(name)
classmethod hash()
Abstractmethod:

__hash__()
__getitem__(value)
classmethod value2label(value)
Abstractmethod:

classmethod label2value(label)
Abstractmethod:

abstract _sample(n: int) Iterable
abstract _sample_one()
sample(n: int) Iterable
sample_one() Any
abstract p(value) float
abstract _p(value) float
abstract mpe()
abstract crop(restriction: Set) Distribution
abstract _crop(restriction: Set) Distribution
abstract entropy() float
static merge(distributions: Iterable[Distribution], weights: Iterable[numbers.Real]) Distribution
Abstractmethod:

abstract update(dist: Distribution, weight: float) Distribution
abstract fit(data: numpy.ndarray, rows: numpy.ndarray = None, col: numbers.Integral = None) Distribution
abstract _fit(data: numpy.ndarray, rows: numpy.ndarray = None, col: numbers.Integral = None) Distribution
abstract set(params: Any) Distribution
abstract kl_divergence(other: Distribution)
abstract number_of_parameters() int
static jaccard_similarity(d1: Distribution, d2: Distribution) float
Abstractmethod:

abstract plot(engine: str, title: str = None, fname: str = None, directory: str = '/tmp', view: bool = False, **kwargs) Any

Generates a plot of the distribution.

Parameters:
  • title – the name of the variable this distribution represents

  • fname – the name of the file to be stored. Available file formats: png, svg, jpeg, webp, html

  • directory – the directory to store the generated plot files

  • view – whether to display generated plots, default False (only stores files)

Returns:

the figure object of the plotting engine

abstract to_json()
__reduce__()
static type_from_json(data: Dict[str, Any]) Type[Distribution]
static from_json(dtype: Dict[str, Any], dinst: Dict[str, Any] = None) Distribution | Type[Distribution]