# Dimension Reduction - Diagnostic - Goodness of Fit Plot

Visualize how distances between points are preserved after dimension reduction

Chart the original Euclidean distances between data points (x-axis) versus Euclidean distances in reduced 2-dimensional space. The Spearman's rank correlation coefficient is shown.

This blog post describe the interpretation of plots with dimension reduction performed by different algorithms.

Note that t-SNE is particularly sensitive to the choice of random seed (which can be amended via the R code) and consequently the t-SNE correlation coefficient may vary depending on the seed.

## How to Create

1. Add the object by selecting from the menu Anything > Advanced Analysis > Dimension Reduction > Diagnostic > Goodness of Fit PlotCreate > Dimension Reduction > Diagnostic > Goodness of Fit Plot
2. Under Inputs > Dimension Reduction select a t-SNE, MDS, or PCA analysis output.

## Example

Example output:

Input Example:
An analysis using t-SNE, MDS, or PCA.

## Options

Dimension Reduction An R Output containing a principal components, multidimensional scaling or t-SNE analysis.

Maximum points The maximum number of points to plot. If the object contains more data points, a random sample is taken.

## Code

var heading_text = "Goodness of Fit Plot";
if (!!form.setObjectInspectorTitle)

library(flipDimensionReduction)