semvec/pypi-packages huggingface dataset:
topsis-sandeepkaur-102483081 1.0.2
TOPSIS-Python-Assignment (Part 2)
Keywords: python, topsis, mcdm, decision-making


# TOPSIS-Python

## Project Overview
This project implements the **TOPSIS** (Technique for Order of Preference by Similarity to Ideal Solution) algorithm. It is a multi-criteria decision analysis method used to rank a finite number of alternatives based on their distance from the "ideal best" and "ideal worst" solutions.

This package provides a command-line tool to perform the analysis on any CSV dataset containing numerical data.

## Installation
To run this project, ensure you have **Python** installed along with the following libraries:

    pip install pandas numpy matplotlib

## Methodology
The algorithm follows these standard steps:
1.  **Data Validation:** Checks for missing values and ensures all input columns are numeric.
2.  **Vector Normalization:** Reduces all criteria to the same scale.
3.  **Weighting:** Multiplies the normalized matrix by the user-assigned weights.
4.  **Ideal Best & Worst:** Identifies the ideal best and ideal worst values for each criterion.
5.  **Euclidean Distance:** Calculates the distance of each alternative from the best and worst solutions.
6.  **Performance Score:** Calculates a score (0 to 1) and ranks the alternatives (Higher Score = Better Rank).

## Usage
The script is designed to be run from the command line.

    python topsis.py <InputDataFile> <Weights> <Impacts> <ResultFileName>

### Parameters
* **InputDataFile**: Path to the input CSV file.
* **Weights**: Comma-separated numbers (e.g., "1,1,1,1").
* **Impacts**: Comma-separated signs ("+" or "-").
* **ResultFileName**: Name of the output CSV file.

## Example Execution
Below is a demonstration of the tool using the sample data provided in this assignment.

### 1. Command Used

    python topsis.py data.csv "1,1,1,1,1" "+,+,-,+,-" result.csv

### 2. Output Results
The program calculates the TOPSIS Score and Rank for each fund.

| Fund Name | Topsis Score | Rank |
|:----------|-------------:|-----:|
| M1        |     0.563692 |    3 |
| M2        |     0.513032 |    4 |
| M3        |     0.439177 |    6 |
| M4        |     0.491956 |    5 |
| M5        |     0.641886 |    2 |
| M6        |     0.738148 |    1 |
| M7        |     0.407390 |    8 |
| M8        |     0.408499 |    7 |

## License
This project is open-source and available for educational purposes.