Metadata-Version: 2.4
Name: scikit-ptm-fs
Version: 0.11
Summary: A Python package for integrating scikit-learn feature selection with multi-label problem transformation methods.
Home-page: https://github.com/Omaimah-AlHosni/scikit-ptm-fs
Author: Omaima Al Hosni
Author-email: alhosni_o@hotmail.com
Project-URL: Source, https://github.com/Omaimah-AlHosni/scikit-ptm-fs
Project-URL: Tracker, https://github.com/Omaimah-AlHosni/scikit-ptm-fs/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.20
Requires-Dist: scikit-learn>=1.0
Requires-Dist: scipy>=1.5
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Scikit-PTM-FS

[![PyPI version](https://badge.fury.io/py/scikit-ptm-fs.svg)](https://pypi.org/project/scikit-ptm-fs/)
[![Python](https://img.shields.io/badge/python-3.7+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)

**Scikit-PTM-FS** is a Python library that enables seamless integration of `scikit-learn` feature selection methods with multi-label classification via problem transformation methods (PTMs). The framework enables transformation-aware feature selection without requiring classification stages, allowing researchers to analyze the behavior of FS methods across various PTMs.

---

## 📦 Installation

```bash
pip install scikit-ptm-fs
```

---

## 🚀 Usage Example

Here is a basic example of how to apply a feature selection method within a problem transformation method using `Scikit-PTM-FS`:

```python
from scikit_ptm_fs.problem_transformation import LabelPowerset
from sklearn.feature_selection import SelectKBest, f_classif

# Example feature and label matrices (replace with your own)
# X = ...  # shape (n_samples, n_features)
# y = ...  # shape (n_samples, n_labels)

# Step 1: Define a scikit-learn selector
selector = SelectKBest(score_func=f_classif, k=5)

# Step 2: Wrap it using the LabelPowerset PTM
lp_selector = LabelPowerset(selector=selector, require_dense=[False, True])

# Step 3: Apply feature selection
X_selected = lp_selector.fit_transform(X, y)

# Step 4: Get selected feature indices
selected_indices = lp_selector.get_support()
print("Selected features:", selected_indices)
```

> 💡 You can use other PTMs like `BinaryRelevance`, `PPT`, or `PairwiseComparison` similarly.

---

## 🧠 Supported Problem Transformation Methods (PTMs)

- **Binary Relevance (BR)** — One-vs-All decomposition.
- **Label Powerset (LP)** — Unique labelset encoding.
- **Pairwise Comparison (PW)** — One-vs-One label pair modeling.
- **Pruned Problem Transformation (PPT)** — Labelset pruning before transformation.
- **Entropy-based Label Assignment (ELA)** — Copy-based transformation for NLP.

---

## 🔗 Project Links

- 📦 PyPI: [https://pypi.org/project/scikit-ptm-fs](https://pypi.org/project/scikit-ptm-fs)
- 🛠️ Source Code: [https://github.com/Omaimah-AlHosni/scikit-ptm-fs](https://github.com/Omaimah-AlHosni/scikit-ptm-fs)

---

## 📄 License

This project is licensed under the [MIT License](https://opensource.org/licenses/MIT).
