pyrepo_mcda.mcda_methods

Submodules

Classes

AHP

ARAS

COCOSO

Helper class that provides a standard way to create an ABC using

CODAS

COPRAS

CRADIS

EDAS

MABAC

MARCOS

MULTIMOORA

MULTIMOORA_RS

PROMETHEE_II

PROSA_C

SAW

SPOTIS

TOPSIS

VIKOR

VMCM

WASPAS

VIKOR_SMAA

PVM

Package Contents

class pyrepo_mcda.mcda_methods.AHP(normalization_method=minmax_normalization)

Bases: pyrepo_mcda.mcda_methods.mcda_method.MCDA_method

normalization_method
__call__(matrix, weights, types)

Score alternatives provided in decision matrix matrix using criteria weights and criteria types.

Parameters

matrixndarray

Decision matrix with numerical performance values of alternatives. Decision matrix includes m alternatives in rows and n criteria in columns.

weights: ndarray

Vector with criteria weights given in numerical values. The sum of weights must be equal to 1.

types: ndarray

Criteria types. Profit criteria are represented by 1 and cost by -1.

Returns

ndrarray

Preference values of each alternative. The best alternative has the highest preference value.

Examples

>>> ahp = AHP()
>>> pref = ahp(matrix, weights, types)
>>> rank = rank_preferences(pref, reverse = True)
_check_consistency(X)

Consistency Check on the Pairwise Comparison Matrix of the Criteria or alternatives

Parameters

Xndarray

matrix of pairwise comparisons

Examples

>>> PCcriteria = np.array([[1, 1, 5, 3], [1, 1, 5, 3], [1/5, 1/5, 1, 1/3], [1/3, 1/3, 3, 1]])
>>> ahp = AHP()
>>> ahp._check_consistency(PCcriteria)
_calculate_eigenvector(X)

Compute the Priority Vector of Criteria (weights) or alternatives using Eigenvector method

Parameters

Xndarray

matrix of pairwise comparisons

Returns

ndarray

Eigenvector

Examples

>>> PCM1 = np.array([[1, 5, 1, 1, 1/3, 3],
[1/5, 1, 1/3, 1/5, 1/7, 1],
[1, 3, 1, 1/3, 1/5, 1],
[1, 5, 3, 1, 1/3, 3],
[3, 7, 5, 3, 1, 7],
[1/3, 1, 1, 1/3, 1/7, 1]])
>>> ahp = AHP()
>>> S = ahp._calculate_eigenvector(PCM1)
_normalized_column_sum(X)

Compute the Priority Vector of Criteria (weights) or alternatives using The normalized column sum method

Parameters

Xndarray

matrix of pairwise comparisons

Returns

ndarray

Vector with weights calculated with The normalized column sum method

Examples

>>> PCM1 = np.array([[1, 5, 1, 1, 1/3, 3],
[1/5, 1, 1/3, 1/5, 1/7, 1],
[1, 3, 1, 1/3, 1/5, 1],
[1, 5, 3, 1, 1/3, 3],
[3, 7, 5, 3, 1, 7],
[1/3, 1, 1, 1/3, 1/7, 1]])
>>> ahp = AHP()
>>> S = ahp._normalized_column_sum(PCM1)
_geometric_mean(X)

Compute the Priority Vector of Criteria (weights) or alternatives using The geometric mean method

Parameters

Xndarray

matrix of pairwise comparisons

Returns

ndarray

Vector with weights calculated with The geometric mean method

Examples

>>> PCM1 = np.array([[1, 5, 1, 1, 1/3, 3],
[1/5, 1, 1/3, 1/5, 1/7, 1],
[1, 3, 1, 1/3, 1/5, 1],
[1, 5, 3, 1, 1/3, 3],
[3, 7, 5, 3, 1, 7],
[1/3, 1, 1, 1/3, 1/7, 1]])
>>> ahp = AHP()
>>> S = ahp._geometric_mean(PCM1)
_classic_ahp(alt_matrices, weights, calculate_priority_vector_method=None)

Calculate the global alternative priorities. This is a method for classic AHP where you provide matrices with values of pairwise comparisons of alternatives and weights in the form of a priority vector.

Parameters

alt_matriceslist

list with matrices including values of pairwise comparisons of alternatives

weightsndarray

priority vector of criteria (weights)

calculate_priority_vector_methodfunction

Method for calculation of the priority vector. It can be chosen from three available methods: _calculate_eigenvector, _normalized_column_sum and _geometric_mean if the user does not provide calculate_priority_vector_method, it is automatically set as the default _calculate_eigenvector

Returns

ndarray

vector with the global alternative priorities

Examples

>>> PCcriteria = np.array([[1, 1, 5, 3], [1, 1, 5, 3],
[1/5, 1/5, 1, 1/3], [1/3, 1/3, 3, 1]])
>>> PCM1 = np.array([[1, 5, 1, 1, 1/3, 3],
[1/5, 1, 1/3, 1/5, 1/7, 1],
[1, 3, 1, 1/3, 1/5, 1],
[1, 5, 3, 1, 1/3, 3],
[3, 7, 5, 3, 1, 7],
[1/3, 1, 1, 1/3, 1/7, 1]])
>>> PCM2 = np.array([[1, 7, 3, 1/3, 1/3, 1/3],
[1/7, 1, 1/3, 1/7, 1/9, 1/7],
[1/3, 3, 1, 1/5, 1/5, 1/5],
[3, 7, 5, 1, 1, 1],
[3, 9, 5, 1, 1, 1],
[3, 7, 5, 1, 1, 1]])
>>> PCM3 = np.array([[1, 1/9, 1/7, 1/9, 1, 1/5],
[9, 1, 1, 1, 5, 3],
[7, 1, 1, 1, 5, 1],
[9, 1, 1, 1, 7, 3],
[1, 1/5, 1/5, 1/7, 1, 1/3],
[5, 1/3, 1, 1/3, 3, 1]])
>>> PCM4 = np.array([[1, 1/5, 1/5, 1/3, 1/7, 1/5],
[5, 1, 1, 3, 1/3, 1],
[5, 1, 1, 1, 1/3, 1],
[3, 1/3, 1, 1, 1/7, 1],
[7, 3, 3, 7, 1, 5],
[5, 1, 1, 1, 1/5, 1]])
>>> ahp = AHP()
>>> ahp._check_consistency(PCcriteria)
>>> weights = ahp._calculate_eigenvector(PCcriteria)
>>> alt_matrices = []
>>> alt_matrices.append(PCM1)
>>> alt_matrices.append(PCM2)
>>> alt_matrices.append(PCM3)
>>> alt_matrices.append(PCM4)
>>> calculate_priority_vector_method = ahp._calculate_eigenvector
>>> pref = ahp._classic_ahp(alt_matrices, weights, calculate_priority_vector_method)
>>> rank = rank_preferences(pref, reverse = True)
static _ahp(self, matrix, weights, types, normalization_method)

Score alternatives provided in decision matrix matrix using criteria weights and criteria types.

Parameters

matrixndarray

Decision matrix with numerical performance values of alternatives. The decision matrix includes m alternatives in rows and n criteria in columns.

weights: ndarray

Vector with criteria weights given in numerical values. The sum of weights must be equal to 1.

types: ndarray

Criteria types. Profit criteria are represented by 1 and cost by -1.

Returns

ndrarray

Preference values of each alternative. The best alternative has the highest preference value.

Examples

>>> ahp = AHP()
>>> pref = ahp(matrix, weights, types)
>>> rank = rank_preferences(pref, reverse = True)
class pyrepo_mcda.mcda_methods.ARAS(normalization_method=sum_normalization)

Bases: pyrepo_mcda.mcda_methods.mcda_method.MCDA_method

normalization_method
__call__(matrix, weights, types)

Score alternatives provided in decision matrix matrix using criteria weights and criteria types.

Parameters

matrixndarray

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

ndrarray

Preference values of each alternative. The best alternative has the highest preference value.

Examples

>>> aras = ARAS()
>>> pref = aras(matrix, weights, types)
>>> rank = rank_preferences(pref, reverse = True)
static _aras(matrix, weights, types, normalization_method)
class pyrepo_mcda.mcda_methods.COCOSO(normalization_method=minmax_normalization, lambda_param=0.5)

Bases: pyrepo_mcda.mcda_methods.mcda_method.MCDA_method

Helper class that provides a standard way to create an ABC using inheritance.

normalization_method
lambda_param
__call__(matrix, weights, types)

Score alternatives provided in decision matrix matrix with m alternatives in rows and n criteria in columns using criteria weights and criteria types.

Parameters

matrixndarray

Decision matrix with m alternatives in rows and n criteria in columns.

weights: ndarray

Vector with criteria weights. Sum of weights must be equal to 1.

types: ndarray

Vector with criteria types. Profit criteria are represented by 1 and cost by -1.

Returns

ndrarray

Vector with preference values of each alternative. The best alternative has the highest preference value.

Examples

>>> cocoso = COCOSO(lambda_param = lambda_param)
>>> pref = cocoso(matrix, weights, types)
>>> rank = rank_preferences(pref, reverse = True)
static _cocoso(matrix, weights, types, normalization_method=minmax_normalization, lambda_param=0.5)
class pyrepo_mcda.mcda_methods.CODAS(normalization_method=linear_normalization, distance_metric=euclidean, tau=0.02)

Bases: pyrepo_mcda.mcda_methods.mcda_method.MCDA_method

normalization_method
distance_metric
tau
__call__(matrix, weights, types)

Score alternatives provided in decision matrix matrix with m alternatives and n criteria using criteria weights and criteria types.

Parameters

matrixndarray

Decision matrix with m alternatives in rows and n criteria in columns.

weights: ndarray

Vector with criteria weights. Sum of weights must be equal to 1.

types: ndarray

Vector with criteria types. Profit criteria are represented by 1 and cost by -1.

Returns

ndrarray

Vector with preference values of each alternative. The best alternative has the highest preference value.

Examples

>>> codas = CODAS(normalization_method = linear_normalization, distance_metric = euclidean, tau = 0.02)
>>> pref = codas(matrix, weights, types)
>>> rank = rank_preferences(pref, reverse = True)
_psi(x)
static _codas(self, matrix, weights, types, normalization_method, distance_metric)
class pyrepo_mcda.mcda_methods.COPRAS(normalization_method=sum_normalization)

Bases: pyrepo_mcda.mcda_methods.mcda_method.MCDA_method

normalization_method
__call__(matrix, weights, types)

Score alternatives provided in decision matrix matrix using criteria weights and criteria types.

Parameters

matrixndarray

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

ndrarray

Preference values of each alternative. The best alternative has the highest preference value.

Examples

>>> copras = COPRAS(normalization_method = sum_normalization)
>>> pref = copras(matrix, weights, types)
>>> rank = rank_preferences(pref, reverse = True)
static _copras(matrix, weights, types, normalization_method)
class pyrepo_mcda.mcda_methods.CRADIS(normalization_method=linear_normalization)

Bases: pyrepo_mcda.mcda_methods.mcda_method.MCDA_method

normalization_method
__call__(matrix, weights, types)

Score alternatives provided in decision matrix matrix using criteria weights and criteria types.

Parameters

matrixndarray

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

ndrarray

Preference values of each alternative. The best alternative has the highest preference value.

Examples

>>> cradis = CRADIS()
>>> pref = cradis(matrix, weights, types)
>>> rank = rank_preferences(pref, reverse = True)
static _cradis(matrix, weights, types, normalization_method)
class pyrepo_mcda.mcda_methods.EDAS

Bases: pyrepo_mcda.mcda_methods.mcda_method.MCDA_method

__call__(matrix, weights, types)

Score alternatives provided in decision matrix matrix using criteria weights and criteria types.

Parameters

matrixndarray

Decision matrix with m alternatives in rows and n criteria in columns.

weights: ndarray

Vector with criteria weights. Sum of weights must be equal to 1.

types: ndarray

Vevtor with criteria types. Profit criteria are represented by 1 and cost by -1.

Returns

ndrarray

Vector with preference values of each alternative. The best alternative has the highest preference value.

Examples

>>> edas = EDAS()
>>> pref = edas(matrix, weights, types)
>>> rank = rank_preferences(pref, reverse = True)
_edas(weights, types)
class pyrepo_mcda.mcda_methods.MABAC(normalization_method=minmax_normalization)

Bases: pyrepo_mcda.mcda_methods.mcda_method.MCDA_method

normalization_method
__call__(matrix, weights, types)

Score alternatives provided in decision matrix matrix using criteria weights and criteria types.

Parameters

matrixndarray

Decision matrix with m alternatives in rows and n criteria in columns.

weights: ndarray

Vector with criteria weights. Sum of weights must be equal to 1.

types: ndarray

Vector with criteria types. Profit criteria are represented by 1 and cost by -1.

Returns

ndrarray

Vector with preference values of each alternative. The best alternative has the highest preference value.

Examples

>>> mabac = MABAC(normalization_method = minmax_normalization)
>>> pref = mabac(matrix, weights, types)
>>> rank = rank_preferences(pref, reverse = True)
_mabac(weights, types, normalization_method)
class pyrepo_mcda.mcda_methods.MARCOS

Bases: pyrepo_mcda.mcda_methods.mcda_method.MCDA_method

__call__(matrix, weights, types)

Score alternatives provided in decision matrix matrix using criteria weights and criteria types.

Parameters

matrixndarray

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

ndrarray

Preference values of each alternative. The best alternative has the highest preference value.

Examples

>>> marcos = MARCOS()
>>> pref = marcos(matrix, weights, types)
>>> rank = rank_preferences(pref, reverse = True)
static _marcos(matrix, weights, types)
class pyrepo_mcda.mcda_methods.MULTIMOORA(compromise_rank_method=dominance_directed_graph)

Bases: pyrepo_mcda.mcda_methods.mcda_method.MCDA_method

compromise_rank_method
__call__(matrix, weights, types)

Score alternatives provided in decision matrix matrix using vector with criteria weights weights and vector with criteria types types.

Parameters

matrixndarray

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

ndrarray

Preference values of each alternative. The best alternative has the highest preference value.

Examples

>>> multimoora = MULTIMOORA()
>>> rank = multimoora(matrix, weights, types)
_multimoora(weights, types, compromise_rank_method)
class pyrepo_mcda.mcda_methods.MULTIMOORA_RS

Bases: pyrepo_mcda.mcda_methods.mcda_method.MCDA_method

__call__(matrix, weights, types)

Score alternatives provided in decision matrix matrix using vector with criteria weights weights and vector with criteria types types.

Parameters

matrixndarray

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

ndrarray

Preference values of each alternative. The best alternative has the highest preference value.

Examples

>>> multimoora_rs = MULTIMOORA_RS()
>>> pref = multimoora_rs(matrix, weights, types)
>>> rank = rank_preferences(pref, reverse = True)
static _multimoora_rs(matrix, weights, types)
class pyrepo_mcda.mcda_methods.PROMETHEE_II

Bases: pyrepo_mcda.mcda_methods.mcda_method.MCDA_method

__call__(matrix, weights, types, preference_functions=None, p=None, q=None)
_usual_function(d, p, q)
_ushape_function(d, p, q)
_vshape_function(d, p, q)
_level_function(d, p, q)
_linear_function(d, p, q)
_gaussian_function(d, p, q)
static _promethee_II(self, matrix, weights, types, preference_functions, p, q)

Score alternatives provided in the decision matrix matrix using criteria weights and criteria types.

Parameters

matrixndarray

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_functionslist

List with methods containing preference functions for calculating the preference degree for each criterion.

pndarray

Vector with values representing the threshold of absolute preference.

qndarray

Vector with values representing the threshold of indifference.

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)
class pyrepo_mcda.mcda_methods.PROSA_C

Bases: pyrepo_mcda.mcda_methods.promethee.PROMETHEE_II

__call__(matrix, weights, types, preference_functions=None, p=None, q=None, s=None)
static _prosa_c(self, matrix, weights, types, preference_functions, p, q, s)

Score alternatives provided in the decision matrix matrix using criteria weights and criteria types.

Parameters

matrixndarray

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_functionslist

List with methods containing preference functions for calculating the preference degree for each criterion.

pndarray

Vector with values representing the threshold of absolute preference.

qndarray

Vector with values representing the threshold of indifference.

sndarray

Vector with values of the coefficient sj for the criteria

Returns

ndrarray

Preference values of each alternative. The best alternative has the highest preference value.

Examples

>>> prosa_c = PROSA_C()
>>> preference_functions = [prosa_c._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
>>> s = np.repeat(0.3, len(weights))
>>> pref = promethee_II(matrix, weights, types, preference_functions, p = p, q = q, s = s)
>>> rank = rank_preferences(pref, reverse = True)
class pyrepo_mcda.mcda_methods.SAW(normalization_method=linear_normalization)

Bases: pyrepo_mcda.mcda_methods.mcda_method.MCDA_method

normalization_method
__call__(matrix, weights, types)

Score alternatives provided in decision matrix matrix with m alternatives in rows and n criteria in columns using criteria weights and criteria types.

Parameters

matrixndarray

Decision matrix with m alternatives in rows and n criteria in columns.

weights: ndarray

Vector with criteria weights. Sum of weights must be equal to 1.

types: ndarray

Vector with criteria types. Profit criteria are represented by 1 and cost by -1.

Returns

ndrarray

Vector with preference values of each alternative. The best alternative has the highest preference value.

Examples

>>> saw = SAW(normalization_method = minmax_normalization)
>>> pref = saw(matrix, weights, types)
>>> rank = rank_preferences(pref, reverse = True)
static _saw(matrix, weights, types, normalization_method)
class pyrepo_mcda.mcda_methods.SPOTIS

Bases: pyrepo_mcda.mcda_methods.mcda_method.MCDA_method

__call__(matrix, weights, types, bounds)

Score alternatives provided in decision matrix matrix using criteria weights and criteria types.

Parameters

matrixndarray

Decision matrix with m alternatives in rows and n criteria in columns.

weights: ndarray

Vector with criteria weights. Sum of weights must be equal to 1.

types: ndarray

Vector with criteria types. Profit criteria are represented by 1 and cost by -1.

bounds: ndarray

Bounds is ndarray with 2 rows and number of columns equal to criteria number. Bounds contain minimum values in the first row and maximum values in the second row for each criterion. Minimum and maximum values for the same criterion cannot be the same.

Returns

ndrarray

Vector with preference values of each alternative. The best alternative has the lowest preference value.

Examples

>>> bounds_min = np.amin(matrix, axis = 0)
>>> bounds_max = np.amax(matrix, axis = 0)
>>> bounds = np.vstack((bounds_min, bounds_max))
>>> spotis = SPOTIS()
>>> pref = spotis(matrix, weights, types, bounds)
>>> rank = rank_preferences(pref, reverse = False)
static _spotis(matrix, weights, types, bounds)
class pyrepo_mcda.mcda_methods.TOPSIS(normalization_method=minmax_normalization, distance_metric=euclidean)

Bases: pyrepo_mcda.mcda_methods.mcda_method.MCDA_method

normalization_method
distance_metric
__call__(matrix, weights, types)

Score alternatives provided in decision matrix matrix with m alternatives in rows and n criteria in columns using criteria weights and criteria types.

Parameters

matrixndarray

Decision matrix with m alternatives in rows and n criteria in columns.

weights: ndarray

Vector with criteria weights. Sum of weights must be equal to 1.

types: ndarray

Vector with criteria types. Profit criteria are represented by 1 and cost by -1.

Returns

ndrarray

Vector with preference values of each alternative. The best alternative has the highest preference value.

Examples

>>> topsis = TOPSIS(normalization_method = minmax_normalization, distance_metric = euclidean)
>>> pref = topsis(matrix, weights, types)
>>> rank = rank_preferences(pref, reverse = True)
static _topsis(matrix, weights, types, normalization_method, distance_metric)
class pyrepo_mcda.mcda_methods.VIKOR(normalization_method=None, v=0.5)

Bases: pyrepo_mcda.mcda_methods.mcda_method.MCDA_method

v
normalization_method
__call__(matrix, weights, types)

Score alternatives provided in decision matrix matrix using criteria weights and criteria types.

Parameters

matrixndarray

Decision matrix with m alternatives in rows and n criteria in columns.

weights: ndarray

Vector with criteria weights. Sum of weights must be equal to 1.

types: ndarray

Vector with criteria types. Profit criteria are represented by 1 and cost by -1.

Returns

ndrarray

Vector with preference values of each alternative. The best alternative has the lowest preference value.

Examples

>>> vikor = VIKOR(normalization_method = minmax_normalization)
>>> pref = vikor(matrix, weights, types)
>>> rank = rank_preferences(pref, reverse = False)
static _vikor(matrix, weights, types, normalization_method, v)
class pyrepo_mcda.mcda_methods.VMCM

Bases: pyrepo_mcda.mcda_methods.mcda_method.MCDA_method

_elimination(matrix)

Calculate significance coefficient values for each criterion. Criteria with significance coefficient values between 0 and 0.1 are recommended to be eliminated from the considered criteria set.

Parameters

matrixndarray

Decision matrix with m alternatives in rows and n criteria in columns.

Examples

>>> vmcm = VMCM()
>>> vmcm._elimination(matrix)
_weighting(matrix)

Calculate criteria weights

Parameters

matrixndarray

Decision matrix with m alternatives in rows and n criteria in columns.

Returns

ndarray

Vector with criteria weights

Examples

>>> vmcm = VMCM()
>>> weights = vmcm._weighting(matrix)
_normalization(matrix)

Calculates normalized matrix

Parameters

matrixndarray

Decision matrix with m alternatives in rows and n criteria in columns.

Returns

ndarray

Normalized matrix

Examples

>>> vmcm = VMCM()
>>> norm_matrix = vmcm._normalization(matrix)
_pattern_determination(matrix, types)

Automatic determination of pattern and anti-pattern

Parameters

matrixndarray

Decision matrix with m alternatives in rows and n criteria in columns.

Returns

ndarray, ndarray

Two vectors including values respectively of pattern and anti-pattern

Examples

>>> vmcm = VMCM()
>>> pattern, antipattern = vmcm._pattern_determination(matrix, types)
_classification(m)

Assign evaluated objects to classes

Parameters

mndarray

Vector with values of synthetic measure

Returns

ndarray

Vector including classes assigned to evaluated objects

Examples

>>> vmcm = VMCM()
>>> pref = vmcm(matrix, weights, types)
>>> classes = vmcm._classification(pref)
__call__(matrix, weights, types, pattern, anti_pattern)

Score alternatives provided in decision matrix matrix with m alternatives in rows and n criteria in columns using criteria weights and criteria types.

Parameters

matrixndarray

Decision matrix with m alternatives in rows and n criteria in columns.

weights: ndarray

Vector with criteria weights. Sum of weights must be equal to 1.

typesndarray

Vector with criteria types. Profit criteria are represented by 1 and cost by -1.

patternndarray

Vector with values of pattern

anti_patternndarray

Vector with values of anti-pattern

Returns

ndrarray

Vector with preference values of each alternative. The best alternative has the highest preference value.

Examples

>>> vmcm = VMCM()
>>> pattern, antipattern = vmcm._pattern_determination(matrix, types)
>>> pref = vmcm(matrix, weights, types, pattern, antipattern)
>>> rank = rank_preferences(pref, reverse = True)
static _vmcm(self, matrix, weights, types, pattern, anti_pattern)
class pyrepo_mcda.mcda_methods.WASPAS(normalization_method=linear_normalization, lambda_param=0.5)

Bases: pyrepo_mcda.mcda_methods.mcda_method.MCDA_method

normalization_method
lambda_param
__call__(matrix, weights, types)

Score alternatives provided in decision matrix matrix with m alternatives and n criteria using criteria weights and criteria types.

Parameters

matrixndarray

Decision matrix with m alternatives in rows and n criteria in columns.

weights: ndarray

Vector with criteria weights. Sum of weights must be equal to 1.

types: ndarray

Vector with criteria types. Profit criteria are represented by 1 and cost by -1.

Returns

ndrarray

Vector with preference values of each alternative. The best alternative has the highest preference value.

Examples

>>> waspas = WASPAS(normalization_method = linear_normalization, lambda_param = 0.5)
>>> pref = waspas(matrix, weights, types)
>>> rank = rank_preferences(pref, reverse = True)
static _waspas(matrix, weights, types, normalization_method, lambda_param)
class pyrepo_mcda.mcda_methods.VIKOR_SMAA(normalization_method=None, v=0.5)
v
normalization_method
__call__(matrix, weights, types)

Score alternatives provided in decision matrix matrix using criteria weights and criteria types.

Parameters

matrixndarray

Decision matrix with m alternatives in rows and n criteria in columns.

weightsndarray

Matrix with i vectors in rows of n weights in columns. i means number of iterations of SMAA

typesndarray

Vector with criteria types. Profit criteria are represented by 1 and cost by -1.

Returns

ndrarray, ndarray, ndarray

Matrix with acceptability indexes values for each alternative in rows in relation to each rank in columns, Matrix with central weight vectors for each alternative in rows Matrix with final ranking of alternatives

Examples

>>> vikor_smaa = VIKOR_SMAA(normalization_method = minmax_normalization)
>>> rank_acceptability_index, central_weight_vector, rank_scores = vikor_smaa(matrix, weights, types)
_generate_weights(n, iterations)

Function to generate multiple weight vectors

Parameters

nint

Number of criteria

iterationsint

Number of weight vector to generate

Returns

ndarray

Matrix containing in rows vectors with weights for n criteria

static _vikor_smaa(self, matrix, weights, types, normalization_method, v)
class pyrepo_mcda.mcda_methods.PVM
__call__(matrix, weights, types, psi=None, phi=None)

Score alternatives provided in decision matrix matrix using criteria weights and criteria types.

Parameters

matrixndarray

Decision matrix with m alternatives in rows and n criteria in columns.

weights: ndarray

Attribute weights to the criteria. Sum of weights must be equal to 1.

types: list

Define the criteria character: Motivating criteria are represented by m Demotivating criteria are represented by dm Desirable criteria are represented by d Non-desirable criteria are represented by nd

psi: ndarray

Preference vector with motivating or desirable values. Providing of psi is optional.

phi: ndarray

Preference vector with demotivating or non-desirable values. Providing of psi is optional.

Returns

ndrarray

Preference values of each alternative. The best alternative has the highest preference value.

Examples

>>> pvm = PVM()
>>> pref = pvm(matrix, weights, types)
>>> rank = rank_preferences(pref, reverse = True)
static _pvm(matrix, weights, types, psi, phi)