Thanks to visit codestin.com
Credit goes to github.com

Skip to content

kohaupt/modDR

Repository files navigation

modDR (modified Dimensionality Reduction)

PyPI version Documentation Status

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:

pip install moddr

or, if you are using the uv package manager:

uv add moddr

Development

The package was developed with the uv package manager, 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):

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:

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.

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)

About

modDR allows the refinement of DR-based positions with respect to certain data features.

Resources

License

Stars

Watchers

Forks

Languages