comparative-embedding-visualization

A Jupyter widget for comparing two embeddings with shared labels by their confusion, neighborhoods, and size.

https://github.com/ozettetech/comparative-embedding-visualization

Science Score: 57.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 7 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.6%) to scientific vocabulary

Keywords

embeddings jupyter-widget metrics python visualization
Last synced: 6 months ago · JSON representation ·

Repository

A Jupyter widget for comparing two embeddings with shared labels by their confusion, neighborhoods, and size.

Basic Info
  • Host: GitHub
  • Owner: OzetteTech
  • License: apache-2.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 15.7 MB
Statistics
  • Stars: 45
  • Watchers: 5
  • Forks: 0
  • Open Issues: 3
  • Releases: 1
Topics
embeddings jupyter-widget metrics python visualization
Created over 3 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog License Citation

README.md

Comparative Embedding Visualization with cev

[![pypi version](https://img.shields.io/badge/ozette-technologies-ozette.svg?color=0072E1&labelColor=0B1117&style=flat-square)](https://ozette.com/) [![pypi version](https://img.shields.io/pypi/v/cev.svg?color=0072E1&labelColor=0B1117&style=flat-square)](https://pypi.org/project/cev/) [![build status](https://img.shields.io/github/actions/workflow/status/OzetteTech/comparative-embedding-visualization/ci.yml?branch=main&color=0072E1&labelColor=0B1117&style=flat-square)](https://github.com/OzetteTech/comparative-embedding-visualization/actions?query=workflow%3ARelease) [![notebook examples](https://img.shields.io/badge/notebook-examples-0072E1.svg?labelColor=0B1117&style=flat-square)](notebooks) [![ISMB BioVis 2023 Poster](https://img.shields.io/badge/ISMB_BioVis_'23-poster-0072E1.svg?labelColor=0B1117&style=flat-square)](ismb-biovis-2023-poster.jpg)
cev is an interactive Jupyter widget for comparing a pair of 2D embeddings with shared labels.
Its novel metric allows to surface differences in label confusion, neighborhood composition, and label size.


![Teaser](https://github.com/OzetteTech/comparative-embedding-visualization/assets/84813279/297cbdb9-b6a2-4102-bde9-b14f0ca24a09) The figure shows data from [Mair et al. (2022)](https://doi.org/10.1038/s41586-022-04718-w) that were analyzed with [Greene et al.'s (2021) FAUST method](https://doi.org/10.1016/j.patter.2021.100372).
The embeddings were generated with [Greene et al.'s (2021) annotation transformation](https://github.com/flekschas-ozette/ismb-biovis-2022) and [UMAP](https://github.com/lmcinnes/umap).

`cev` is implemented with [anywidget](https://anywidget.dev) and builds upon [jupyter-scatter](https://github.com/flekschas/jupyter-scatter/).

Quick Start

The cev package has a cli to quickly try out a demo of comparison widget in JupyterLab. It requires uv to be installed.

sh uvx --python 3.11 cev demo # Downloads datasets and launches Jupyter Lab

Installation

Warning: cev is new and under active development. It is not yet ready for production and APIs are subject to change.

sh pip install cev

Getting Started

```py import pandas as pd from cev.widgets import Embedding, EmbeddingComparisonWidget

umapembedding = Embedding.fromozette(df=pd.readparquet("../data/mair-2022-tissue-138-umap.pq")) ozetteembedding = Embedding.fromozette(df=pd.readparquet("../data/mair-2022-tissue-138-ozette.pq"))

umapvsozette = EmbeddingComparisonWidget( umapembedding, ozetteembedding, titles=["Standard UMAP", "Annotation-Transformed UMAP"], metric="confusion", selection="synced", autozoom=True, rowheight=320, ) umapvsozette ```

User interface of cev's comparison widget

See notebooks/getting-started.ipynb for the complete example.

Development

We use uv for development.

sh uv run jupyter lab

Commands Cheatsheet

| Command | Action | | :--------------------- | :------------------------------------------------------------------ | | uv run ruff format | Format the source code. | | uv run ruff check | Check the source code for formatting issues. | | uv run pytest | Run unit tests with pytest in base environment. |

Release

releases are triggered via tagged commits

git tag -a vX.X.X -m "vX.X.X" git push --follow-tags

License

cev is distributed under the terms of the Apache License 2.0.

Citation

If you use cev in your research, please cite the following preprint:

bibtex @article{manz2024general, title = {A General Framework for Comparing Embedding Visualizations Across Class-Label Hierarchies}, author = {Trevor Manz and Fritz Lekschas and Evan Greene and Greg Finak and Nils Gehlenborg}, url = {https://doi.org/10.1109/TVCG.2024.3456370}, doi = {10.1109/TVCG.2024.3456370}, journal = {IEEE Transactions on Visualization and Computer Graphics}, series = {VIS ’24}, publisher = {IEEE}, year = {2024}, month = {9}, pages = {1-11} }

Owner

  • Name: Ozette Technologies
  • Login: OzetteTech
  • Kind: organization
  • Email: contact@ozette.com
  • Location: Seattle

Citation (CITATION.cff)

cff-version: "1.2.0"
title: "A General Framework for Comparing Embedding Visualizations Across Class-Label Hierarchies"
authors:
  - given-names: "Trevor"
    family-names: "Manz"
    orcid: "https://orcid.org/0000-0001-7694-5164"
    affiliation: "Harvard Medical School"
  - given-names: "Fritz"
    family-names: "Lekschas"
    orcid: "https://orcid.org/0000-0001-8432-4835"
    affiliation: "Ozette Technologies"
  - given-names: "Evan"
    family-names: "Greene"
    affiliation: "Ozette Technologies"
  - given-names: "Greg"
    family-names: "Finak"
    orcid: "https://orcid.org/0000-0003-4341-9090"
    affiliation: "Ozette Technologies"
  - given-names: "Nils"
    family-names: "Gehlenborg"
    affiliation: "Harvard Medical School"
    orcid: "https://orcid.org/0000-0003-0327-8297"
url: "https://github.com/OzetteTech/comparative-embedding-visualization"
message: If you use this software, please cite our article in the
  IEEE Transactions on Visualization and Computer Graphics.
preferred-citation:
  type: article
  title: "A General Framework for Comparing Embedding Visualizations Across Class-Label Hierarchies"
  authors:
    - given-names: "Trevor"
      family-names: "Manz"
      orcid: "https://orcid.org/0000-0001-7694-5164"
      affiliation: "Harvard Medical School"
    - given-names: "Fritz"
      family-names: "Lekschas"
      orcid: "https://orcid.org/0000-0001-8432-4835"
      affiliation: "Ozette Technologies"
    - given-names: "Evan"
      family-names: "Greene"
      affiliation: "Ozette Technologies"
    - given-names: "Greg"
      family-names: "Finak"
      orcid: "https://orcid.org/0000-0003-4341-9090"
      affiliation: "Ozette Technologies"
    - given-names: "Nils"
      family-names: "Gehlenborg"
      affiliation: "Harvard Medical School"
      orcid: "https://orcid.org/0000-0003-0327-8297"
  date-published: 2024-09-10
  doi: "10.1109/TVCG.2024.3456370"
  journal: "Transactions on Visualization and Computer Graphics"
  publisher:
    name: IEEE
  url: "https://ieeexplore.ieee.org/document/10672535"
  month: 9
  year: 2024

GitHub Events

Total
  • Watch event: 10
  • Delete event: 4
  • Issue comment event: 1
  • Push event: 19
  • Pull request event: 4
  • Create event: 6
Last Year
  • Watch event: 10
  • Delete event: 4
  • Issue comment event: 1
  • Push event: 19
  • Pull request event: 4
  • Create event: 6