drnb notebooks
  • Notebooks
  • GitHub
  1. Articles
  2. UMATO Evaluation
  • Experiments in Dimensionality Reduction
  • Articles
    • Do Hubs Hurt?
    • How Does Dimensionality Reduction Transform Distances?
    • Hubness
    • Heavy-tailed UMAP
    • Leopold: Lightweight Estimate of Preservation of Local Density
    • Measuring Media Bias
    • Normalized Compression Distance with 20 Newsgroups
    • PaCMAP: local scaling vs. k-nearest neighbors
    • PaCMAP Repeats
    • Neighbor Overlap and PCA
    • Neighbor Recall: UMAP vs t-SNE
    • Approximating Isomap with k-Nearest Neighbors and Stochastic Metric Multidimensional Scaling
    • Stochastic Metric Multidimensional Scaling
    • Renormalizing after TF-IDF + SVD
    • t-SNE Consistency with Random Initialization
    • UMAP with Annealed Neighbors. 1: Defaults
    • UMAP with Annealed Neighbors. 2: t-UMAP
    • UMAP with Annealed Neighbors. 3: PCA Initialization
    • Spectral Embedding
    • UMATO Evaluation
    • t-SNE Affinity: Gaussian vs. Uniform
  1. Articles
  2. UMATO Evaluation

  • Show All Code
  • Hide All Code

A comparison of UMATO and UMAP. You need to run umap-tsne-exp.ipynb first.

Code
%load_ext lab_black
%load_ext autotime

from drnb.experiment import read_experiment

exp = read_experiment("umap-tsne")
/home/james/dev/drnb/venv/lib/python3.10/site-packages/umap/distances.py:1063: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details.
  @numba.jit()
/home/james/dev/drnb/venv/lib/python3.10/site-packages/umap/distances.py:1071: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details.
  @numba.jit()
/home/james/dev/drnb/venv/lib/python3.10/site-packages/umap/distances.py:1086: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details.
  @numba.jit()
/home/james/dev/drnb/venv/lib/python3.10/site-packages/umap/umap_.py:660: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details.
  @numba.jit()
time: 1min 12s (started: 2023-06-18 15:36:04 -07:00)
Code
exp.name = "umato"
time: 901 µs (started: 2023-06-18 15:37:17 -07:00)
Code
exp.add_method("umato")
exp.run()
/home/james/dev/drnb/venv/lib/python3.10/site-packages/umato/distances.py:1051: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details.
  @numba.jit()
/home/james/dev/drnb/venv/lib/python3.10/site-packages/umato/distances.py:1059: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details.
  @numba.jit()
/home/james/dev/drnb/venv/lib/python3.10/site-packages/umato/distances.py:1074: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details.
  @numba.jit()
[15:37:18] INFO     Running umato on iris                                                          experiment.py:58
           WARNING  Forcing hub_num to 50                                                               umato.py:23
OMP: Info #276: omp_set_nested routine deprecated, please use omp_set_max_active_levels instead.
[15:37:52] WARNING  151 nearest neighbors requested but only 150 items are available                  nbrpres.py:56
           INFO     Loading faiss with AVX2 support.                                                   loader.py:54
           INFO     Could not load library with AVX2 support due to:                                   loader.py:58
                    ModuleNotFoundError("No module named 'faiss.swigfaiss_avx2'")                                  
           INFO     Loading faiss.                                                                     loader.py:64
           INFO     Successfully loaded faiss.                                                         loader.py:66
[15:37:53] INFO     Running umato on penguins                                                      experiment.py:58
[15:37:55] INFO     Running umato on s1k                                                           experiment.py:58
[15:37:58] INFO     Running umato on olivetti                                                      experiment.py:58
[15:38:02] INFO     Running umato on frey                                                          experiment.py:58
[15:38:07] INFO     Running umato on coil20                                                        experiment.py:58
[15:38:29] INFO     Running umato on mnist                                                         experiment.py:58
[15:39:30] INFO     Running umato on fashion                                                       experiment.py:58
[15:40:34] INFO     Running umato on kuzushiji                                                     experiment.py:58
[15:41:40] INFO     Running umato on isoswiss                                                      experiment.py:58
[15:41:53] INFO     Running umato on scurvehole                                                    experiment.py:58
[15:42:01] INFO     Running umato on spheres                                                       experiment.py:58
[15:42:09] INFO     Running umato on mammoth                                                       experiment.py:58
[15:42:39] INFO     Running umato on macosko2015-pca50                                             experiment.py:58
[15:43:11] INFO     Running umato on tasic2018-pca50                                               experiment.py:58
[15:43:29] INFO     Running umato on lamanno2020                                                   experiment.py:58
[15:43:37] INFO     Running umato on onet271                                                       experiment.py:58
[15:43:40] INFO     Running umato on avonet                                                        experiment.py:58
[15:43:49] INFO     Running umato on ng20                                                          experiment.py:58
[15:44:26] INFO     Running umato on iclr-l2r                                                      experiment.py:58
[15:44:41] INFO     Running umato on galaxy10sdss                                                  experiment.py:58
time: 12min 42s (started: 2023-06-18 15:37:17 -07:00)
Code
[exp.to_df(metrics=[metric]).agg("mean") for metric in ["nnp-15", "nnp-50", "rte-5"]]
[method  metric
 tsne    nnp-15    0.503829
 umap    nnp-15    0.399448
 umato   nnp-15    0.252121
 dtype: float64,
 method  metric
 tsne    nnp-50    0.504050
 umap    nnp-50    0.449804
 umato   nnp-50    0.353608
 dtype: float64,
 method  metric
 tsne    rte-5     0.717295
 umap    rte-5     0.707962
 umato   rte-5     0.778484
 dtype: float64]
time: 50.7 ms (started: 2023-06-18 15:49:59 -07:00)
Code
exp.plot(methods=["umap", "umato"])

time: 57.3 s (started: 2023-06-18 15:49:59 -07:00)