## 2 Methods  
We follow the approach of distance scaling so that even if a distance preservation-based method is used, the local topology remains intact. In our approach, the MDS method tries to preserve the distances; however due to warping (shrinkage) of distances among data-points, the local topology could also be preserved. However, for this purpose, some prior guess of manifold and local topology is needed. Therefore, we first use self organising map (SOM) to get a rough estimate of groups and initial prediction of the manifold. The grouping of data-points by SOM need not to be necessarily correct, but it provides an estimate of neighborhood to be used by TPDS. Moreover, if the number of features is too large, one can first perform singular value decomposition (SVD) of data and use singular vectors with SOM. After a rough estimation of manifold and neighborhood, we scale the distance between the data-points using their belonging-ness to different groups and distance between group means. Notice that SOM has its own neighbourhood function which is shrunk during optimization. However, SOM is constrained by its geometry which often causes the collapse of data-points and loss of distances information. Therefore we do not need to be totally dependent on SOM but derive likelihood of proximity using output from SOM so that distance and local topology can be represented well. Therefore scaling function used by TPDS consists of an attractive and a repulsive component. For this purpose we define \(m_{ij}\) as likelihood of proximity between two data-points \(i\) and \(j\) belonging to two different SOM clusters with centers \(c_{i}\) and \(c_{j}\) as  
\[m_{ij}=e^{-dst(c_{i}c_{j})^{2}/\rho}. \tag{1}\]Here \(dist(c_{i},c_{j})\) is the normalised distance between cluster centers \(c_{i}\) and \(c_{j}\) to which data-points \(i\) and \(j\) belong. The spread factor \(\rho\) is just like the variance in Gaussian distribution. The centre of every SOM clusters is calculated by averaging its data-points. The \(dist(c_{i},c_{j})\) is normalised by division with mean of all distances between cluster centers. If data-points \(i\) and \(j\) belong to same SOM cluster the value of \(m_{ij}\) is calculated using distance \(d_{ij}\) between them  
\[m_{ij}=e^{-\delta d_{ij}^{2}/\rho} \tag{2}\]  
Notice that variable \(\rho\) is the same as in Equation (1) and \(\delta\) is a multiplying factor less than 1. The purpose of \(\delta\) is to inflate local distances wherever the data-points lie in the same cluster so that we can avoid their collapse. Thus, using two different ways of calculating \(m_{ij}\) depending on whether two data-points belong to same SOM cluster or not, helps in maintaining local topology for data-points belonging to same SOM cluster. We calculate the scaling factor for the distance between data-points \(x_{i}\) and \(x_{j}\) using the formula. \[S_{ij}=\frac{1}{1+m_{ij}-1/(1+m_{ij})+e^{-5}} \tag{3}\]  
Here \(e^{-5}\) is a pseudo-count to stop the scaling factor to go to infinity. After calculating the scaling factor, the distance between data-points are scaled using the formula  
\[\hat{d}_{ij}=d_{ij}S_{ij} \tag{4}\]  
The matrix of scaled distances \(\hat{d}_{ij}\) is then used with the non-metric MDS method to reduce the dimension. Please note that the value of the denominator in scaling factor defined in Equation (3) is controlled by the likelihood of proximity which itself becomes very small for large distances. The scaling factor is made such that it enhances the effect of the likelihood of proximity. When the likelihood of proximity \(m_{ij}\) is low the scaling factor \(S_{ij}\) increases and inflates the distance, hence it behaves like a repulsive force. However, when the likelihood \(m_{ij}\) is high and reaches closer to 1, the value of \(S_{ij}\) decrease to create an attractive force to shrink the distance \(d_{ij}\). Thus, we inflate and shrink distances according to the likelihood of proximity between data-points or their centres of clusters.