# Difference between revisions of "paper 13"

## Random mapping (Random Projection)

The following passage contains a short review and brief introduction about Random Mapping <ref> Samuel Kaski; Dimensionality Reduction by Random Mapping:Fast Similarity Computation for Clustering, 1998 IEEE </ref>. We later explain some important results for estimating the Intrinsic Dimensionality (ID) of the manifold embedding in high dimensional space using $n$ sample points, as well as, some interesting results about the upper an lower bounds for Intrinsic Dimensionality of projected manifold and Minimum Number of Random Projections needed for an efficient mapping. <ref> Chinmay Hedg and Colleagues: Random Projection for Manifold Learning (2007)</ref>

### Introduction

For vector $x \in R^{N}$ and an $N\times M$ Random matrix $R$, $y=Rx$ is called Random map (projection) of $x$.
note that $y\in R^{M}$ and can be expressed as:

$y= \sum_{i}x_{i}r_{i}$

where $r_{i}'s$ are the columns of $R$.
In Random mapping orthogonal directions are replaced by random directions. By definition the number of columns of matrix $R$ is called the Number of Random projections ($M$) required to project a K-dimensional manifold from $R^{N}$ into $R^{M}$
For Large $N$ applying adaptive (data dependent) algorithms like Isomap, LLE, etc. is too costly and it is not feasible at times; Since Random Mapping almost preserves the metric structure, it is reasonable to use random projection (non-adaptive method) to map data into lower dimension ($M$) and then apply clustering algorithms or other dimensionality reduction algorithms. As an special case, If $R$ is orthonormal then similarity under random mapping is exactly preserved.
For example if Cosine of the angle made by two vectors is the measure of their similarity, we can assume $y_{1}$ and $y_{2}$ are the random maps of $x_{1}$ and $x_{2}$; Hence we will have
$y^{T}_{1}y_{2}=x^{T}_{1}R^{T}Rx_{2}$
where $R$ can be written as
$R^{T}R=I+\epsilon$ in which

$\epsilon_{ij}= \left\{\begin{matrix} r^{T}_{i}r_{j} & \text{if } j \neq i \\ 0 & \text{if} i=j \end{matrix}\right.$
now for special case where $R$ is orthonormal,
$R^{T}R=I$
since $\epsilon_{ij}=r^{T}_{i}r_{j}=0$
so
$y^{T}_{1}y_{2}=x^{T}_{1}x_{2}$

An interesting result about random matrix $R$ is that we can show when matrix $M$ (reduced dimension) is large, then $\epsilon_{ij}$'s are independently distributed as Normal distribution with mean $0$ and variance $1/M$

### Estimating The Intrinsic Dimension

Intrinsic Dimension ($K$) is an important input for almost all metric learning algorithms. Grossberger-Proccacia (GP) algorithm can help us to estimate $K$ using $n$ sample points selected from $K$-dimensional manifold embedded in $R^{N}$. Define

$C_{n}(r)=\frac{1}{n(n-1)} \sum_{i\neq j}I \left\|x_{i}-x_{j}\right\|\lt r$

which basically measures the probability of a random pairs of points havinng distances less than $r$. Then the estimate of $K$ is obtained by using the following formula (known as the Scale-dependent Correlation Dimension of $X=(x_{1},x_{2},...,x_{n})$):

$\hat{D}_{corr}(r_{1},r_{2})=\frac{log(C_{n}(r_{1}))-log(C_{n}(r_{2}))}{log(r_{1})-log(r_{2})}$

When $r_{1}$ and $r_{2}$ are selected such that they cover the biggest range of graph at which $C_{n}(r)$ is linear, GP gives the best estimate. Another important point to consider is that $\widehat{K}$ the obtained GP algorithm based on finite sample points is a Biased estimate.

The reason why the above formula works can be explained as follows: if the intrinsic dimensionality is 1, the number of points within a (1-dim) sphere around a given point would be proportional to $r$. If the intrinsic dimensionality is 2 and the points are (at least locally) distributed on a plane, then the number of points within a (2-dim) sphere around a given point would be proportional to $\pi r^2$, i.e., the area of the corresponding circle. Similarly in the case of a 3-dim sphere, we will have proportionality to $4/3 \pi r^3$, and so on. So if we take logarithm of this function, we expect the number of intrinsic dimensionality to be reflected in the slope of the resulting function, as implied by the the formula above.

### Upper and Lower Bound for estimator of $K$

Baraniuk and Wakin (2007) showed that if the number of random projection $(M)$ is large, we can be sure that the projection of a smooth manifold into lower dimensional space will be a near-isometric embedding. $M$ should have linear relation with $K$ and Logarithmic relationship with $N$ described by

$M=c K log\left( N \right)$

Remember that, since random mapping almost preserves metric structure, we need to estimate the ID of the projected data.
Chinmay Hedg and his colleagues (2007) showed that under some conditions, for random orthoprojector $R$ (consists of $M$ orthogonalized vectors of length $N$) and sequence of sample $X=\left\{x_{1},x_{2},...\right\}$, with probability $1-\rho$

$(1-\delta)\hat{K}\leq \hat{K}_{R}\leq (1+\delta)\hat{K}$

for fix $0 \lt \delta \lt 1$ and $0 \lt \rho \lt 1$

### Lower Bound for the number of Random Projections

We can also find the minimum number of projections needed such that, the difference between residuals obtained from applying Isomap on projected data and original data does not exceed an arbitary value.

Let $\Gamma=max_{1\leq i,j\leq n}d_{iso}(x_{i},x_{j})$ and call it Diameter of data set $X=\left\{x_{1},x_{2},...,x_{n}\right\}$ where $d_{iso} \left(x_{i},x_{j}\right)$ is the Isomap estimate of geodesic distance; also let $L$ and $L_{R}$ be the residuals obtained from Isomap generated $K$-dimentional embeding of $X$ and its progection $RX$, respectively. then we have,

$L_{R}\lt L+C \left(n\right) \Gamma^{2}\epsilon$

in which $C(n)$ is a function of the number of sample points.

### practical algorithm to determine $K$ and $M$

The above theorems are not able to give us the estimates without some prior information ( about the volume and condition of manifold), hence they are called Theoretical Theorems, But with the help of ML-RP algorithm we can make achieve this goal.

let $M=1$ and select a random vector for $R$
While residual variance $\gt \delta$ do

 $(i)$ for $X=\left\{x_{1},x_{2},...,x_{n}\right\}$ estimate $K$ using GP algorithm.
$(ii)$ Use Isomap to produce an embedding in to $\hat{K}$-dimensional space.
$(iii)$ let $M=M+1$ and add one row to $R$.


EndWhile
Print $M$ and $\hat{K}$

### Applications

The main goal of dimension reduction methods is to preserve as much information as possible from the high dimension to lower dimensional space. But it is also important to consider the computational complexity of the algorithm. Random projections preserves the similarity between the data vectors when the data is projected in fewer dimensions and the projections can also be computed faster.
In [1] <ref> Ella Bingham and Heikki Mannila:Random projection in dimensionality reduction: Applications to image and text data. </ref> , they applied random projections technique of dimensonality reduction to image (both, noisy and noiseless) and text data and conclude that the random lower dimension subspace yields results comparable to conventional dimensional reduction method, such as PCA but the computational time is significantly reduced. They also demonstarte that using a sparse random matrix leads to a further savings in computational complexity. The benefit of random projections is applicable only in applications where the distance between the points in the higher dimension have some meaning but if the distances are themselves suspect, the there is no point in preserving them in low dimensional space. They provide an example," In a Euclidean space, every dimension is equally important and independent of the others, whereas e.g. in a process monitoring application some measured quantities (that is, dimensions) might be closely related to others,and the interpoint distances do not necessarily bear a clear meaning."
Random projections do not suffer from the curse of dimensionality.
Random projections also have application in the area of signal processing, where the device can perform tasks directly on random projections and thereby save storage and processing costs.

## Experimental Results

### Convergence of Random Projections GP to conventional GP

Given a data set, the conventional GP algorithm gives an estimation of its intrinsic dimension(ID), which we denote by $EID$. In Random Projections GP, ID estimations, which we denote by $EID_M$, are obtained by running the GP algorithm on $M$ random projections of the original data set. Theorem 3.1 in the paper essentially shows that $EID_M$ converges to $EID$ when $M$ is sufficiently large. Section 5 of the paper illustrates the convergence using a synthesized data set.

The data set are obtained from drawing $n=1000$ samples from uniform distributions supported on K-dimensional hyper-spheres embedded in an ambient space of dimension $N=150$, where $K\lt \lt N$. The paper shows the result for values of K between 2 and 7.

In the figure on the left, the solid lines correspond to the $EID$ for different K and the dashed lines correspond to $EID_M$. As is obvious from the figure, $EID_M$ converges to $EID$ as M gets larger.

In the figure on the right, the minimum number of projections M required to obtain a 90% accurate $EID_M$ approximation of $EID$ is plotted against K, the real intrinsic dimension. Note the linear relationship, which is predicted by Theorem 3.1.

<references/>