Dimension Reduction - Diagnostic - Goodness of Fit Plot

From Q
Jump to navigation Jump to search

Visualize how distances between points are preserved after dimension reduction

VizIcon Goodness Of Fit.svg

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 output:

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


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.


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

form.dropBox({name: "inputItem", label: "Dimension reduction", types: ["R:flipFactorAnalysis,2Dreduction,principal,princomp,fa"],
              prompt: "PCA, t-SNE or MDS output"});
form.numericUpDown({name: "formMaxPoints", label: "Maximum points", default_value: 1000, increment: 1, minimum: 2, maximum: Number.MAX_SAFE_INTEGER,
                    prompt: "Maximum points to display, random sampling is used if the output contains more points"});
goodness.of.fit <- GoodnessOfFitPlot(QInputs(inputItem), max.points = formMaxPoints)

See Also