Skip to main content

Python PyPI Version License Github Forks GitHub Open Issues Project Status Downloads Downloads DOI Sphinx Medium

Flameplot - Comparison of (high) dimensional embeddings.

⭐️ Star this repo if you like it ⭐️

Medium Blog

Also checkout The Similarity between t-SNE, UMAP, PCA, and Other Mappings to get a structured overview and usage of flameplot.

Method

To compare the embedding of samples in two different maps, we propose a scale dependent similarity measure. For a pair of maps X and Y, we compare the sets of the, respectively, kx and ky nearest neighbours of each sample. We first define the variable rxij as the rank of the distance of sample j among all samples with respect to sample i, in map X. The nearest neighbor of sample i will have rank 1, the second nearest neighbor rank 2, etc. Analogously, ryij is the rank of sample j with respect to sample i in map Y. Now we define a score on the interval [0, 1], as (eq. 1)

where the variable n is the total number of samples, and the indicator function is given by (eq. 2)

The score sx,y(kx, ky) will have value 1 if, for each sample, all kx nearest neighbours in map X are also the ky nearest neighbours in map Y, or vice versa. Note that a local neighborhood of samples can be set on the minimum number of samples in the class. Alternatively, kxy can be also set on the average class size.

Schematic overview

Schematic overview to systematically compare local and global differences between two sample projections. For illustration we compare two input maps (x and y) in which each map contains n samples (step 1). The second step is the ranking of samples based on Euclidean distance. The ranks of map x are subsequently compared to the ranks of map y for kx and ky nearest neighbours (step 3). The overlap between ranks (step 4), is subsequently summarized in Score: Sx,y(kx,ky).

Functions in flameplot

scores = flameplot.compare(map1, map2)
fig    = flameplot.plot(scores)
X,y    = flameplot.import_example()
fig    = flameplot.scatter(Xcoord,Ycoord)

Install flameplot from PyPI

pip install flameplot

Import flameplot package

import flameplot as flameplot

Documentation pages

On the documentation pages you can find detailed information about the working of the flameplot with examples.


Examples



Support

This project needs some love! ❤️ You can help in various ways.

* Become a Sponsor!
* Star this repo at the github page.
* Other contributions can be in the form of feature requests, idea discussions, reporting bugs, opening pull requests.
* Read more why becoming an sponsor is important on the Sponsor Github Page.

Cheers Mate.

References

Release files for flameplot 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flameplot 1.1.0
File Size Uploaded
flameplot-1.1.0.tar.gz 8.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flameplot 1.1.0
File Interpreter ABI Platform
flameplot-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.1 kB

Release files / flameplot-1.1.0.tar.gz

Download URL flameplot-1.1.0.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
76c46868e51f3c87b34cfafdee5c5881742691bd3d5d3154131e99279b8353c4
BLAKE2b-256 checksum
How to use checksums
6e3a18a82ed6e15f702456ef9f000e05c9f7b2825d5f8e945b2eef7735f7392d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release files / flameplot-1.1.0-py3-none-any.whl

Download URL flameplot-1.1.0-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8755c7e516f870b9892ac1d5659802e119141f39ecf523c420414fae0468a8c9
BLAKE2b-256 checksum
How to use checksums
9458e1ee79d2ad7d52d10a0697582e7e79b26be14c69b3f504bb41f904708587
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page