# skcriteria.madm.simple module¶

Simplests method of multi-criteria

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 multi-criteria 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}^{WSM-score}$$, is defined as follows:

$A_{i}^{WSM-score} = \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. Decision : skcriteria.madm.Decision With values: kernel_: None rank_: A ranking (start at 1) where the i-nth element represent the position of the i-nth 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 i-nth element represent the importance of the i-nth alternative.

Notes

If some criteria is for minimization, this implementation calculates the inverse.

References

 [R12] Fishburn, P. C. (1967). Letter to the editor—additive utilities with incomplete product sets: application to priorities and assignments. Operations Research, 15(3), 537-542.
 [R13] Weighted sum model. In Wikipedia, The Free Encyclopedia. Retrieved from https://en.wikipedia.org/wiki/Weighted_sum_model
 [R14] 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(**kwargs) Execute the multi-criteria method.
solve(**kwargs)[source]

Execute the multi-criteria method.

Parameters: data : skcriteria.Data Preprocessed Data. object object or tuple of objects with the raw result data.
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 multi-criteria 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}^{WPM-score}$$, is defined as follows:

$A_{i}^{WPM-score} = \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}^{WPM-score}$$, is finally defined as:

$A_{i}^{WPM-score} = \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. Decision : skcriteria.madm.Decision With values: kernel_: None rank_: A ranking (start at 1) where the i-nth element represent the position of the i-nth 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 i-nth element represent the importance of the i-nth alternative.

Notes

The implementation works as follow:

• If we have some values of any criteria < 0 in the alternative-matrix 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

 [R15] Bridgman, P.W. (1922). Dimensional Analysis. New Haven, CT, U.S.A.: Yale University Press.
 [R16] Miller, D.W.; M.K. Starr (1969). Executive Decisions and Operations Research. Englewood Cliffs, NJ, U.S.A.: Prentice-Hall, Inc.
 [R17] Wen, Y. (2007, September 16). Using log-transform 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(**kwargs) Normalize the alternative matrix and weight vector. solve(**kwargs) Execute the multi-criteria method.
preprocess(**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 skcriteria.Data A new instance of data with the mtx attributes normalized with mnorm and weights normalized with wnorm. anames and cnames are preseved
solve(**kwargs)[source]

Execute the multi-criteria method.

Parameters: data : skcriteria.Data Preprocessed Data. object object or tuple of objects with the raw result data.