TOPSIS-Python icon indicating copy to clipboard operation
TOPSIS-Python copied to clipboard

ranking function maybe incorrect?

Open phuctd99 opened this issue 3 years ago • 2 comments

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!

phuctd99 avatar Sep 10 '21 10:09 phuctd99

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.

Glitchfix avatar Sep 10 '21 10:09 Glitchfix

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

d-saikrishna avatar Dec 19 '23 04:12 d-saikrishna