Glitchfix / TOPSIS-Python

Source code for TOPSIS optimization algorithm in python
MIT License
71 stars 34 forks source link

ranking function maybe incorrect? #1

Open phuctd99 opened 3 years ago

phuctd99 commented 3 years ago

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!

Glitchfix commented 3 years ago

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.

d-saikrishna commented 9 months ago

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