distance_metrics_mcda.mcda_methods.topsis
Module Contents
Classes
Helper class that provides a standard way to create an ABC using |
- class distance_metrics_mcda.mcda_methods.topsis.TOPSIS(normalization_method=minmax_normalization, distance_metric=euclidean)[source]
Bases:
distance_metrics_mcda.mcda_methods.mcda_method.MCDA_methodHelper class that provides a standard way to create an ABC using inheritance.
- __call__(self, matrix, weights, types)[source]
Score alternatives provided in 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. Sum of weights must be equal to 1.
types (ndarray) – Criteria types. Profit criteria are represented by 1 and cost by -1.
- Returns
Preference values of each alternative. The best alternative has the highest preference value.
- Return type
ndrarray
Examples
>>> topsis = TOPSIS(normalization_method = minmax_normalization, distance_metric = euclidean) >>> pref = topsis(matrix, weights, types) >>> rank = rank_preferences(pref, reverse = True)