Dimension Reduction - Diagnostic - Goodness of Fit Plot
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
- Add the object by selecting from the menu Create > Dimension Reduction > Diagnostic > Goodness of Fit Plot
- 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)
form.setObjectInspectorTitle(heading_text);
else
form.setHeading(heading_text);
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"});
library(flipDimensionReduction)
goodness.of.fit <- GoodnessOfFitPlot(QInputs(inputItem), max.points = formMaxPoints)