:py:mod:`desdeo_mcdm.approximation`
===================================

.. py:module:: desdeo_mcdm.approximation

.. autoapi-nested-parse::

   This module contains methods that approximate the Pareto front



Submodules
----------
.. toctree::
   :titlesonly:
   :maxdepth: 1

   PAINT/index.rst


Package Contents
----------------

Classes
~~~~~~~

.. autoapisummary::

   desdeo_mcdm.approximation.PAINT




.. py:class:: PAINT(po_outcomes: desdeo_tools.utilities.polytopes.np.ndarray)

   PAINT method implementation. PAINT: Pareto front interpolation for nonlinear
   multiobjective optimization. DOI 10.1007/s10589-011-9441-z

   :param po_outcomes: Initial set of Pareto optimal outcomes which
                       will be used to construct the approximation of the Pareto front.
   :type po_outcomes: np.ndarray

   :raises PAINTException: The count of supplied pareto optimal outcomes
       is not higher than the dimension of the objective spaces. This
       means that the Delaunay triangulation cannot be formed and therefore
       neither can the PAINT approximation.

   .. py:method:: sort_wrt_entries(arr: desdeo_tools.utilities.polytopes.np.ndarray) -> desdeo_tools.utilities.polytopes.np.ndarray

      Sort an array with regards to number of unique entries in a row in increasing order and if those
      match then by the smallest value in the row.

      :param arr: Array to be sorted.
      :type arr: np.ndarray

      Returns
          np.ndarray: The given array but sorted.


   .. py:method:: perturbate(epsilon: Optional[float] = 1e-06)

      Perturbate pareto optimal outcomes by maximum of epsilon.
      This is only needed if the initial Pareto optimal outcomes are not in general position

      :param epsilon: The maximum value each point can change to either direction
      :type epsilon: Optional[float], optional


   .. py:method:: approximate(po_outcomes: Optional[desdeo_tools.utilities.polytopes.np.ndarray] = None, epsilon: Optional[float] = 1e-06, method: Optional[str] = 'simplex', print_info: Optional[bool] = False) -> desdeo_tools.utilities.polytopes.np.ndarray

      PAINT: Pareto front interpolation for nonlinear multiobjective optimization.
      Constructs a D-maximal inherently nondominated Pareto front approximation.

      :param po_outcomes: A set of pareto optimal outcomes
      :type po_outcomes: Optional[np.ndarray], optional
      :param epsilon: The certainty value for the polytope_dominates function.
      :type epsilon: Optional[float], optional
      :param method: Algorithm used to solve the optimization problems.
                     See scipy.optimize.linprog for further details. Defaults to 'simplex'
                     which is used in the article. Other methods are faster and more accurate but give
                     different results compared to the article.
      :type method: Optional[str], optional
      :param print_info: Should the method print information such as information
                         about percentages of deleted polytopes
      :type print_info: Optional[bool], optional

      :returns:

                An array of indices corresponding to the po_outcomes which represent
                    the polytopes that form the approximation. If a polytope has fewer
                    outcomes than there are columns in the given array the first value of
                    the row representing the polytope is repeated until the lengths match.
      :rtype: np.ndarray

      :raises PAINTException: Failed to construct the Delaunay Triangulation.



.. py:exception:: PAINTException

   Bases: :py:obj:`Exception`

   Raised when an exception related to PAINT raises.


