Class: MDS

Multidimensional scaling.

Read more in the User Guide.

Python Reference

Constructors

new MDS()

new MDS(opts?): MDS

Parameters

ParameterTypeDescription
opts?object-
opts.dissimilarity?"euclidean" | "precomputed"Dissimilarity measure to use:
opts.eps?numberRelative tolerance with respect to stress at which to declare convergence. The value of eps should be tuned separately depending on whether or not normalized_stress is being used.
opts.max_iter?numberMaximum number of iterations of the SMACOF algorithm for a single run.
opts.metric?booleanIf true, perform metric MDS; otherwise, perform nonmetric MDS. When false (i.e. non-metric MDS), dissimilarities with 0 are considered as missing values.
opts.n_components?numberNumber of dimensions in which to immerse the dissimilarities.
opts.n_init?numberNumber of times the SMACOF algorithm will be run with different initializations. The final results will be the best output of the runs, determined by the run with the smallest final stress.
opts.n_jobs?numberThe number of jobs to use for the computation. If multiple initializations are used (n_init), each run of the algorithm is computed in parallel. undefined means 1 unless in a joblib.parallel_backend context. \-1 means using all processors. See Glossary for more details.
opts.normalized_stress?boolean | "auto” default=”auto"Whether use and return normed stress value (Stress-1) instead of raw stress calculated by default. Only supported in non-metric MDS.
opts.random_state?numberDetermines the random number generator used to initialize the centers. Pass an int for reproducible results across multiple function calls. See Glossary.
opts.verbose?numberLevel of verbosity.

Returns MDS

Defined in generated/manifold/MDS.ts:23

Properties

PropertyTypeDefault valueDefined in
_isDisposedbooleanfalsegenerated/manifold/MDS.ts:21
_isInitializedbooleanfalsegenerated/manifold/MDS.ts:20
_pyPythonBridgeundefinedgenerated/manifold/MDS.ts:19
idstringundefinedgenerated/manifold/MDS.ts:16
optsanyundefinedgenerated/manifold/MDS.ts:17

Accessors

dissimilarity_matrix_

Get Signature

get dissimilarity_matrix_(): Promise<ArrayLike[]>

Pairwise dissimilarities between the points. Symmetric matrix that:

Returns Promise<ArrayLike[]>

Defined in generated/manifold/MDS.ts:359


embedding_

Get Signature

get embedding_(): Promise<ArrayLike[]>

Stores the position of the dataset in the embedding space.

Returns Promise<ArrayLike[]>

Defined in generated/manifold/MDS.ts:315


feature_names_in_

Get Signature

get feature_names_in_(): Promise<ArrayLike>

Names of features seen during fit. Defined only when X has feature names that are all strings.

Returns Promise<ArrayLike>

Defined in generated/manifold/MDS.ts:407


n_features_in_

Get Signature

get n_features_in_(): Promise<number>

Number of features seen during fit.

Returns Promise<number>

Defined in generated/manifold/MDS.ts:384


n_iter_

Get Signature

get n_iter_(): Promise<number>

The number of iterations corresponding to the best stress.

Returns Promise<number>

Defined in generated/manifold/MDS.ts:430


py

Get Signature

get py(): PythonBridge

Returns PythonBridge

Set Signature

set py(pythonBridge): void

Parameters

ParameterType
pythonBridgePythonBridge

Returns void

Defined in generated/manifold/MDS.ts:94


stress_

Get Signature

get stress_(): Promise<number>

The final value of the stress (sum of squared distance of the disparities and the distances for all constrained points). If normalized_stress=True, and metric=False returns Stress-1. A value of 0 indicates “perfect” fit, 0.025 excellent, 0.05 good, 0.1 fair, and 0.2 poor [1].

Returns Promise<number>

Defined in generated/manifold/MDS.ts:337

Methods

dispose()

dispose(): Promise<void>

Disposes of the underlying Python resources.

Once dispose() is called, the instance is no longer usable.

Returns Promise<void>

Defined in generated/manifold/MDS.ts:145


fit()

fit(opts): Promise<any>

Compute the position of the points in the embedding space.

Parameters

ParameterTypeDescription
optsobject-
opts.init?ArrayLike[]Starting configuration of the embedding to initialize the SMACOF algorithm. By default, the algorithm is initialized with a randomly chosen array.
opts.X?ArrayLike[]Input data. If dissimilarity=='precomputed', the input should be the dissimilarity matrix.
opts.y?anyNot used, present for API consistency by convention.

Returns Promise<any>

Defined in generated/manifold/MDS.ts:162


fit_transform()

fit_transform(opts): Promise<ArrayLike[]>

Fit the data from X, and returns the embedded coordinates.

Parameters

ParameterTypeDescription
optsobject-
opts.init?ArrayLike[]Starting configuration of the embedding to initialize the SMACOF algorithm. By default, the algorithm is initialized with a randomly chosen array.
opts.X?ArrayLike[]Input data. If dissimilarity=='precomputed', the input should be the dissimilarity matrix.
opts.y?anyNot used, present for API consistency by convention.

Returns Promise<ArrayLike[]>

Defined in generated/manifold/MDS.ts:203


get_metadata_routing()

get_metadata_routing(opts): Promise<any>

Get metadata routing of this object.

Please check User Guide on how the routing mechanism works.

Parameters

ParameterTypeDescription
optsobject-
opts.routing?anyA MetadataRequest encapsulating routing information.

Returns Promise<any>

Defined in generated/manifold/MDS.ts:247


init()

init(py): Promise<void>

Initializes the underlying Python resources.

This instance is not usable until the Promise returned by init() resolves.

Parameters

ParameterType
pyPythonBridge

Returns Promise<void>

Defined in generated/manifold/MDS.ts:107


set_fit_request()

set_fit_request(opts): Promise<any>

Request metadata passed to the fit method.

Note that this method is only relevant if enable_metadata_routing=True (see sklearn.set_config). Please see User Guide on how the routing mechanism works.

The options for each parameter are:

Parameters

ParameterTypeDescription
optsobject-
opts.init?string | booleanMetadata routing for init parameter in fit.

Returns Promise<any>

Defined in generated/manifold/MDS.ts:283