TOPSIS-Python
TOPSIS-Python copied to clipboard
ranking function maybe incorrect?
hello, i think ranking function have problem Ex: I have worst_similarity is [0.014 0.61 0.27 0.013 0.99 ] => ranking is [3 0 2 1 4], but i think correct ranking is [1 3 2 0 4] It cause by np.argsort() and you can more at here : https://stackoverflow.com/questions/31910407/numpy-argsort-cant-see-whats-wrong Thank you!
you are right I have fixed this issue already, I forgot to push the changes. will do that and update it as soon as possible.
Please change the ranking function to this:
def ranking(self, data):
temp = np.flip(data.argsort())
ranks = np.arange(len(data))[temp.argsort()]
return ranks