_logger.debug("Performing classic MDS on {} of shape {}...".format(
type(D).__name__, D.shape))
D = D**2
D = D - D.mean(axis=0)[None, :]
D = D - D.mean(axis=1)[:, None]
pca = PCA(n_components=ndim, svd_solver="randomized")
Y = pca.fit_transform(D)
return Y
def embed_MDS(X, ndim=2, how="metric", distance_metric="euclidean",
n_jobs=1, seed=None, verbose=0):
After Change
// Fast classical MDS using random svd
@deprecated("1.5.0", reason="Use phate.mds.classic instead")
def cmdscale_fast(D, ndim):
return classic(D=D, n_components=ndim)
def classic(D, n_components=2, random_state=None):
Fast CMDS using random SVD