'Python Skcriteria Package, How do I get the similarity index for all cases and not just the top case with TOPSIS?
Looking through the documentation: https://scikit-criteria.readthedocs.io/en/latest/tutorial/quickstart.html
rank.e_.similarity shows the similarity index for the top case, but it does not specify how to get that value for other cases. My project seeks to show the index for top 10 cases of an experiment.
I tried simple indexing but without knowledge of how the object is set up I can not call the value for other cases. The values exist in the backend somewhere as it is needed to determine TOPSIS best case.
Solution 1:[1]
The vector stored in rank.e_.similarity
contains the similarity values for each of the alternatives.
Thus rank.e_similarity[0]
has the similarity index for the alternative rank.alternatives[0]
.
This value is calculated with the formula :
similarity = d_worst / (d_better + d_worst)
Where:
d_worst
is the distance to the anti-ideal alternatived_better
is the distance to the ideal alternative.
As of scikit-criteria 0.6 the distance metric is configurable. By default the Euclidean distance is used.
For more details regarding the ideal and anti-ideal points I recommend reading the TOPSIS wikipedia page https://en.wikipedia.org/wiki/TOPSIS
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |