SMACOF
SMACOF (Scaling by Majorizing a Complicated Function) is a method for metric multidimensional scaling.
How It Works
SMACOF is an iterative majorization algorithm for solving metric multidimensional scaling problems. It aims to minimize the "stress" function, which measures the difference between the given true pairwise distances and the corresponding pairwise distances in the lower-dimensional embedded space. In each iterations, it bounds the complicated stress function with a simpler convex majorant and minimizes the surrogate, guaranteeing a monotonic decrease in stress until convergence.
Why or When to Use
Use SMACOF as a more robust and flexible alternative to Classical MDS when you need accurate preservation of distances. It is advantageous because it can easily be modified to use weights (ignoring missing distances or discounting less reliable similarities) and generally yields a tighter fit to the original distances than classical methods.
Example
How-to (Code)
import * as druid from "@saehrimnir/druidjs";
const data = [
/* ... multi-dimensional data ... */
];
// 1. Initialize the algorithm
const smacof = new druid.SMACOF(data);
// 2. Compute the projection
const projection = smacof.transform();