pyrepo_mcda.mcda_methods.promethee ================================== .. py:module:: pyrepo_mcda.mcda_methods.promethee Classes ------- .. autoapisummary:: pyrepo_mcda.mcda_methods.promethee.PROMETHEE_II Module Contents --------------- .. py:class:: PROMETHEE_II Bases: :py:obj:`pyrepo_mcda.mcda_methods.mcda_method.MCDA_method` Preference Ranking Organization Method for Enrichment Evaluation II (PROMETHEE II) for ranking alternatives based on positive, negative, and net preference flows. .. py:method:: __call__(matrix, weights, types, preference_functions=None, p=None, q=None) Score alternatives from decision matrix `matrix` using criteria weights `weights` and criteria types `types` Parameters ---------- matrix : ndarray decision matrix with performance values for m alternatives in rows and n criteria in columns weights : ndarray matrix with criteria weights vectors with number of columns equal to number of columns n of `matrix` types : ndarray vector with criteria types containing values of 1 for profit criteria and -1 for cost criteria with size equal to number of columns n of `matrix` .. py:method:: _usual_function(d, p, q) .. py:method:: _ushape_function(d, p, q) .. py:method:: _vshape_function(d, p, q) .. py:method:: _level_function(d, p, q) .. py:method:: _linear_function(d, p, q) .. py:method:: _gaussian_function(d, p, q) .. py:method:: _promethee_II(self, matrix, weights, types, preference_functions, p, q) :staticmethod: Score alternatives provided in the decision matrix `matrix` using criteria `weights` and criteria `types`. Parameters ----------- matrix : ndarray Decision matrix with m alternatives in rows and n criteria in columns. weights: ndarray Criteria weights. The sum of weights must be equal to 1. types: ndarray Criteria types. Profit criteria are represented by 1 and cost by -1. preference_functions : list List with methods containing preference functions for calculating the preference degree for each criterion. If None, default PROMETHEE preference function (usual) is applied. p : ndarray Vector with values representing the threshold of absolute preference. If None, default PROMETHEE preference thresholds are applied. q : ndarray Vector with values representing the threshold of indifference. If None, default PROMETHEE indifference thresholds are applied. Returns -------- ndrarray Preference values of each alternative. The best alternative has the highest preference value. Examples ---------- >>> promethee_II = PROMETHEE_II() >>> preference_functions = [promethee_II._linear_function for pf in range(len(weights))] >>> u = np.sqrt(np.sum(np.square(np.mean(matrix, axis = 0) - matrix), axis = 0) / matrix.shape[0]) >>> p = 2 * u >>> q = 0.5 * u >>> pref = promethee_II(matrix, weights, types, preference_functions, p = p, q = q) >>> rank = rank_preferences(pref, reverse = True)