Metadata-Version: 2.1
Name: Topsis-Naman-102116058
Version: 1.0.4
Summary: Implementation of Topsis
Author: Naman Bhargava
Author-email: nambhargava03@gmail.com
License: MIT License
Project-URL: Project Link, https://github.com/bravo003/Topsis-Naman-102116058
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Description-Content-Type: text/markdown
Requires-Dist: pandas
Requires-Dist: numpy

# Project Description
- for: Assignment-1(UCS654)
- Submitted by: Naman Bhargava
- Roll no: 102116058
- Group: 3CS10

# TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution)

This Python script implements the TOPSIS method for multi-criteria decision-making. It takes a CSV file containing a decision matrix, weights, and impacts as input, and produces a ranked result based on the TOPSIS score.

## Installation
```bash
pip install Topsis-Naman-102103568
```

## Usage

```bash
from Topsis_Naman_102116058.topsis import topsis 
input="data.csv"
weights="1,1,1,2,1"
impacts="+,+,-,+,-"
result="result.csv" 
topsis(input, weights, impacts, result)
```

OR 

You can use this package via command line as:
```bash
python -m Topsis_Naman_102116058.topsis [Input as .csv] [Weights as a string] [Impacts as a string] [Result as .csv]
```

- `Input`: Path to the CSV file containing the input data.
- `Weights`: Comma-separated weights for each criterion.
- `Impacts`: Comma-separated impact direction for each criterion (`+` for maximization, `-` for minimization).
- `Result`: Name of the file to save the TOPSIS results.

## Requirements

- Python 3
- pandas
- numpy

## Input File Format
The input data should be in a CSV format with the following structure:

 | Fund Name |   P1  |   P2  |  P3  |   P4  |   P5   |
|-----------|-------|-------|------|-------|--------|
|    M1     |  0.62 |  0.38 |  6.7 |  58.7 |  16.60 |
|    M2     |  0.93 |  0.86 |  5.5 |  47.9 |  13.80 |
|    M3     |  0.62 |  0.38 |  3.2 |  65.9 |  17.53 |
|    M4     |  0.76 |  0.58 |  3.4 |  38.4 |  10.79 |
|    M5     |  0.74 |  0.55 |  3.1 |  56.4 |  15.20 |
|    M6     |  0.80 |  0.64 |  4.2 |  41.8 |  11.86 |
|    M7     |  0.95 |  0.90 |  4.1 |  50.3 |  14.06 |
|    M8     |  0.82 |  0.67 |  3.7 |  37.6 |  10.70 |


## Output

The script generates a CSV file containing the TOPSIS score and rank for each object:

| Fund Name |   P1  |   P2  |  P3  |   P4  |   P5   | Topsis Score | Rank |
|-----------|-------|-------|------|-------|--------|--------------|------|
|    M1     |  0.62 |  0.38 |  6.7 |  58.7 |  16.6  |   0.3876     |  8.0 |
|    M2     |  0.93 |  0.86 |  5.5 |  47.9 |  13.8  |   0.5213     |  4.0 |
|    M3     |  0.62 |  0.38 |  3.2 |  65.9 |  17.53 |   0.5715     |  3.0 |
|    M4     |  0.76 |  0.58 |  3.4 |  38.4 |  10.79 |   0.4401     |  7.0 |
|    M5     |  0.74 |  0.55 |  3.1 |  56.4 |  15.2  |   0.5977     |  2.0 |
|    M6     |  0.8  |  0.64 |  4.2 |  41.8 |  11.86 |   0.4403     |  6.0 |
|    M7     |  0.95 |  0.9  |  4.1 |  50.3 |  14.06 |   0.6352     |  1.0 |
|    M8     |  0.82 |  0.67 |  3.7 |  37.6 |  10.7  |   0.4517     |  5.0 |




## Error Handling

- Display an error message if the input file is not found.
- Raise a ValueError if the number of weights, impacts, or columns in the decision matrix is incorrect.
- Raise a ValueError if the columns from the 2nd to the last do not contain numeric values.
- Display any unexpected errors that occur during execution.

## LICENSE

(c) 2024 Naman Bhargava

This project is licensed under the [MIT License](LICENSE).
