semvec/pypi-packages huggingface dataset:
topsis-ishan-101816037 0.0.1
topsis score and rank calculator
License: MIT
Keywords: topsis

What is TOPSIS:  
Technique for Order Preference by Similarity to Ideal Solution (TOPSIS) originated in the 1980s as a multi-criteria decision making method. TOPSIS chooses the alternative of shortest Euclidean distance from the ideal solution, and greatest distance from the negative-ideal solution. More

How to use this package:  
TOPSIS-Ishan-101816037 can be run as in the following example:

In Command Prompt:  
>> topsis-Ishan-101816037 data.csv "1,1,1,1" "+,+,-,+" result.csv
Topsis-Harmeet-101803104 1.1.1
Implements Topsis
License: MIT

# TOPSIS

Code by: Harmeet Singh 

<hr style = "border:2px solid gray"> </hr>
## What is TOPSIS

TOPSIS stands for ‘The Technique for Order of Preference by Similarity to the Ideal Solution’ is a multi-criteria decision analysis(MCDA) method. It is a method of compensatory aggregation that compares a set of alternatives by identifying weights for each criterion, normalising scores for each criterion and calculating the geometric distance between each alternative and the ideal alternative, which is the best score in each criterion.


## How to run

#### Before running, make sure you have pandas installed on your system

Open Terminal and input the following commands


>> pip install Topsis-Harmeet-101803104



>> python
>>>from topsis.topsis69 import topsis
>>>topsis("input.csv","1,1,1,2","+,+,-,+","output.csv")

## Sample Input

This input was used to test the module

<table><thead><tr><th>Model</th><th>Corr</th><th>Rseq</th><th>RMSE</th><th>Accuracy</th></tr></thead><tbody><tr><td>M1</td><td>0.79</td><td>0.62</td><td>1.25</td><td>60.89</td></tr><tr><td>M2</td><td>0.66</td><td>0.44</td><td>2.89</td><td>63.07</td></tr><tr><td>M3</td><td>0.56</td><td>0.31</td><td>1.57</td><td>62.87</td></tr><tr><td>M4</td><td>0.82</td><td>0.67</td><td>2.68</td><td>70.19</td></tr><tr><td>M5</td><td>0.75</td><td>0.56</td><td>1.3</td><td>80.39</td></tr></tbody></table>

## Output 


<table><thead><tr><th>Model</th><th align="right">Corr</th><th align="center">Rseq</th><th>RMSE</th><th>Accuracy</th><th>Topsis Score</th><th>Rank</th></tr></thead><tbody><tr><td>M1</td><td align="right">0.79</td><td align="center">0.62</td><td>1.25</td><td>60.89</td><td>0.639133</td><td>2.0</td></tr><tr><td>M2</td><td align="right">0.66</td><td align="center">0.44</td><td>2.89</td><td>63.07</td><td>0.212592</td><td>5.0</td></tr><tr><td>M3</td><td align="right">0.56</td><td align="center">0.31</td><td>1.57</td><td>62.87</td><td>0.407846</td><td>4.0</td></tr><tr><td>M4</td><td align="right">0.82</td><td align="center">0.67</td><td>2.68</td><td>70.19</td><td>0.519153</td><td>3.0</td></tr><tr><td>M5</td><td align="right">0.75</td><td align="center">0.56</td><td>1.3</td><td>80.39</td><td>0.828267</td><td>1.0</td></tr></tbody></table>


## License

© 2020 Harmeet Singh 

This repository is licensed under the MIT license. See LICENSE for details.
TOPSIS-Vikram-101803368 1.0.2
Apply topsis to a dataset in a csv file
License: MIT

Apply TOPSIS to a dataset in csv format.

<h1> Usage: </h1>

<h3> For use in code: </h3>

from topsis import csvTopsis

<h3> From the command line: </h3>

csvTopsis (filename) (weights) (impacts) {options: delimiter(,)}

    filename is the name of the csv file which has the dataset
        
        The dataset must have a minimum of three columns and all the parameter columns must have numeric values. The first row is assumed to contain the column names and the first column is assumed to contain the row names
    
    weights is a comma seperated list of weights ex: 1.0,1,1,1
        
        weights must be numeric and the number of weights equal to number of parameter in the dataset
    
    impacts is a comma seperated list of impacts ex: +,+,+,+
        
        impacts must be either - or + and the number of impacts must be equal to number of parameters in the dataset
    
    delimiter is the delimiter to be used to read the csv file
        
        default ','


Sample output:

    scores [0.5633920465033206, 0.3929781508166451, 0.8668523706767487, 0.14869542262467947, 0.5693097043728271]

    ranks [3, 4, 1, 5, 2]


<h1> Functions: </h1>

csvTopsis.topsis(inputCSV, weights, impacts, delimiter = ',')

    arguments:

        inputCSV is a stream containing the dataset, it must have at least 3 columns and the parameter columns must have only numeric values. The first column is assumed to contain row names and the first row is assumed to contain column names
        
        weights is a list with weights for the parameters in the dataset. The list must be numeric and have a size equal to the number of parameters in the dataset
        
        impacts is a list with impacts for the parameters in the dataset. The list must have only '-' or '+' as values and the size must be equal to number of parameters in the dataset
        
        delimiter is the delimiter to be used to read the inputCSV file object (default: ',')

    returns:

        resultCSV is a stream which contains the original dataset with 2 added columns namely 'Topsis Score' and 'Rank' the former contains the topsis score for the rows and the latter the topsis ranks
        
        similarityList is a list containing the topsis scores of all the rows
        
        rankList is a list containing the topsis ranks
TOPSIS-Abhiroop-101803109 1.0.2
A Python package implementing TOPSIS technique.
License: MIT

# TOPSIS


Submitted By: **Abhiroop 101803109**

***

## What is TOPSIS?

**T**echnique for **O**rder **P**reference by **S**imilarity to **I**deal **S**olution 
(TOPSIS) originated in the 1980s as a multi-criteria decision making method.
TOPSIS chooses the alternative of shortest Euclidean distance from the ideal solution, 
and greatest distance from the negative-ideal solution. 

<br>

## How to install this package:
```
>> pip install TOPSIS-Abhiroop-101803109
```


### In Command Prompt
```
>> topsis data.csv "1,1,1,1" "+,+,-,+" result.csv
```

## Input file (data.csv)

The decision matrix should be constructed with each row representing a Model alternative, and each column representing a criterion like Accuracy, R<sup>2</sup>, Root Mean Squared Error, Correlation, and many more.

Model | Correlation | R<sup>2</sup> | RMSE | Accuracy
------------ | ------------- | ------------ | ------------- | ------------
M1 |	0.79 | 0.62	| 1.25 | 60.89
M2 |  0.66 | 0.44	| 2.89 | 63.07
M3 |	0.56 | 0.31	| 1.57 | 62.87
M4 |	0.82 | 0.67	| 2.68 | 70.19
M5 |	0.75 | 0.56	| 1.3	 | 80.39

Weights (`weights`) is not already normalised will be normalised later in the code.

Information of benefit positive(+) or negative(-) impact criteria should be provided in `impacts`.

<br>

## Output file (result.csv)


Model | Correlation | R<sup>2</sup> | RMSE | Accuracy | Topsis_score | Rank
------------ | ------------- | ------------ | ------------- | ------------ | ------------- | ------------- 
M1 |	0.79 | 0.62	| 1.25 | 60.89 | 0.7722 | 2
M2 |  0.66 | 0.44	| 2.89 | 63.07 | 0.2255 | 5
M3 |	0.56 | 0.31	| 1.57 | 62.87 | 0.4388 | 4
M4 |	0.82 | 0.67	| 2.68 | 70.19 | 0.5238 | 3
M5 |	0.75 | 0.56	| 1.3	 | 80.39 | 0.8113 | 1


<br>
The output file contains columns of input file along with two additional columns having **Topsis_score** and **Rank**