DocumentationClassesSpectralEmbedding

Class: SpectralEmbedding

Spectral embedding for non-linear dimensionality reduction.

Forms an affinity matrix given by the specified function and applies spectral decomposition to the corresponding graph laplacian. The resulting transformation is given by the value of the eigenvectors for each data point.

Note : Laplacian Eigenmaps is the actual algorithm implemented here.

Read more in the User Guide.

Python Reference

Constructors

new SpectralEmbedding()

new SpectralEmbedding(opts?): SpectralEmbedding

Parameters

ParameterTypeDescription
opts?object-
opts.affinity?"precomputed" | "rbf" | "nearest_neighbors" | "precomputed_nearest_neighbors"‘nearest_neighbors’ : construct the affinity matrix by computing a graph of nearest neighbors.
opts.eigen_solver?"arpack" | "lobpcg" | "amg"The eigenvalue decomposition strategy to use. AMG requires pyamg to be installed. It can be faster on very large, sparse problems. If undefined, then 'arpack' is used.
opts.eigen_tol?numberStopping criterion for eigendecomposition of the Laplacian matrix. If eigen_tol="auto" then the passed tolerance will depend on the eigen_solver:
opts.gamma?numberKernel coefficient for rbf kernel. If undefined, gamma will be set to 1/n_features.
opts.n_components?numberThe dimension of the projected subspace.
opts.n_jobs?numberThe number of parallel jobs to run. undefined means 1 unless in a joblib.parallel_backend context. \-1 means using all processors. See Glossary for more details.
opts.n_neighbors?numberNumber of nearest neighbors for nearest_neighbors graph building. If undefined, n_neighbors will be set to max(n_samples/10, 1).
opts.random_state?numberA pseudo random number generator used for the initialization of the lobpcg eigen vectors decomposition when eigen_solver \== 'amg', and for the K-Means initialization. Use an int to make the results deterministic across calls (See Glossary).

Returns SpectralEmbedding

Defined in generated/manifold/SpectralEmbedding.ts:27

Properties

PropertyTypeDefault valueDefined in
_isDisposedbooleanfalsegenerated/manifold/SpectralEmbedding.ts:25
_isInitializedbooleanfalsegenerated/manifold/SpectralEmbedding.ts:24
_pyPythonBridgeundefinedgenerated/manifold/SpectralEmbedding.ts:23
idstringundefinedgenerated/manifold/SpectralEmbedding.ts:20
optsanyundefinedgenerated/manifold/SpectralEmbedding.ts:21

Accessors

affinity_matrix_

Get Signature

get affinity_matrix_(): Promise<ArrayLike[]>

Affinity_matrix constructed from samples or precomputed.

Returns Promise<ArrayLike[]>

Defined in generated/manifold/SpectralEmbedding.ts:302


embedding_

Get Signature

get embedding_(): Promise<ArrayLike[]>

Spectral embedding of the training matrix.

Returns Promise<ArrayLike[]>

Defined in generated/manifold/SpectralEmbedding.ts:275


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/SpectralEmbedding.ts:356


n_features_in_

Get Signature

get n_features_in_(): Promise<number>

Number of features seen during fit.

Returns Promise<number>

Defined in generated/manifold/SpectralEmbedding.ts:329


n_neighbors_

Get Signature

get n_neighbors_(): Promise<number>

Number of nearest neighbors effectively used.

Returns Promise<number>

Defined in generated/manifold/SpectralEmbedding.ts:383


py

Get Signature

get py(): PythonBridge

Returns PythonBridge

Set Signature

set py(pythonBridge): void

Parameters

ParameterType
pythonBridgePythonBridge

Returns void

Defined in generated/manifold/SpectralEmbedding.ts:82

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/SpectralEmbedding.ts:136


fit()

fit(opts): Promise<any>

Fit the model from data in X.

Parameters

ParameterTypeDescription
optsobject-
opts.X?ArrayLikeTraining vector, where n_samples is the number of samples and n_features is the number of features. If affinity is “precomputed” X : {array-like, sparse matrix}, shape (n_samples, n_samples), Interpret X as precomputed adjacency graph computed from samples.
opts.y?anyNot used, present for API consistency by convention.

Returns Promise<any>

Defined in generated/manifold/SpectralEmbedding.ts:153


fit_transform()

fit_transform(opts): Promise<ArrayLike[]>

Fit the model from data in X and transform X.

Parameters

ParameterTypeDescription
optsobject-
opts.X?ArrayLikeTraining vector, where n_samples is the number of samples and n_features is the number of features. If affinity is “precomputed” X : {array-like, sparse matrix} of shape (n_samples, n_samples), Interpret X as precomputed adjacency graph computed from samples.
opts.y?anyNot used, present for API consistency by convention.

Returns Promise<ArrayLike[]>

Defined in generated/manifold/SpectralEmbedding.ts:194


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/SpectralEmbedding.ts:239


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/SpectralEmbedding.ts:95