skcriteria.madm.simple
module¶
Simplests method of multicriteria

class
skcriteria.madm.simple.
WeightedSum
(mnorm=u'sum', wnorm=u'sum')[source]¶ Bases:
skcriteria.madm._dmaker.DecisionMaker
The weighted sum model (WSM) is the best known and simplest multicriteria decision analysis for evaluating a number of alternatives in terms of a number of decision criteria. It is very important to state here that it is applicable only when all the data are expressed in exactly the same unit. If this is not the case, then the final result is equivalent to “adding apples and oranges.” To avoid this problem a previous normalization step is necesary.
In general, suppose that a given MCDA problem is defined on \(m\) alternatives and \(n\) decision criteria. Furthermore, let us assume that all the criteria are benefit criteria, that is, the higher the values are, the better it is. Next suppose that \(w_j\) denotes the relative weight of importance of the criterion \(C_j\) and \(a_{ij}\) is the performance value of alternative \(A_i\) when it is evaluated in terms of criterion \(C_j\). Then, the total (i.e., when all the criteria are considered simultaneously) importance of alternative \(A_i\), denoted as \(A_{i}^{WSMscore}\), is defined as follows:
\[A_{i}^{WSMscore} = \sum_{j=1}^{n} w_j a_{ij},\ for\ i = 1,2,3,...,m\]For the maximization case, the best alternative is the one that yields the maximum total performance value.
Parameters: mnorm : string, callable, optional (default=”sum”)
Normalization method for the alternative matrix.
wnorm : string, callable, optional (default=”sum”)
Normalization method for the weights array.
Returns: Decision :
skcriteria.madm.Decision
With values:
 kernel_: None
 rank_: A ranking (start at 1) where the inth element represent the position of the inth alternative.
 best_alternative_: The index of the best alternative.
 alpha_solution_: True
 beta_solution_: False
 gamma_solution_: True
 e_: Particular data created by this method.
 e_.points: Array where the inth element represent the importance of the inth alternative.
Notes
If some criteria is for minimization, this implementation calculates the inverse.
References
[R2328] Fishburn, P. C. (1967). Letter to the editor—additive utilities with incomplete product sets: application to priorities and assignments. Operations Research, 15(3), 537542. [R2428] Weighted sum model. In Wikipedia, The Free Encyclopedia. Retrieved from https://en.wikipedia.org/wiki/Weighted_sum_model [R2528] Tzeng, G. H., & Huang, J. J. (2011). Multiple attribute decision making: methods and applications. CRC press. Attributes
mnorm
Normalization function for the alternative matrix. wnorm
Normalization function for the weights vector. Methods
as_dict
()Create a simply dict
representation of the object.decide
(data[, criteria, weights])Execute the Solver over the given data. make_result
(data, kernel, rank, extra)Create a new skcriteria.madm.Decision
preprocess
(data)Normalize the alternative matrix and weight vector. solve
(*args, **kwargs)Execute the multicriteria method.

class
skcriteria.madm.simple.
WeightedProduct
(mnorm=u'sum', wnorm=u'sum')[source]¶ Bases:
skcriteria.madm._dmaker.DecisionMaker
The weighted product model (WPM) is a popular multicriteria decision analysis method. It is similar to the weighted sum model. The main difference is that instead of addition in the main mathematical operation now there is multiplication.
In general, suppose that a given MCDA problem is defined on \(m\) alternatives and \(n\) decision criteria. Furthermore, let us assume that all the criteria are benefit criteria, that is, the higher the values are, the better it is. Next suppose that \(w_j\) denotes the relative weight of importance of the criterion \(C_j\) and \(a_{ij}\) is the performance value of alternative \(A_i\) when it is evaluated in terms of criterion \(C_j\). Then, the total (i.e., when all the criteria are considered simultaneously) importance of alternative \(A_i\), denoted as \(A_{i}^{WPMscore}\), is defined as follows:
\[A_{i}^{WPMscore} = \prod_{j=1}^{n} a_{ij}^{w_j},\ for\ i = 1,2,3,...,m\]To avoid underflow, instead the multiplication of the values we add the logarithms of the values; so \(A_{i}^{WPMscore}\), is finally defined as:
\[A_{i}^{WPMscore} = \sum_{j=1}^{n} w_j \log(a_{ij}), for\ i = 1,2,3,...,m\]For the maximization case, the best alternative is the one that yields the maximum total performance value.
Parameters: mnorm : string, callable, optional (default=”sum”)
Normalization method for the alternative matrix.
wnorm : string, callable, optional (default=”sum”)
Normalization method for the weights array.
Returns: Decision :
skcriteria.madm.Decision
With values:
 kernel_: None
 rank_: A ranking (start at 1) where the inth element represent the position of the inth alternative.
 best_alternative_: The index of the best alternative.
 alpha_solution_: True
 beta_solution_: False
 gamma_solution_: True
 e_: Particular data created by this method.
 e_.points: Array where the inth element represent the importance of the inth alternative.
Notes
The implementation works as follow:
 If we have some values of any criteria < 0 in the alternativematrix we add the minimimun value of this criteria to all the criteria.
 If we have some 0 in some criteria all the criteria is incremented by 1.
 If some criteria is for minimization, this implementation calculates the inverse.
 Instead the multiplication of the values we add the logarithms of the values to avoid underflow.
References
[R2631] Bridgman, P.W. (1922). Dimensional Analysis. New Haven, CT, U.S.A.: Yale University Press. [R2731] Miller, D.W.; M.K. Starr (1969). Executive Decisions and Operations Research. Englewood Cliffs, NJ, U.S.A.: PrenticeHall, Inc. [R2831] Wen, Y. (2007, September 16). Using logtransform to avoid underflow problem in computing posterior probabilities. from http://web.mit.edu/wenyang/www/log_transform_for_underflow.pdf Attributes
mnorm
Normalization function for the alternative matrix. wnorm
Normalization function for the weights vector. Methods
as_dict
()Create a simply dict
representation of the object.decide
(data[, criteria, weights])Execute the Solver over the given data. make_result
(data, kernel, rank, extra)Create a new skcriteria.madm.Decision
preprocess
(*args, **kwargs)Normalize the alternative matrix and weight vector. solve
(*args, **kwargs)Execute the multicriteria method. 
preprocess
(*args, **kwargs)[source]¶ Normalize the alternative matrix and weight vector.
Creates a new instance of data by aplying the normalization function to the alternative matrix and the weights vector containded inside the given data.
Parameters: data :
skcriteria.Data
A data to be Preprocessed
Returns: skcriteria.Data
A new instance of data with the
mtx
attributes normalized withmnorm
andweights
normalized with wnorm.anames
andcnames
are preseved