jpt.distributions.univariate.distribution ========================================= .. py:module:: jpt.distributions.univariate.distribution .. autoapi-nested-parse:: © Copyright 2021, Mareike Picklum, Daniel Nyga. Attributes ---------- .. autoapisummary:: jpt.distributions.univariate.distribution.SYMBOLIC jpt.distributions.univariate.distribution.NUMERIC jpt.distributions.univariate.distribution.CONTINUOUS jpt.distributions.univariate.distribution.DISCRETE Classes ------- .. autoapisummary:: jpt.distributions.univariate.distribution.ValueMap jpt.distributions.univariate.distribution.Identity jpt.distributions.univariate.distribution.Distribution Module Contents --------------- .. py:data:: SYMBOLIC :value: 'symbolic' .. py:data:: NUMERIC :value: 'numeric' .. py:data:: CONTINUOUS :value: 'continuous' .. py:data:: DISCRETE :value: 'discrete' .. py:class:: ValueMap Bases: :py:obj:`collections.abc.Hashable` .. py:method:: __iter__() :abstractmethod: .. py:method:: __len__() :abstractmethod: .. py:method:: __getitem__(label: Any) :abstractmethod: .. py:method:: __hash__() :abstractmethod: .. py:property:: map .. py:method:: __eq__(other) :abstractmethod: .. py:method:: __contains__(item) :abstractmethod: .. py:class:: Identity Bases: :py:obj:`ValueMap` Simple identity mapping that mimics the __getitem__ protocol of dicts. .. py:method:: __getitem__(item) .. py:property:: map .. py:method:: __eq__(o) .. py:method:: __hash__() .. py:method:: __contains__(item) .. py:class:: Distribution(**settings) Abstract supertype of all domains and distributions .. py:attribute:: values :type: ValueMap :value: None .. py:attribute:: labels :type: ValueMap :value: None .. py:attribute:: SETTINGS .. py:attribute:: _cl :value: 'jpt.distributions.univariate.distribution.Distribution' .. py:attribute:: settings .. py:method:: __getattr__(name) .. py:method:: hash() :classmethod: :abstractmethod: .. py:method:: __hash__() .. py:method:: __getitem__(value) .. py:method:: value2label(value) :classmethod: :abstractmethod: .. py:method:: label2value(label) :classmethod: :abstractmethod: .. py:method:: _sample(n: int) -> Iterable :abstractmethod: .. py:method:: _sample_one() :abstractmethod: .. py:method:: sample(n: int) -> Iterable .. py:method:: sample_one() -> Any .. py:method:: p(value) -> float :abstractmethod: .. py:method:: _p(value) -> float :abstractmethod: .. py:method:: mpe() :abstractmethod: .. py:method:: crop(restriction: Set) -> Distribution :abstractmethod: .. py:method:: _crop(restriction: Set) -> Distribution :abstractmethod: .. py:method:: entropy() -> float :abstractmethod: .. py:method:: merge(distributions: Iterable[Distribution], weights: Iterable[numbers.Real]) -> Distribution :staticmethod: :abstractmethod: .. py:method:: update(dist: Distribution, weight: float) -> Distribution :abstractmethod: .. py:method:: fit(data: numpy.ndarray, rows: numpy.ndarray = None, col: numbers.Integral = None) -> Distribution :abstractmethod: .. py:method:: _fit(data: numpy.ndarray, rows: numpy.ndarray = None, col: numbers.Integral = None) -> Distribution :abstractmethod: .. py:method:: set(params: Any) -> Distribution :abstractmethod: .. py:method:: kl_divergence(other: Distribution) :abstractmethod: .. py:method:: number_of_parameters() -> int :abstractmethod: .. py:method:: jaccard_similarity(d1: Distribution, d2: Distribution) -> float :staticmethod: :abstractmethod: .. py:method:: plot(engine: str, title: str = None, fname: str = None, directory: str = '/tmp', view: bool = False, **kwargs) -> Any :abstractmethod: Generates a plot of the distribution. :param title: the name of the variable this distribution represents :param fname: the name of the file to be stored. Available file formats: png, svg, jpeg, webp, html :param directory: the directory to store the generated plot files :param view: whether to display generated plots, default False (only stores files) :return: the figure object of the plotting engine .. py:method:: to_json() :abstractmethod: .. py:method:: __reduce__() .. py:method:: type_from_json(data: Dict[str, Any]) -> Type[Distribution] :staticmethod: .. py:method:: from_json(dtype: Dict[str, Any], dinst: Dict[str, Any] = None) -> Union[Distribution, Type[Distribution]] :staticmethod: