semvec/pypi-packages huggingface dataset:
topsis-nishchay-102217036 1.0.0
A Python package to perform TOPSIS analysis on datasets.
Requires Python: >=3.6

# TOPSIS Implementation in Python

---

## Overview
This Python script implements the **TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution)** method for multi-criteria decision-making. It calculates the performance score and rank for given data based on user-defined weights and impacts.

---

## Usage

Run the script with the following command:

```bash
python topsis.py <inputFileName> <weights> <impacts> <resultFileName>
```

- `<inputFileName>`: Path to the CSV file containing the dataset.
- `<weights>`: Comma-separated weights for the criteria (e.g., `1,2,3`).
- `<impacts>`: Comma-separated impacts for the criteria (`+` for benefit, `-` for cost).
- `<resultFileName>`: Name of the output file where results will be saved.

---

## Input File Requirements
1. Must be a `.csv` file with at least **3 columns**.
2. The first column can contain non-numeric values (e.g., IDs).
3. Columns from the 2nd to the last must contain **numeric values only**.

---

## Features
- **Validation**:
  - Ensures correct number of inputs.
  - Validates weights, impacts, and column counts.
  - Handles missing or invalid files.
- **Error Handling**:
  - Displays user-friendly messages for issues like file not found, non-numeric data, or mismatched input parameters.
- **Output**:
  - Adds two new columns: `Topsis Score` and `Rank`.
  - Saves the results in the specified output file.

---

## Dependencies
- Python 3.x
- Required libraries: `pandas`, `math`, `sys`

Install dependencies using:
```bash
pip install pandas
```

---

## License
This project is open-source and free to use under the MIT License.
Topsis-102216078 1.0.0
A Python implementation of the TOPSIS decision-making method
Requires Python: >=3.6

TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution)

TOPSIS is a Python library for implementing the Technique for Order of Preference by Similarity to Ideal Solution, a multi-criteria decision-making method. This library allows users to rank alternatives based on given criteria, weights, and impacts.

Installation

You can install the library via pip:

pip install Topsis-102216078

Usage

Command-line Usage

The library can be used directly from the command line. Here's the general syntax:

python <program.py> <InputDataFile> <Weights> <Impacts> <ResultFileName>

Example

Create an input file, data.csv:

Name,C1,C2,C3,C4
A,250,16,12,5
B,200,32,8,3
C,300,24,10,4
D,275,20,11,4
E,225,28,9,2

Run the command:

python topsis.py data.csv "0.25,0.25,0.25,0.25" "+,+,-,+" result.csv

The output result.csv will contain:

Name,C1,C2,C3,C4,Topsis Score,Rank
A,250,16,12,5,0.64,2
B,200,32,8,3,0.43,4
C,300,24,10,4,0.78,1
D,275,20,11,4,0.56,3
E,225,28,9,2,0.36,5

Python Library Usage

Importing the Library

You can also use the library directly in Python:

from topsis import Topsis

# Input data
data = "data.csv"
weights = [0.25, 0.25, 0.25, 0.25]
impacts = ["+", "+", "-", "+"]
result_file = "result.csv"

# Perform TOPSIS
Topsis(data, weights, impacts, result_file)
print(f"Results saved in {result_file}")

Parameters

InputDataFile: A CSV file with the first column as the name of the alternatives and the rest as numeric criteria.

Weights: A comma-separated string of numeric weights (e.g., "0.25,0.25,0.25,0.25").

Impacts: A comma-separated string of impacts for each criterion, either + (positive impact) or - (negative impact).

ResultFileName: The name of the output CSV file where results will be saved.

Features

Validate input file format and values.

Handle missing or invalid values gracefully.

Normalize and weight criteria.

Calculate TOPSIS scores and rankings.

Limitations

All criteria must be numeric.

The number of weights and impacts must match the number of criteria.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Feel free to open issues or create pull requests to improve the library!

Author

Sourav Sethi
influential-analysis 0.1.2
A library for finding influential instances in ML models
Requires Python: >=3.6

## Influential Analysis

## 📌 Overview
**Influential Analysis** is a Python library for identifying and analyzing **influential instances** in machine learning models. It helps assess model accuracy and fairness by detecting data points that significantly impact predictions. This is especially useful for bias detection and fairness auditing.

## 🔥 Features
- Identify **influential instances** that impact model fairness & accuracy
- Supports **classification models** (e.g., Decision Trees, Random Forests, etc.)
- Uses **Fairlearn** for fairness assessment
- Provides **visualization** of influential data points

## 📦 Installation
Install the package using:
```bash
pip install influential-analysis
```

## 🚀 Usage
### **1. Import the Library**
```python
!pip install influential-analysis==0.1.1
from influential_analysis.influential_analysis import InfluentialInstanceAnalyzer
```

### **2. Train Your Model**
```python
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
import pandas as pd

# Load Data
df = pd.read_csv("your_dataset.csv")
X = df.drop(columns=["target_column"])
y = df["target_column"]

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

# Train Model
model = DecisionTreeClassifier()
model.fit(X_train, y_train)
```

### **3. Analyze Influential Instances**
```python
sensitive_features = ["gender", "race"]  # Adjust based on dataset
analyzer = InfluentialInstanceAnalyzer(model, sensitive_features, deletion_percentage=10)

# Run analysis
analyzer.fit(X_train, y_train, X_test, y_test)
influential_instances, scores, acc_changes, fairness_changes = analyzer.run_analysis(showGraph=True)
```

### **4. Remove Influential Instances & Retrain**
```python
X_filtered = X.drop(index=influential_instances, errors='ignore')
y_filtered = y.drop(index=influential_instances, errors='ignore')

X_train_f, X_test_f, y_train_f, y_test_f = train_test_split(X_filtered, y_filtered, test_size=0.2, random_state=42)
model.fit(X_train_f, y_train_f)
```

## 📊 Visualization
The library supports **visualizing influential instances** using Seaborn:
```python
analyzer.run_analysis(showGraph=True)
```

## 🛠 Dependencies
- **NumPy**
- **Pandas**
- **Seaborn**
- **Matplotlib**
- **Scikit-learn**
- **Fairlearn**

## 📝 License
This project is licensed under the **MIT License**.

## 🤝 Contributing
Contributions are welcome! Feel free to submit issues or pull requests on [GitHub](https://github.com/BlazheManev/bm-influential-instance-analyzer).

## 📧 Contact
Author: **Blazhe Manev**  
GitHub: [BlazheManev](https://github.com/BlazheManev)
topsis-Aarushi-102216107 1.0.0
A Python package to calculate TOPSIS score.
Requires Python: >=3.6

# TOPSIS Package

This package calculates the TOPSIS score for a given CSV file.

## Installation

Install the package using pip:
    ```bash
    pip install topsis-package

## Usage 

Run the package via command line:
    ```bash 
    topsis <inputFileName> <weights> <impacts> <resultFileName>

## Input file format 

The input file must:
Have at least 3 columns.
Contain numeric values from the 2nd to the last column.