Skip to main content

Fast visualization of high-dimensional data

Project description

FVHD: Fast Visualization of High-Dimensional Data

FVHD is a Python library for efficient visualization of high-dimensional data using force-directed graph layout algorithms. It provides an implementation of high-dimensional data visualization with neighbor-based force calculations.

Features

  • Fast neighbor search using scikit-learn's NearestNeighbors
  • Force-directed graph layout optimization
  • Support for both optimizer-based and force-directed methods
  • Automatic parameter adaptation
  • Built-in support for MNIST and EMNIST datasets
  • Efficient binary graph storage format

Installation

FVHD requires Python 3.12 and can be installed using Poetry:

poetry install

Quick Start

import torch
from fvhd import FVHD
from knn import Graph, NeighborConfig, NeighborGenerator

# Load your data as a torch.Tensor
X = torch.rand(1000, 784)  # Example: 1000 samples of 784 dimensions

# Create nearest neighbors graph
config = NeighborConfig(metric="euclidean")
generator = NeighborGenerator(df=df, config=config)
graph = generator.run(nn=5)

# Initialize FVHD
fvhd = FVHD(
    n_components=2,  # Output dimensionality
    nn=5,           # Number of nearest neighbors
    rn=2,           # Number of random neighbors
    c=0.1,        # Repulsion strength
    eta=0.2,      # Learning rate
    epochs=3000,
    device="cuda",  # Use GPU if available
    velocity_limit=True,
    autoadapt=True
)

# Generate 2D embeddings
embeddings = fvhd.fit_transform(X, graph)

Example with MNIST

from main import load_dataset, create_or_load_graph, visualize_embeddings

# Load MNIST dataset
X, Y = load_dataset("mnist")

# Create nearest neighbors graph
graph = create_or_load_graph(X, nn=5)

# Initialize and run FVHD
fvhd = FVHD(
    n_components=2,
    nn=5,
    rn=2,
    c=0.005,
    eta=0.003,
    epochs=3000,
    device="cuda"
)

# Generate and visualize embeddings
embeddings = fvhd.fit_transform(X, graph)
visualize_embeddings(embeddings, Y, "mnist")

Parameters

  • n_components: Output dimensionality (default: 2)
  • nn: Number of nearest neighbors (default: 2)
  • rn: Number of random neighbors (default: 1)
  • c: Repulsion strength coefficient (default: 0.1)
  • eta: Learning rate (default: 0.1)
  • epochs: Number of training epochs (default: 200)
  • device: Computation device ("cpu" or "cuda")
  • autoadapt: Enable automatic learning rate adaptation
  • velocity_limit: Enable velocity limiting for stability

Citation

If you use this software in your research, please cite:

@misc{fvhd2025,
  author = {Minch, Bartosz, Ręka, Filip and Dzwinel, Witold},
  title = {FVHD: Fast Visualization of High-Dimensional Data},
  year = {2025},
  publisher = {GitHub},
  url = {https://github.com/username/fvhd}
}

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fvhd-0.1.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fvhd-0.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file fvhd-0.1.0.tar.gz.

File metadata

  • Download URL: fvhd-0.1.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for fvhd-0.1.0.tar.gz
Algorithm Hash digest
SHA256 60c9201a6d3b273c57a91d48c12fac5107b0827331daa98b0cf751f19077e006
MD5 0c21d43a2a071ade1af29dc8923988c8
BLAKE2b-256 a220aa50a2bff04bd5f424f545389c0e070193c4fbc207c4eecdd5fe99bd2d1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for fvhd-0.1.0.tar.gz:

Publisher: python-publish.yml on langMonk/FVHD

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fvhd-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fvhd-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for fvhd-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9bc61f1fd9d30f4d5da1e76ba460daf6d55f670b9f507e85cf7be85d653d735
MD5 aa208658531790d8e4c8f7093ccc1ed6
BLAKE2b-256 fb8d50f659101b90b2d18fad51224d4ef4291975e0f1ba1a7d71a1ad31651031

See more details on using hashes here.

Provenance

The following attestation bundles were made for fvhd-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on langMonk/FVHD

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page