SlideShare a Scribd company logo
Dimensionality reduction with UMAP
Advanced Data Mining seminar
Jakub Bartczuk
March 2020
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 1 / 30
Overview
1 Manifold learning recap
Multidimensional Scaling
Distances, graphs and matrix decomposition
2 Stochastic Neighbor Embedding
3 UMAP
Topological and geometrical preliminaries
Theoretical foundations
Algorithm
4 Libraries
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 2 / 30
Teaser
Reducing dimensionality of COIL20 Dataset
Figure: tSNE Figure: UMAP
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 3 / 30
Manifold learning recap
We want to uncover lower-dimensional structure in high-dimensional
space
Is the structure linear? If yes, use PCA
What to do if it is not linear?
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 4 / 30
Manifold learning recap
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 5 / 30
Classical Multidimensional Scaling
Algorithm: MDS(X, d)
Di,j = xi −xj
2
Find y’s: yi ∈ Rd
Di,j = yi −yj
2
Such that D ≈ D
Minimize R = i,j xi −xj
2 − yi −yj
2
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 6 / 30
Classical MDS properties
easy to compute - decompose low-rank matrix from D
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 7 / 30
Classical MDS properties
easy to compute - decompose low-rank matrix from D
fast - Euclidean distance matrix just couple of vectorized matrix
computations
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 7 / 30
Classical MDS properties
easy to compute - decompose low-rank matrix from D
fast - Euclidean distance matrix just couple of vectorized matrix
computations
treats all distortions alike
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 7 / 30
Classical MDS properties
easy to compute - decompose low-rank matrix from D
fast - Euclidean distance matrix just couple of vectorized matrix
computations
treats all distortions alike
What structure does MDS preserve?
The last property basically means that we preserve local and global
structure alike.
x’s are close - they are close in embedding.
x’s are distant - they are equally distant in embedding.
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 7 / 30
Distances, graphs and matrix decomposition
Local vs global structure
We may not care about preserving exact large distances in embedding
space as much as small distances
Idea: Calculate distance along the set ’spanned’ by datapoints
Manifold hypothesis
The data lies in lower-dimensional, possibly nonlinear space which is
embedded in ambient space
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 8 / 30
MDS breakdown
1 estimate distances between some pairs of close points
2 make graph (X,E) with edges weighted by distance
3 define D as distance from graph
4 decompose matrix that represents the graph
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 9 / 30
MDS breakdown
1 estimate distances between some pairs of close points
2 make graph (X,E) with edges weighted by distance
3 define D as distance from graph
4 decompose matrix that represents the graph
Getting manifold learning algorithms from schematic
Setting E = {((xi ,xj ), xi −xj
2)|xi ,xj ∈ X} (complete graph) we get
classical MDS
Modifying steps 1-3 will get us Isomap, Hessian Eigenmaps
tSNE and UMAP will change step 4
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 9 / 30
Stochastic Neighbor Embedding
Idea: embed into lower-dimensional space, preserve distance statistics
qj|i =
f ( yi −yj )
k=j f ( yi −yk )
,pj|i =
exp(− xi −xj
2/s2
i )
k=j exp(− xi −xk
2/s2
i
)
KL(p,q) =
i,j
pj|i log
pj|i
qj|i
Notes
Choice of f determines algorithm:
f (x) = exp(−x2) - original SNE
f (x) = (1+x2)−1 - tSNE (note this is density of Cauchy distribution
up to a constant)
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 10 / 30
Stochastic Neighbor Embedding
Perplexity
s gives rise to perplexity Pi = 2H(pi ) which controls effective neighborhood
size at xi .
High level algorithm
for each xi find s that matches given perplexity
initialize yi randomly
minimize KL with gradient descent w.r.t. yi
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 11 / 30
Problems with SNE: Crowding problem
’more room’ for intermediate
distances in higher dimensions
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 12 / 30
Problems with SNE: Crowding problem
’more room’ for intermediate
distances in higher dimensions
pairs of points will tend to
have similar distance
(remember curse of
dimensionality for kNN)
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 12 / 30
Problems with SNE: Crowding problem
’more room’ for intermediate
distances in higher dimensions
pairs of points will tend to
have similar distance
(remember curse of
dimensionality for kNN)
harder to embed them
faithfully into lower
dimensional space
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 12 / 30
Problems with SNE: Crowding problem
’more room’ for intermediate
distances in higher dimensions
pairs of points will tend to
have similar distance
(remember curse of
dimensionality for kNN)
harder to embed them
faithfully into lower
dimensional space
somewhat fixed by using t Distribution which has longer tails (not so
concentrated around maximum).
This problem is not specific to tSNE - it relates to the fact that data
may not be sampled uniformly from manifold
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 12 / 30
Bird’s view of UMAP’s theory
Recall UMAP means Uniform Manifold Approximation and Projection
Algorithm
1 get input data representation
2 initialize embedding
3 calculate probabilities of points being nearest neighbors
4 optimize embedding
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 13 / 30
Bird’s view of UMAP’s theory
Recall UMAP means Uniform Manifold Approximation and Projection
Algorithm
1 get input data representation
2 initialize embedding
3 calculate probabilities of points being nearest neighbors
4 optimize embedding
This also describes tSNE, what are the differences?
1 Fuzzy set built using local distance functions ( Riemannian metric)
2 kNN graph’s Laplacian
3 Probability between points corresponds to likelihood of points being
connected in neighborhood graph
4 Cross entropy between fuzzy sets
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 13 / 30
UMAP vs tSNE in a nutshell
UMAP paper appendix C
UMAP tSNE
Initialization Laplacian decomposition Random Gaussian
Optimization SGD + negative sampling Gradient Descent
pi|j exp(−
d(xi ,xj )−ρi
σi
)
exp(− xi −xj
2
/s2
i )
k=j exp(− xi −xk
2/s2
i )
qi|j (1+a yi −yj
2b))−1 (1+( yi −yj
2
))−1
k=j (1+( yi −yk
2))−1
Loss H(q, p) = H(p) + KL(q, p) KL(q, p)
Why such p, q?
ρi - Riemannian structure
σi - analogous to si
q - approximation of membership for fuzzy simplicial complex
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 14 / 30
Riemannian structure
Remember we want to calculate distance along the manifold
Curve length in Euclidean space
Lγ =
1
0 γ (t) dt =
1
0 〈γ (t)|γ (t)〉dt
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 15 / 30
Riemannian structure
Remember we want to calculate distance along the manifold
Curve length in Euclidean space
Lγ =
1
0 γ (t) dt =
1
0 〈γ (t)|γ (t)〉dt
Definition
Riemannian space has local inner product.
Precisely, it has an inner product on each tangent space that varies
smoothly.
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 15 / 30
Riemannian structure
Remember we want to calculate distance along the manifold
Curve length in Euclidean space
Lγ =
1
0 γ (t) dt =
1
0 〈γ (t)|γ (t)〉dt
Definition
Riemannian space has local inner product.
Precisely, it has an inner product on each tangent space that varies
smoothly.
Idea
Estimate Riemannian structure locally with finite samples - set it constant
on neighborhoods
Problem
We get incompatible local structures
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 15 / 30
Riemannian structure
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 16 / 30
Some Category Theory
Category theory is not a theory per se, it’s rather a framework for thinking
about mathematics
Definitions
A category C is a collection of objects with morphisms that can be
composed and the composition satisfies some technical conditions
Think a set of some sets with functions that preserve structure
Definition
A morphism f : A → B is an isomorphism if there is a morphism g : B → A
such that f ◦g = idA and g ◦f = idB
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 17 / 30
Some Category Theory
Examples
category FinSet of finite sets and functions between them
category Graphs of graphs and graph homomorphisms
category Ab of Abelian groups and group homomorphisms
category of metric spaces and contractions
Definition
A mapping F : C → D is a functor if F(f ◦g) = F(f )◦F(g)
Warning: technically this is a pair of mappings but we usually omit this
Examples
F : Graphs → FinSet F((V ,E)) = V
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 18 / 30
Topological preliminaries
Extended pseudometric space
A space is called pseudometric if it suffices metric space axioms, but
without requiring that d(x,y) = 0 =⇒ x = y
d : X ×X → R+
d(x,y) = d(y,x)
d(x,y)+d(y,z) ≥ d(x,z)
In extended pseudometric space it also can happen that d(x,y) = ∞
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 19 / 30
Topological preliminaries
Simplex
A d-dimensional simplex is a set
S ⊂ Rn such that there are d linearly
independent points S = conv(d)
Simplicial complex
A set C of simplexes such that if
s,s ∈ C =⇒ s ∩s ∈ C
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 20 / 30
Topology
Definition
Definition: nerve of a family of sets U = {Ui |i ∈ I} is the set of finite
subsets s of I for which i∈s Ui =
Definition
U is a cover of X if i Ui = X
Nerve theorem
If set U is an open cover of X then X ∼ N(U ) (they are homotopy
equivalent, this is one notion of equivalence from topology)
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 21 / 30
Fuzzy sets
Definitions
For fixed set X, S ⊂ X, m : S → [0,1] (fuzzy membership function)
A pair (S,m) is a fuzzy set if 0 ≤ m(x) ≤ 1
Fuzzy sets have natural generalizations of set operations:
if (S,mS),(R,mR) are fuzzy sets then
(S ∪R,mS∪R) is a fuzzy set
where
mS∪R(x) = max(mS(x),mR(x))
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 22 / 30
Fuzzy sets
Definitions
For fixed set X, S ⊂ X, m : S → [0,1] (fuzzy membership function)
A pair (S,m) is a fuzzy set if 0 ≤ m(x) ≤ 1
Fuzzy sets have natural generalizations of set operations:
if (S,mS),(R,mR) are fuzzy sets then
(S ∪R,mS∪R) is a fuzzy set
where
mS∪R(x) = max(mS(x),mR(x))
Example
S1 = ([0,1],m), m(x) = [x ∈ S]x
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 22 / 30
Fuzzy sets
Definitions
For fixed set X, S ⊂ X, m : S → [0,1] (fuzzy membership function)
A pair (S,m) is a fuzzy set if 0 ≤ m(x) ≤ 1
Fuzzy sets have natural generalizations of set operations:
if (S,mS),(R,mR) are fuzzy sets then
(S ∪R,mS∪R) is a fuzzy set
where
mS∪R(x) = max(mS(x),mR(x))
Example
S1 = ([0,1],m), m(x) = [x ∈ S]x
Category of fuzzy sets
objects: fuzzy sets
morphisms: functions f : S → R such that mS(x) ≤ mR(f (x))
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 22 / 30
Extended pseudometric spaces and fuzzy sets
UMAP paper section 2.2 and appendix B
Fuzzy simplicial sets are generalization of simplicial complexes. This
category is denoted by Fin-sFuzz.
Category of finite extended pseudometric spaces is denoted by FinEPMet
Metric realization of fuzzy simplicial sets
There exist functors
Real : Fin-sFuzz → FinEPMet
Sing : FinEPMet → Fin-sFuzz
That are adjoint.
Adjoint pairs of functions estabilish a weak equivalence relation of
categories.
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 23 / 30
Global structure from local structures
Theory
Construct extended pseudometric spaces locally
Get fuzzy sets from pseudometric spaces
Merge local fuzzy sets
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 24 / 30
Global structure from local structures
Dataset defines extended pseudometrics
X = {xi }i<n
ρi - distance from xi to its closest neighbor
di (xj ,xk) =
d(xj ,xk)−ρi if i = j or i = k
∞ otherwise
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 25 / 30
Global structure from local structures
Dataset defines extended pseudometrics
X = {xi }i<n
ρi - distance from xi to its closest neighbor
di (xj ,xk) =
d(xj ,xk)−ρi if i = j or i = k
∞ otherwise
Extended pseudometric spaces → fuzzy simplicial sets
(X,di ) → Sing((X,di ))
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 25 / 30
Global structure from local structures
Dataset defines extended pseudometrics
X = {xi }i<n
ρi - distance from xi to its closest neighbor
di (xj ,xk) =
d(xj ,xk)−ρi if i = j or i = k
∞ otherwise
Extended pseudometric spaces → fuzzy simplicial sets
(X,di ) → Sing((X,di ))
Local fuzzy sets → global fuzzy set
{(X,di )}i<n → i<n Sing((X,di ))
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 25 / 30
Algorithm
UMAP paper section 4.1
UMAP(X, n-neighbors, dim, min-dist, n-epochs)
forall x ∈ X: fsx = LocalFuzzySet(x, n-neighbors)
top-rep = x∈X fsx
Y := SpectralEmbedding(top-rep, dim)
Y := OptimizedEmbedding(top-rep, dim, min-dist, n-epochs)
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 26 / 30
Algorithm - details
Simplification
We use only 1-skeleton, weighted neighborhood graph.
Approximation
To use gradient descent we need to take a differentiable approximation of
fuzzy set membership.
The authors propose qi|j = (1+a yi −yj
2b))−1
Probably the most important difference between tSNE (see tSNE paper
6.2)
a,b are set to predefined values or estimated using least squares to
approximate
φ(i,j) =
1 if yi −yj 2 ≤ min-dist
exp(− yi −yj 2 +min-dist)otherwise
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 27 / 30
Optimization
UMAP paper section 4.2
Optimization
Optimize C(p,q) = H(p)+KL(p,q)
For p,q use symmetrized pi,j = pi|j +pj|i −pi|j pj|i
Computational shortcut
calculate gradient of error for similar points
approximate gradient for dissimilar points by negative sampling
Implementation details - Nearest neighbors
Naive implementation - O(n2) operations
UMAP implementation uses approximate kNN
Nearest Neighbor Descent algorithm is reported to have O(n1.14)
complexity
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 28 / 30
Python implementations
tSNE and other algorithms
scikit-learn implements tSNE, MDS, Isomap, Hessian Eigenmaps,
Locally Linear Embedding
faster implementations available in megaman package
UMAP
original author’s package (pip install umap-learn)
GPU accelerated NVidia rapids (cuML)
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 29 / 30
Further reading
Understanding UMAP - interactive visualizations
Exploratory Analysis of Interesting Datasets - UMAP’s documentation
UMAP author’s google scholar page
How Exactly UMAP Works - author’s other articles mention
applications in life sciences
The Category Theory Behind UMAP
UMAP - Mathematics and implementational details
Jakub Bartczuk Dimensionality reduction with UMAP March 2020 30 / 30

More Related Content

What's hot

Graph Representation Learning
Graph Representation LearningGraph Representation Learning
Graph Representation Learning
Jure Leskovec
 
Visualizing Data Using t-SNE
Visualizing Data Using t-SNEVisualizing Data Using t-SNE
Visualizing Data Using t-SNE
David Khosid
 
DBSCAN (2014_11_25 06_21_12 UTC)
DBSCAN (2014_11_25 06_21_12 UTC)DBSCAN (2014_11_25 06_21_12 UTC)
DBSCAN (2014_11_25 06_21_12 UTC)
Cory Cook
 
Graph Neural Network - Introduction
Graph Neural Network - IntroductionGraph Neural Network - Introduction
Graph Neural Network - Introduction
Jungwon Kim
 
Introduction to Graph Neural Networks: Basics and Applications - Katsuhiko Is...
Introduction to Graph Neural Networks: Basics and Applications - Katsuhiko Is...Introduction to Graph Neural Networks: Basics and Applications - Katsuhiko Is...
Introduction to Graph Neural Networks: Basics and Applications - Katsuhiko Is...
Preferred Networks
 
Mean shift and Hierarchical clustering
Mean shift and Hierarchical clustering Mean shift and Hierarchical clustering
Mean shift and Hierarchical clustering
Yan Xu
 
Radial Basis Function Interpolation
Radial Basis Function InterpolationRadial Basis Function Interpolation
Radial Basis Function Interpolation
Jesse Bettencourt
 
Fuzzy Clustering(C-means, K-means)
Fuzzy Clustering(C-means, K-means)Fuzzy Clustering(C-means, K-means)
Fuzzy Clustering(C-means, K-means)
Fellowship at Vodafone FutureLab
 
Variational Autoencoder
Variational AutoencoderVariational Autoencoder
Variational Autoencoder
Mark Chang
 
High Dimensional Data Visualization using t-SNE
High Dimensional Data Visualization using t-SNEHigh Dimensional Data Visualization using t-SNE
High Dimensional Data Visualization using t-SNE
Kai-Wen Zhao
 
U-Net (1).pptx
U-Net (1).pptxU-Net (1).pptx
U-Net (1).pptx
Changjin Lee
 
Data Mining Concepts and Techniques, Chapter 10. Cluster Analysis: Basic Conc...
Data Mining Concepts and Techniques, Chapter 10. Cluster Analysis: Basic Conc...Data Mining Concepts and Techniques, Chapter 10. Cluster Analysis: Basic Conc...
Data Mining Concepts and Techniques, Chapter 10. Cluster Analysis: Basic Conc...
Salah Amean
 
Spectral Clustering
Spectral ClusteringSpectral Clustering
Spectral Clustering
ssusered887b
 
Tutorial on Object Detection (Faster R-CNN)
Tutorial on Object Detection (Faster R-CNN)Tutorial on Object Detection (Faster R-CNN)
Tutorial on Object Detection (Faster R-CNN)
Hwa Pyung Kim
 
Multi Layer Network
Multi Layer NetworkMulti Layer Network
Grid search (parameter tuning)
Grid search (parameter tuning)Grid search (parameter tuning)
Grid search (parameter tuning)
Akhilesh Joshi
 
Convolutional Neural Networks (CNN)
Convolutional Neural Networks (CNN)Convolutional Neural Networks (CNN)
Convolutional Neural Networks (CNN)
Gaurav Mittal
 
Gnn overview
Gnn overviewGnn overview
Gnn overview
Louis (Yufeng) Wang
 
3.3 hierarchical methods
3.3 hierarchical methods3.3 hierarchical methods
3.3 hierarchical methods
Krish_ver2
 
AlexNet
AlexNetAlexNet
AlexNet
Bertil Hatt
 

What's hot (20)

Graph Representation Learning
Graph Representation LearningGraph Representation Learning
Graph Representation Learning
 
Visualizing Data Using t-SNE
Visualizing Data Using t-SNEVisualizing Data Using t-SNE
Visualizing Data Using t-SNE
 
DBSCAN (2014_11_25 06_21_12 UTC)
DBSCAN (2014_11_25 06_21_12 UTC)DBSCAN (2014_11_25 06_21_12 UTC)
DBSCAN (2014_11_25 06_21_12 UTC)
 
Graph Neural Network - Introduction
Graph Neural Network - IntroductionGraph Neural Network - Introduction
Graph Neural Network - Introduction
 
Introduction to Graph Neural Networks: Basics and Applications - Katsuhiko Is...
Introduction to Graph Neural Networks: Basics and Applications - Katsuhiko Is...Introduction to Graph Neural Networks: Basics and Applications - Katsuhiko Is...
Introduction to Graph Neural Networks: Basics and Applications - Katsuhiko Is...
 
Mean shift and Hierarchical clustering
Mean shift and Hierarchical clustering Mean shift and Hierarchical clustering
Mean shift and Hierarchical clustering
 
Radial Basis Function Interpolation
Radial Basis Function InterpolationRadial Basis Function Interpolation
Radial Basis Function Interpolation
 
Fuzzy Clustering(C-means, K-means)
Fuzzy Clustering(C-means, K-means)Fuzzy Clustering(C-means, K-means)
Fuzzy Clustering(C-means, K-means)
 
Variational Autoencoder
Variational AutoencoderVariational Autoencoder
Variational Autoencoder
 
High Dimensional Data Visualization using t-SNE
High Dimensional Data Visualization using t-SNEHigh Dimensional Data Visualization using t-SNE
High Dimensional Data Visualization using t-SNE
 
U-Net (1).pptx
U-Net (1).pptxU-Net (1).pptx
U-Net (1).pptx
 
Data Mining Concepts and Techniques, Chapter 10. Cluster Analysis: Basic Conc...
Data Mining Concepts and Techniques, Chapter 10. Cluster Analysis: Basic Conc...Data Mining Concepts and Techniques, Chapter 10. Cluster Analysis: Basic Conc...
Data Mining Concepts and Techniques, Chapter 10. Cluster Analysis: Basic Conc...
 
Spectral Clustering
Spectral ClusteringSpectral Clustering
Spectral Clustering
 
Tutorial on Object Detection (Faster R-CNN)
Tutorial on Object Detection (Faster R-CNN)Tutorial on Object Detection (Faster R-CNN)
Tutorial on Object Detection (Faster R-CNN)
 
Multi Layer Network
Multi Layer NetworkMulti Layer Network
Multi Layer Network
 
Grid search (parameter tuning)
Grid search (parameter tuning)Grid search (parameter tuning)
Grid search (parameter tuning)
 
Convolutional Neural Networks (CNN)
Convolutional Neural Networks (CNN)Convolutional Neural Networks (CNN)
Convolutional Neural Networks (CNN)
 
Gnn overview
Gnn overviewGnn overview
Gnn overview
 
3.3 hierarchical methods
3.3 hierarchical methods3.3 hierarchical methods
3.3 hierarchical methods
 
AlexNet
AlexNetAlexNet
AlexNet
 

Similar to Dimensionality reduction with UMAP

Optimal L-shaped matrix reordering, aka graph's core-periphery
Optimal L-shaped matrix reordering, aka graph's core-peripheryOptimal L-shaped matrix reordering, aka graph's core-periphery
Optimal L-shaped matrix reordering, aka graph's core-periphery
Francesco Tudisco
 
Lec-3 DIP.pptx
Lec-3 DIP.pptxLec-3 DIP.pptx
Lec-3 DIP.pptx
SohamChatterjee47
 
Double Patterning
Double PatterningDouble Patterning
Double Patterning
Danny Luk
 
Double Patterning (4/2 update)
Double  Patterning (4/2 update)Double  Patterning (4/2 update)
Double Patterning (4/2 update)
guest833ea6e
 
Double Patterning (3/31 update)
Double Patterning (3/31 update)Double Patterning (3/31 update)
Double Patterning (3/31 update)
guest833ea6e
 
Aggregation computation over distributed data streams(the final version)
Aggregation computation over distributed data streams(the final version)Aggregation computation over distributed data streams(the final version)
Aggregation computation over distributed data streams(the final version)
Yueshen Xu
 
An Importance Sampling Approach to Integrate Expert Knowledge When Learning B...
An Importance Sampling Approach to Integrate Expert Knowledge When Learning B...An Importance Sampling Approach to Integrate Expert Knowledge When Learning B...
An Importance Sampling Approach to Integrate Expert Knowledge When Learning B...
NTNU
 
Aggregation computation over distributed data streams
Aggregation computation over distributed data streamsAggregation computation over distributed data streams
Aggregation computation over distributed data streams
Yueshen Xu
 
Matrix Completion Presentation
Matrix Completion PresentationMatrix Completion Presentation
Matrix Completion Presentation
Michael Hankin
 
CLIM Program: Remote Sensing Workshop, Statistical Emulation with Dimension R...
CLIM Program: Remote Sensing Workshop, Statistical Emulation with Dimension R...CLIM Program: Remote Sensing Workshop, Statistical Emulation with Dimension R...
CLIM Program: Remote Sensing Workshop, Statistical Emulation with Dimension R...
The Statistical and Applied Mathematical Sciences Institute
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
MadhuriMulik1
 
Ica group 3[1]
Ica group 3[1]Ica group 3[1]
Ica group 3[1]
Apoorva Srinivasan
 
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
The Statistical and Applied Mathematical Sciences Institute
 
Clustering-beamer.pdf
Clustering-beamer.pdfClustering-beamer.pdf
Clustering-beamer.pdf
LorenzoCampoli1
 
Approximate Thin Plate Spline Mappings
Approximate Thin Plate Spline MappingsApproximate Thin Plate Spline Mappings
Approximate Thin Plate Spline Mappings
Archzilon Eshun-Davies
 
Habilitation à diriger des recherches
Habilitation à diriger des recherchesHabilitation à diriger des recherches
Habilitation à diriger des recherches
Pierre Pudlo
 
Patch Matching with Polynomial Exponential Families and Projective Divergences
Patch Matching with Polynomial Exponential Families and Projective DivergencesPatch Matching with Polynomial Exponential Families and Projective Divergences
Patch Matching with Polynomial Exponential Families and Projective Divergences
Frank Nielsen
 
Double Patterning
Double PatterningDouble Patterning
Double Patterning
Danny Luk
 
ImageSegmentation.ppt
ImageSegmentation.pptImageSegmentation.ppt
ImageSegmentation.ppt
DEEPUKUMARR
 
ImageSegmentation.ppt
ImageSegmentation.pptImageSegmentation.ppt
ImageSegmentation.ppt
AVUDAI1
 

Similar to Dimensionality reduction with UMAP (20)

Optimal L-shaped matrix reordering, aka graph's core-periphery
Optimal L-shaped matrix reordering, aka graph's core-peripheryOptimal L-shaped matrix reordering, aka graph's core-periphery
Optimal L-shaped matrix reordering, aka graph's core-periphery
 
Lec-3 DIP.pptx
Lec-3 DIP.pptxLec-3 DIP.pptx
Lec-3 DIP.pptx
 
Double Patterning
Double PatterningDouble Patterning
Double Patterning
 
Double Patterning (4/2 update)
Double  Patterning (4/2 update)Double  Patterning (4/2 update)
Double Patterning (4/2 update)
 
Double Patterning (3/31 update)
Double Patterning (3/31 update)Double Patterning (3/31 update)
Double Patterning (3/31 update)
 
Aggregation computation over distributed data streams(the final version)
Aggregation computation over distributed data streams(the final version)Aggregation computation over distributed data streams(the final version)
Aggregation computation over distributed data streams(the final version)
 
An Importance Sampling Approach to Integrate Expert Knowledge When Learning B...
An Importance Sampling Approach to Integrate Expert Knowledge When Learning B...An Importance Sampling Approach to Integrate Expert Knowledge When Learning B...
An Importance Sampling Approach to Integrate Expert Knowledge When Learning B...
 
Aggregation computation over distributed data streams
Aggregation computation over distributed data streamsAggregation computation over distributed data streams
Aggregation computation over distributed data streams
 
Matrix Completion Presentation
Matrix Completion PresentationMatrix Completion Presentation
Matrix Completion Presentation
 
CLIM Program: Remote Sensing Workshop, Statistical Emulation with Dimension R...
CLIM Program: Remote Sensing Workshop, Statistical Emulation with Dimension R...CLIM Program: Remote Sensing Workshop, Statistical Emulation with Dimension R...
CLIM Program: Remote Sensing Workshop, Statistical Emulation with Dimension R...
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Ica group 3[1]
Ica group 3[1]Ica group 3[1]
Ica group 3[1]
 
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
 
Clustering-beamer.pdf
Clustering-beamer.pdfClustering-beamer.pdf
Clustering-beamer.pdf
 
Approximate Thin Plate Spline Mappings
Approximate Thin Plate Spline MappingsApproximate Thin Plate Spline Mappings
Approximate Thin Plate Spline Mappings
 
Habilitation à diriger des recherches
Habilitation à diriger des recherchesHabilitation à diriger des recherches
Habilitation à diriger des recherches
 
Patch Matching with Polynomial Exponential Families and Projective Divergences
Patch Matching with Polynomial Exponential Families and Projective DivergencesPatch Matching with Polynomial Exponential Families and Projective Divergences
Patch Matching with Polynomial Exponential Families and Projective Divergences
 
Double Patterning
Double PatterningDouble Patterning
Double Patterning
 
ImageSegmentation.ppt
ImageSegmentation.pptImageSegmentation.ppt
ImageSegmentation.ppt
 
ImageSegmentation.ppt
ImageSegmentation.pptImageSegmentation.ppt
ImageSegmentation.ppt
 

Recently uploaded

Everything you wanted to know about LIHTC
Everything you wanted to know about LIHTCEverything you wanted to know about LIHTC
Everything you wanted to know about LIHTC
Roger Valdez
 
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
slg6lamcq
 
Natural Language Processing (NLP), RAG and its applications .pptx
Natural Language Processing (NLP), RAG and its applications .pptxNatural Language Processing (NLP), RAG and its applications .pptx
Natural Language Processing (NLP), RAG and its applications .pptx
fkyes25
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
manishkhaire30
 
Predictably Improve Your B2B Tech Company's Performance by Leveraging Data
Predictably Improve Your B2B Tech Company's Performance by Leveraging DataPredictably Improve Your B2B Tech Company's Performance by Leveraging Data
Predictably Improve Your B2B Tech Company's Performance by Leveraging Data
Kiwi Creative
 
Challenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more importantChallenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more important
Sm321
 
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
Social Samosa
 
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
v7oacc3l
 
Influence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business PlanInfluence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business Plan
jerlynmaetalle
 
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
ahzuo
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
Timothy Spann
 
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
mzpolocfi
 
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
dwreak4tg
 
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
v3tuleee
 
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
slg6lamcq
 
The Ipsos - AI - Monitor 2024 Report.pdf
The  Ipsos - AI - Monitor 2024 Report.pdfThe  Ipsos - AI - Monitor 2024 Report.pdf
The Ipsos - AI - Monitor 2024 Report.pdf
Social Samosa
 
University of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma TranscriptUniversity of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma Transcript
soxrziqu
 
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
zsjl4mimo
 
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
apvysm8
 
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
74nqk8xf
 

Recently uploaded (20)

Everything you wanted to know about LIHTC
Everything you wanted to know about LIHTCEverything you wanted to know about LIHTC
Everything you wanted to know about LIHTC
 
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
 
Natural Language Processing (NLP), RAG and its applications .pptx
Natural Language Processing (NLP), RAG and its applications .pptxNatural Language Processing (NLP), RAG and its applications .pptx
Natural Language Processing (NLP), RAG and its applications .pptx
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
 
Predictably Improve Your B2B Tech Company's Performance by Leveraging Data
Predictably Improve Your B2B Tech Company's Performance by Leveraging DataPredictably Improve Your B2B Tech Company's Performance by Leveraging Data
Predictably Improve Your B2B Tech Company's Performance by Leveraging Data
 
Challenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more importantChallenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more important
 
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
 
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
 
Influence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business PlanInfluence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business Plan
 
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
 
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
 
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
 
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
 
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
 
The Ipsos - AI - Monitor 2024 Report.pdf
The  Ipsos - AI - Monitor 2024 Report.pdfThe  Ipsos - AI - Monitor 2024 Report.pdf
The Ipsos - AI - Monitor 2024 Report.pdf
 
University of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma TranscriptUniversity of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma Transcript
 
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
 
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
 
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
 

Dimensionality reduction with UMAP

  • 1. Dimensionality reduction with UMAP Advanced Data Mining seminar Jakub Bartczuk March 2020 Jakub Bartczuk Dimensionality reduction with UMAP March 2020 1 / 30
  • 2. Overview 1 Manifold learning recap Multidimensional Scaling Distances, graphs and matrix decomposition 2 Stochastic Neighbor Embedding 3 UMAP Topological and geometrical preliminaries Theoretical foundations Algorithm 4 Libraries Jakub Bartczuk Dimensionality reduction with UMAP March 2020 2 / 30
  • 3. Teaser Reducing dimensionality of COIL20 Dataset Figure: tSNE Figure: UMAP Jakub Bartczuk Dimensionality reduction with UMAP March 2020 3 / 30
  • 4. Manifold learning recap We want to uncover lower-dimensional structure in high-dimensional space Is the structure linear? If yes, use PCA What to do if it is not linear? Jakub Bartczuk Dimensionality reduction with UMAP March 2020 4 / 30
  • 5. Manifold learning recap Jakub Bartczuk Dimensionality reduction with UMAP March 2020 5 / 30
  • 6. Classical Multidimensional Scaling Algorithm: MDS(X, d) Di,j = xi −xj 2 Find y’s: yi ∈ Rd Di,j = yi −yj 2 Such that D ≈ D Minimize R = i,j xi −xj 2 − yi −yj 2 Jakub Bartczuk Dimensionality reduction with UMAP March 2020 6 / 30
  • 7. Classical MDS properties easy to compute - decompose low-rank matrix from D Jakub Bartczuk Dimensionality reduction with UMAP March 2020 7 / 30
  • 8. Classical MDS properties easy to compute - decompose low-rank matrix from D fast - Euclidean distance matrix just couple of vectorized matrix computations Jakub Bartczuk Dimensionality reduction with UMAP March 2020 7 / 30
  • 9. Classical MDS properties easy to compute - decompose low-rank matrix from D fast - Euclidean distance matrix just couple of vectorized matrix computations treats all distortions alike Jakub Bartczuk Dimensionality reduction with UMAP March 2020 7 / 30
  • 10. Classical MDS properties easy to compute - decompose low-rank matrix from D fast - Euclidean distance matrix just couple of vectorized matrix computations treats all distortions alike What structure does MDS preserve? The last property basically means that we preserve local and global structure alike. x’s are close - they are close in embedding. x’s are distant - they are equally distant in embedding. Jakub Bartczuk Dimensionality reduction with UMAP March 2020 7 / 30
  • 11. Distances, graphs and matrix decomposition Local vs global structure We may not care about preserving exact large distances in embedding space as much as small distances Idea: Calculate distance along the set ’spanned’ by datapoints Manifold hypothesis The data lies in lower-dimensional, possibly nonlinear space which is embedded in ambient space Jakub Bartczuk Dimensionality reduction with UMAP March 2020 8 / 30
  • 12. MDS breakdown 1 estimate distances between some pairs of close points 2 make graph (X,E) with edges weighted by distance 3 define D as distance from graph 4 decompose matrix that represents the graph Jakub Bartczuk Dimensionality reduction with UMAP March 2020 9 / 30
  • 13. MDS breakdown 1 estimate distances between some pairs of close points 2 make graph (X,E) with edges weighted by distance 3 define D as distance from graph 4 decompose matrix that represents the graph Getting manifold learning algorithms from schematic Setting E = {((xi ,xj ), xi −xj 2)|xi ,xj ∈ X} (complete graph) we get classical MDS Modifying steps 1-3 will get us Isomap, Hessian Eigenmaps tSNE and UMAP will change step 4 Jakub Bartczuk Dimensionality reduction with UMAP March 2020 9 / 30
  • 14. Stochastic Neighbor Embedding Idea: embed into lower-dimensional space, preserve distance statistics qj|i = f ( yi −yj ) k=j f ( yi −yk ) ,pj|i = exp(− xi −xj 2/s2 i ) k=j exp(− xi −xk 2/s2 i ) KL(p,q) = i,j pj|i log pj|i qj|i Notes Choice of f determines algorithm: f (x) = exp(−x2) - original SNE f (x) = (1+x2)−1 - tSNE (note this is density of Cauchy distribution up to a constant) Jakub Bartczuk Dimensionality reduction with UMAP March 2020 10 / 30
  • 15. Stochastic Neighbor Embedding Perplexity s gives rise to perplexity Pi = 2H(pi ) which controls effective neighborhood size at xi . High level algorithm for each xi find s that matches given perplexity initialize yi randomly minimize KL with gradient descent w.r.t. yi Jakub Bartczuk Dimensionality reduction with UMAP March 2020 11 / 30
  • 16. Problems with SNE: Crowding problem ’more room’ for intermediate distances in higher dimensions Jakub Bartczuk Dimensionality reduction with UMAP March 2020 12 / 30
  • 17. Problems with SNE: Crowding problem ’more room’ for intermediate distances in higher dimensions pairs of points will tend to have similar distance (remember curse of dimensionality for kNN) Jakub Bartczuk Dimensionality reduction with UMAP March 2020 12 / 30
  • 18. Problems with SNE: Crowding problem ’more room’ for intermediate distances in higher dimensions pairs of points will tend to have similar distance (remember curse of dimensionality for kNN) harder to embed them faithfully into lower dimensional space Jakub Bartczuk Dimensionality reduction with UMAP March 2020 12 / 30
  • 19. Problems with SNE: Crowding problem ’more room’ for intermediate distances in higher dimensions pairs of points will tend to have similar distance (remember curse of dimensionality for kNN) harder to embed them faithfully into lower dimensional space somewhat fixed by using t Distribution which has longer tails (not so concentrated around maximum). This problem is not specific to tSNE - it relates to the fact that data may not be sampled uniformly from manifold Jakub Bartczuk Dimensionality reduction with UMAP March 2020 12 / 30
  • 20. Bird’s view of UMAP’s theory Recall UMAP means Uniform Manifold Approximation and Projection Algorithm 1 get input data representation 2 initialize embedding 3 calculate probabilities of points being nearest neighbors 4 optimize embedding Jakub Bartczuk Dimensionality reduction with UMAP March 2020 13 / 30
  • 21. Bird’s view of UMAP’s theory Recall UMAP means Uniform Manifold Approximation and Projection Algorithm 1 get input data representation 2 initialize embedding 3 calculate probabilities of points being nearest neighbors 4 optimize embedding This also describes tSNE, what are the differences? 1 Fuzzy set built using local distance functions ( Riemannian metric) 2 kNN graph’s Laplacian 3 Probability between points corresponds to likelihood of points being connected in neighborhood graph 4 Cross entropy between fuzzy sets Jakub Bartczuk Dimensionality reduction with UMAP March 2020 13 / 30
  • 22. UMAP vs tSNE in a nutshell UMAP paper appendix C UMAP tSNE Initialization Laplacian decomposition Random Gaussian Optimization SGD + negative sampling Gradient Descent pi|j exp(− d(xi ,xj )−ρi σi ) exp(− xi −xj 2 /s2 i ) k=j exp(− xi −xk 2/s2 i ) qi|j (1+a yi −yj 2b))−1 (1+( yi −yj 2 ))−1 k=j (1+( yi −yk 2))−1 Loss H(q, p) = H(p) + KL(q, p) KL(q, p) Why such p, q? ρi - Riemannian structure σi - analogous to si q - approximation of membership for fuzzy simplicial complex Jakub Bartczuk Dimensionality reduction with UMAP March 2020 14 / 30
  • 23. Riemannian structure Remember we want to calculate distance along the manifold Curve length in Euclidean space Lγ = 1 0 γ (t) dt = 1 0 〈γ (t)|γ (t)〉dt Jakub Bartczuk Dimensionality reduction with UMAP March 2020 15 / 30
  • 24. Riemannian structure Remember we want to calculate distance along the manifold Curve length in Euclidean space Lγ = 1 0 γ (t) dt = 1 0 〈γ (t)|γ (t)〉dt Definition Riemannian space has local inner product. Precisely, it has an inner product on each tangent space that varies smoothly. Jakub Bartczuk Dimensionality reduction with UMAP March 2020 15 / 30
  • 25. Riemannian structure Remember we want to calculate distance along the manifold Curve length in Euclidean space Lγ = 1 0 γ (t) dt = 1 0 〈γ (t)|γ (t)〉dt Definition Riemannian space has local inner product. Precisely, it has an inner product on each tangent space that varies smoothly. Idea Estimate Riemannian structure locally with finite samples - set it constant on neighborhoods Problem We get incompatible local structures Jakub Bartczuk Dimensionality reduction with UMAP March 2020 15 / 30
  • 26. Riemannian structure Jakub Bartczuk Dimensionality reduction with UMAP March 2020 16 / 30
  • 27. Some Category Theory Category theory is not a theory per se, it’s rather a framework for thinking about mathematics Definitions A category C is a collection of objects with morphisms that can be composed and the composition satisfies some technical conditions Think a set of some sets with functions that preserve structure Definition A morphism f : A → B is an isomorphism if there is a morphism g : B → A such that f ◦g = idA and g ◦f = idB Jakub Bartczuk Dimensionality reduction with UMAP March 2020 17 / 30
  • 28. Some Category Theory Examples category FinSet of finite sets and functions between them category Graphs of graphs and graph homomorphisms category Ab of Abelian groups and group homomorphisms category of metric spaces and contractions Definition A mapping F : C → D is a functor if F(f ◦g) = F(f )◦F(g) Warning: technically this is a pair of mappings but we usually omit this Examples F : Graphs → FinSet F((V ,E)) = V Jakub Bartczuk Dimensionality reduction with UMAP March 2020 18 / 30
  • 29. Topological preliminaries Extended pseudometric space A space is called pseudometric if it suffices metric space axioms, but without requiring that d(x,y) = 0 =⇒ x = y d : X ×X → R+ d(x,y) = d(y,x) d(x,y)+d(y,z) ≥ d(x,z) In extended pseudometric space it also can happen that d(x,y) = ∞ Jakub Bartczuk Dimensionality reduction with UMAP March 2020 19 / 30
  • 30. Topological preliminaries Simplex A d-dimensional simplex is a set S ⊂ Rn such that there are d linearly independent points S = conv(d) Simplicial complex A set C of simplexes such that if s,s ∈ C =⇒ s ∩s ∈ C Jakub Bartczuk Dimensionality reduction with UMAP March 2020 20 / 30
  • 31. Topology Definition Definition: nerve of a family of sets U = {Ui |i ∈ I} is the set of finite subsets s of I for which i∈s Ui = Definition U is a cover of X if i Ui = X Nerve theorem If set U is an open cover of X then X ∼ N(U ) (they are homotopy equivalent, this is one notion of equivalence from topology) Jakub Bartczuk Dimensionality reduction with UMAP March 2020 21 / 30
  • 32. Fuzzy sets Definitions For fixed set X, S ⊂ X, m : S → [0,1] (fuzzy membership function) A pair (S,m) is a fuzzy set if 0 ≤ m(x) ≤ 1 Fuzzy sets have natural generalizations of set operations: if (S,mS),(R,mR) are fuzzy sets then (S ∪R,mS∪R) is a fuzzy set where mS∪R(x) = max(mS(x),mR(x)) Jakub Bartczuk Dimensionality reduction with UMAP March 2020 22 / 30
  • 33. Fuzzy sets Definitions For fixed set X, S ⊂ X, m : S → [0,1] (fuzzy membership function) A pair (S,m) is a fuzzy set if 0 ≤ m(x) ≤ 1 Fuzzy sets have natural generalizations of set operations: if (S,mS),(R,mR) are fuzzy sets then (S ∪R,mS∪R) is a fuzzy set where mS∪R(x) = max(mS(x),mR(x)) Example S1 = ([0,1],m), m(x) = [x ∈ S]x Jakub Bartczuk Dimensionality reduction with UMAP March 2020 22 / 30
  • 34. Fuzzy sets Definitions For fixed set X, S ⊂ X, m : S → [0,1] (fuzzy membership function) A pair (S,m) is a fuzzy set if 0 ≤ m(x) ≤ 1 Fuzzy sets have natural generalizations of set operations: if (S,mS),(R,mR) are fuzzy sets then (S ∪R,mS∪R) is a fuzzy set where mS∪R(x) = max(mS(x),mR(x)) Example S1 = ([0,1],m), m(x) = [x ∈ S]x Category of fuzzy sets objects: fuzzy sets morphisms: functions f : S → R such that mS(x) ≤ mR(f (x)) Jakub Bartczuk Dimensionality reduction with UMAP March 2020 22 / 30
  • 35. Extended pseudometric spaces and fuzzy sets UMAP paper section 2.2 and appendix B Fuzzy simplicial sets are generalization of simplicial complexes. This category is denoted by Fin-sFuzz. Category of finite extended pseudometric spaces is denoted by FinEPMet Metric realization of fuzzy simplicial sets There exist functors Real : Fin-sFuzz → FinEPMet Sing : FinEPMet → Fin-sFuzz That are adjoint. Adjoint pairs of functions estabilish a weak equivalence relation of categories. Jakub Bartczuk Dimensionality reduction with UMAP March 2020 23 / 30
  • 36. Global structure from local structures Theory Construct extended pseudometric spaces locally Get fuzzy sets from pseudometric spaces Merge local fuzzy sets Jakub Bartczuk Dimensionality reduction with UMAP March 2020 24 / 30
  • 37. Global structure from local structures Dataset defines extended pseudometrics X = {xi }i<n ρi - distance from xi to its closest neighbor di (xj ,xk) = d(xj ,xk)−ρi if i = j or i = k ∞ otherwise Jakub Bartczuk Dimensionality reduction with UMAP March 2020 25 / 30
  • 38. Global structure from local structures Dataset defines extended pseudometrics X = {xi }i<n ρi - distance from xi to its closest neighbor di (xj ,xk) = d(xj ,xk)−ρi if i = j or i = k ∞ otherwise Extended pseudometric spaces → fuzzy simplicial sets (X,di ) → Sing((X,di )) Jakub Bartczuk Dimensionality reduction with UMAP March 2020 25 / 30
  • 39. Global structure from local structures Dataset defines extended pseudometrics X = {xi }i<n ρi - distance from xi to its closest neighbor di (xj ,xk) = d(xj ,xk)−ρi if i = j or i = k ∞ otherwise Extended pseudometric spaces → fuzzy simplicial sets (X,di ) → Sing((X,di )) Local fuzzy sets → global fuzzy set {(X,di )}i<n → i<n Sing((X,di )) Jakub Bartczuk Dimensionality reduction with UMAP March 2020 25 / 30
  • 40. Algorithm UMAP paper section 4.1 UMAP(X, n-neighbors, dim, min-dist, n-epochs) forall x ∈ X: fsx = LocalFuzzySet(x, n-neighbors) top-rep = x∈X fsx Y := SpectralEmbedding(top-rep, dim) Y := OptimizedEmbedding(top-rep, dim, min-dist, n-epochs) Jakub Bartczuk Dimensionality reduction with UMAP March 2020 26 / 30
  • 41. Algorithm - details Simplification We use only 1-skeleton, weighted neighborhood graph. Approximation To use gradient descent we need to take a differentiable approximation of fuzzy set membership. The authors propose qi|j = (1+a yi −yj 2b))−1 Probably the most important difference between tSNE (see tSNE paper 6.2) a,b are set to predefined values or estimated using least squares to approximate φ(i,j) = 1 if yi −yj 2 ≤ min-dist exp(− yi −yj 2 +min-dist)otherwise Jakub Bartczuk Dimensionality reduction with UMAP March 2020 27 / 30
  • 42. Optimization UMAP paper section 4.2 Optimization Optimize C(p,q) = H(p)+KL(p,q) For p,q use symmetrized pi,j = pi|j +pj|i −pi|j pj|i Computational shortcut calculate gradient of error for similar points approximate gradient for dissimilar points by negative sampling Implementation details - Nearest neighbors Naive implementation - O(n2) operations UMAP implementation uses approximate kNN Nearest Neighbor Descent algorithm is reported to have O(n1.14) complexity Jakub Bartczuk Dimensionality reduction with UMAP March 2020 28 / 30
  • 43. Python implementations tSNE and other algorithms scikit-learn implements tSNE, MDS, Isomap, Hessian Eigenmaps, Locally Linear Embedding faster implementations available in megaman package UMAP original author’s package (pip install umap-learn) GPU accelerated NVidia rapids (cuML) Jakub Bartczuk Dimensionality reduction with UMAP March 2020 29 / 30
  • 44. Further reading Understanding UMAP - interactive visualizations Exploratory Analysis of Interesting Datasets - UMAP’s documentation UMAP author’s google scholar page How Exactly UMAP Works - author’s other articles mention applications in life sciences The Category Theory Behind UMAP UMAP - Mathematics and implementational details Jakub Bartczuk Dimensionality reduction with UMAP March 2020 30 / 30