# TOPSIS-Python

Submitted By: **Sanyam Goyal 102297005**

***

## What is TOPSIS

**Technique for Order Preference by Similarity to Ideal Solution (TOPSIS)**, is a decision-making method used in multi-criteria decision analysis. It is a mathematical technique that helps in ranking and selecting the best alternative from a set of options based on their proximity to an ideal solution. Check out more information here:[wikipedia](https://en.wikipedia.org/wiki/TOPSIS).

<br>

## How to use this package:

TOPSIS-SANYAM_GOYAL-102297005  can be run as in the following example:


### In Command Prompt to run the code:
```
python topsis input_data.csv "1,1,1,1" "+,+,-,+" output_data.csv
```
<br>

## Sample dataset

The decision matrix (`a`) should be constructed with each row representing a ID, and each column representing a criterion like Features

ID | Feature1 | Feature2 | Feature3 | Feature4
---|----------|----------|----------|----------
1 | 2 | 5 | 8 | 3
2 | 3 | 6 | 9 | 4
3 | 5 | 8 | 2 | 7
4 | 6 | 9 | 3 | 8

<br>

## Output

```
ID,Feature1,Feature2,Feature3,Feature4,Topsis Score,Rank
1,2,5,8,3,0.33629008441513597,3
2,3,6,9,4,0.26542732311540135,4
3,5,8,2,7,0.7345726768845987,1
4,6,9,3,8,0.6637099155848639,2

```
<br>
The rankings are displayed in the form of a table using a package 'tabulate', with the 1st rank offering us the best decision, and last rank offering the worst decision making, according to TOPSIS method.
