probabilistic_model.learning.jpt.variables
==========================================

.. py:module:: probabilistic_model.learning.jpt.variables


Classes
-------

.. autoapisummary::

   probabilistic_model.learning.jpt.variables.Integer
   probabilistic_model.learning.jpt.variables.Continuous
   probabilistic_model.learning.jpt.variables.ScaledContinuous


Functions
---------

.. autoapisummary::

   probabilistic_model.learning.jpt.variables.infer_variables_from_dataframe


Module Contents
---------------

.. py:function:: infer_variables_from_dataframe(data: pandas.DataFrame, scale_continuous_types: bool = False, min_likelihood_improvement: float = 0.1, min_samples_per_quantile: int = 10) -> typing_extensions.List[random_events.variable.Variable]

   Infer the variables from a dataframe.
   The variables are inferred by the column names and types of the dataframe.

   :param data: The dataframe to infer the variables from.
   :param scale_continuous_types: Whether to scale numeric types.
   :param min_likelihood_improvement: The minimum likelihood improvement passed to the Continuous Variables.
   :param min_samples_per_quantile: The minimum number of samples per quantile passed to the Continuous Variables.
   :return: The inferred variables.


.. py:class:: Integer(name: str, mean, std)

   Bases: :py:obj:`random_events.variable.Integer`


   Class for ordered, discrete random variables.

   The domain of an integer variable is the number line.


   .. py:attribute:: mean
      :type:  float

      Mean of the random variable.



   .. py:attribute:: std
      :type:  float

      Standard Deviation of the random variable.



   .. py:method:: to_json() -> typing_extensions.Dict[str, typing_extensions.Any]


   .. py:method:: _from_json(data: typing_extensions.Dict[str, typing_extensions.Any]) -> typing_extensions.Self
      :classmethod:


      Create a variable from a json dict.
      This method is called from the from_json method after the correct subclass is determined and should be
      overwritten by the respective subclass.

      :param data: The json dict
      :return: The deserialized object



   .. py:method:: __eq__(other)


   .. py:method:: __hash__()


.. py:class:: Continuous(name: str, mean: float, std: float, minimal_distance: float = 1.0, min_likelihood_improvement: float = 0.1, min_samples_per_quantile: int = 10)

   Bases: :py:obj:`random_events.variable.Continuous`


   Base class for continuous variables in JPTs. This class does not standardize the data,
   but needs to know mean and std anyway.


   .. py:attribute:: mean
      :type:  float

      Mean of the random variable.



   .. py:attribute:: std
      :type:  float

      Standard Deviation of the random variable.



   .. py:attribute:: minimal_distance
      :type:  float

      The minimal distance between two values of the variable.



   .. py:attribute:: min_likelihood_improvement
      :type:  float

      The minimum likelihood improvement passed to the Nyga Distributions.



   .. py:attribute:: min_samples_per_quantile
      :type:  int

      The minimum number of samples per quantile passed to the Nyga Distributions.



   .. py:method:: to_json() -> typing_extensions.Dict[str, typing_extensions.Any]


   .. py:method:: _from_json(data: typing_extensions.Dict[str, typing_extensions.Any]) -> typing_extensions.Self
      :classmethod:


      Create a variable from a json dict.
      This method is called from the from_json method after the correct subclass is determined and should be
      overwritten by the respective subclass.

      :param data: The json dict
      :return: The deserialized object



.. py:class:: ScaledContinuous(name: str, mean: float, std: float, minimal_distance: float = 1.0, min_likelihood_improvement: float = 0.1, min_samples_per_quantile: int = 10)

   Bases: :py:obj:`Continuous`


   A continuous variable that is standardized.


   .. py:method:: encode(value: typing_extensions.Any)


   .. py:method:: decode(value: float) -> float


   .. py:method:: __str__()


