Problem: wybór kandydata na prezesa.

Rozbicie problemu:

Skala porównań:


In [1]:
from ahp import AHP
ahp = AHP()
result = ahp.run()

Wyniki porównań kandydatów względem kryteriów


In [2]:
print(ahp.judgements['experience'])
print(ahp.judgements_eig['experience'])


[[ 1.       0.25     4.     ]
 [ 4.       1.       9.     ]
 [ 0.25     0.11111  1.     ]]
[ 0.21716558  0.71706531  0.0657691 ]


In [3]:
print(ahp.judgements['education'])
print(ahp.judgements_eig['education'])


[[ 1.       3.       0.2    ]
 [ 0.33333  1.       0.14286]
 [ 5.       7.       1.     ]]
[ 0.18839415  0.08096168  0.73064418]


In [4]:
print(ahp.judgements['charisma'])
print(ahp.judgements_eig['charisma'])


[[ 1.       5.       9.     ]
 [ 0.2      1.       4.     ]
 [ 0.11111  0.25     1.     ]]
[ 0.74286693  0.19388158  0.06325149]


In [5]:
print(ahp.judgements['age'])
print(ahp.judgements_eig['age'])


[[ 1.       0.33333  5.     ]
 [ 3.       1.       9.     ]
 [ 0.2      0.11111  1.     ]]
[ 0.26543282  0.67162615  0.06294103]

Wyniki porównań kryteriów


In [6]:
print(ahp.criteria)
print(ahp.criteria_eig)


[[ 0.       4.       3.       7.     ]
 [ 0.25     0.       0.33333  3.     ]
 [ 0.33333  3.       0.       5.     ]
 [ 0.14286  0.33333  0.2      0.     ]]
[ 0.54756929  0.12655521  0.26994963  0.05592587]

Wyniki


In [7]:
print(ahp.scores)


{'Dick': 0.49278860360560528, 'Tom': 0.35813668326970488, 'Harry': 0.14907471312468987}

Wygrywa Dick


In [ ]: