Metadata-Version: 2.4
Name: moddr
Version: 1.0.0
Summary: This package allows the refinement of DR-based positions with respect to certain data features.
Project-URL: Homepage, https://github.com/kohaupt/moddr
Project-URL: Repository, https://github.com/kohaupt/moddr
Project-URL: Issues, https://github.com/kohaupt/moddr/issues
Author-email: Konstantin Haupt <konstantin.haupt@study.hs-duesseldorf.de>
License: MIT License
        
        Copyright (c) 2025, Konstantin Haupt
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Requires-Dist: bokeh>=3.4.3
Requires-Dist: colorcet>=3.1.0
Requires-Dist: dash>=2.18.2
Requires-Dist: datashader>=0.17.0
Requires-Dist: holoviews>=1.20.1
Requires-Dist: igraph>=0.11.9
Requires-Dist: leidenalg>=0.10.2
Requires-Dist: matplotlib>=3.9.4
Requires-Dist: nbformat>=5.10.4
Requires-Dist: networkx>=3.0
Requires-Dist: numpy>=1.26.0
Requires-Dist: pandas>=2.2.3
Requires-Dist: scikit-image>=0.24.0
Requires-Dist: scikit-learn>=1.6.1
Requires-Dist: seaborn>=0.13.2
Requires-Dist: umap-learn>=0.5.7
Provides-Extra: dev
Requires-Dist: ipykernel>=6.29.5; extra == 'dev'
Requires-Dist: ipywidgets>=8.1.5; extra == 'dev'
Requires-Dist: pytest>=8.3.4; extra == 'dev'
Requires-Dist: ucimlrepo>=0.0.7; extra == 'dev'
Provides-Extra: docs
Requires-Dist: myst-parser>=2.0.0; extra == 'docs'
Requires-Dist: sphinx-rtd-theme>=2.0.0; extra == 'docs'
Requires-Dist: sphinx>=7.0.0; extra == 'docs'
Description-Content-Type: text/markdown

# modDR (modified Dimensionality Reduction)

[![PyPI version](https://img.shields.io/pypi/v/moddr.svg)](https://pypi.python.org/pypi/moddr)
[![Documentation Status](https://readthedocs.org/projects/moddr/badge/?version=latest)](https://moddr.readthedocs.io/en/latest/)

Modified Dimensionality Reduction (moddr) is a Python package for combining dimensionality reduction techniques with community detection and visualization capabilities.
This package presents a method for automatically modifying the positions of data points in low-dimensional spaces based on a feature selection to preserve both global structure and feature-driven similarity. The provided workflow uses graph theory concepts and layout methods to change the arrangement of a given DR-positioning in such a way that an additional similarity measure – based on selected features, for example – is integrated into the distance structure. 

## Documentation
Full documentation is available at: https://moddr.readthedocs.io

## Installation
The package is published on PyPI: https://pypi.python.org/pypi/moddr 

Install it via:
```bash
pip install moddr
```

or, if you are using the [uv package manager](https://docs.astral.sh/uv/):

```bash
uv add moddr
```

## Development
The package was developed with the [uv package manager](https://docs.astral.sh/uv/), which is required for local development. After cloning the repository, run the following commands to create a working development environment (if not inside an existing workspace):

```bash
uv init project-name
uv sync
uv pip install -e . # needed to make the package functions available locally
```

You can test the correct local installation by running:

```bash
uv run pytest
```

## Quick Start
The package consists of three modules:
- `processing` – computing modified embeddings
- `evaluation` – computing metrics for evaluation
- `visualization` – visualizing embeddings

An instance of the `EmbeddingState`-class allows you to access all computed information. Examples are available under `./examples` as jupyter-notebooks. A minimal example can be implemented as follows. The parameters may have to be adjusted for the used data set, as the default parameters may not be suited.


```python
import moddr

# Run the full moddr pipeline
embeddings = moddr.processing.run_pipeline(
    data=your_data,
    sim_features=your_feature_selection
    verbose=True
)

# Visualize the embeddings
moddr.visualization.display_embeddings(embeddings)
```