Skip to content

Latest commit

 

History

History
304 lines (178 loc) · 9.55 KB

SpectralEmbedding.md

File metadata and controls

304 lines (178 loc) · 9.55 KB

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

constructor()

Signature

new SpectralEmbedding(opts?: object): SpectralEmbedding;

Parameters

Name Type Description
opts? object -
opts.affinity? "precomputed" | "rbf" | "nearest_neighbors" | "precomputed_nearest_neighbors" ‘nearest_neighbors’ : construct the affinity matrix by computing a graph of nearest neighbors. Default Value '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? number Stopping criterion for eigendecomposition of the Laplacian matrix. If eigen\_tol="auto" then the passed tolerance will depend on the eigen\_solver: Default Value 'auto'
opts.gamma? number Kernel coefficient for rbf kernel. If undefined, gamma will be set to 1/n_features.
opts.n_components? number The dimension of the projected subspace. Default Value 2
opts.n_jobs? number The 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? number Number of nearest neighbors for nearest_neighbors graph building. If undefined, n_neighbors will be set to max(n_samples/10, 1).
opts.random_state? number A 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

Methods

dispose()

Disposes of the underlying Python resources.

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

Signature

dispose(): Promise<void>;

Returns

Promise<void>

Defined in: generated/manifold/SpectralEmbedding.ts:145

fit()

Fit the model from data in X.

Signature

fit(opts: object): Promise<any>;

Parameters

Name Type Description
opts object -
opts.X? ArrayLike Training 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? any Not used, present for API consistency by convention.

Returns

Promise<any>

Defined in: generated/manifold/SpectralEmbedding.ts:162

fit_transform()

Fit the model from data in X and transform X.

Signature

fit_transform(opts: object): Promise<ArrayLike[]>;

Parameters

Name Type Description
opts object -
opts.X? ArrayLike Training 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? any Not used, present for API consistency by convention.

Returns

Promise<ArrayLike[]>

Defined in: generated/manifold/SpectralEmbedding.ts:204

get_metadata_routing()

Get metadata routing of this object.

Please check User Guide on how the routing mechanism works.

Signature

get_metadata_routing(opts: object): Promise<any>;

Parameters

Name Type Description
opts object -
opts.routing? any A MetadataRequest encapsulating routing information.

Returns

Promise<any>

Defined in: generated/manifold/SpectralEmbedding.ts:250

init()

Initializes the underlying Python resources.

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

Signature

init(py: PythonBridge): Promise<void>;

Parameters

Name Type
py PythonBridge

Returns

Promise<void>

Defined in: generated/manifold/SpectralEmbedding.ts:95

Properties

_isDisposed

boolean = false

Defined in: generated/manifold/SpectralEmbedding.ts:25

_isInitialized

boolean = false

Defined in: generated/manifold/SpectralEmbedding.ts:24

_py

PythonBridge

Defined in: generated/manifold/SpectralEmbedding.ts:23

id

string

Defined in: generated/manifold/SpectralEmbedding.ts:20

opts

any

Defined in: generated/manifold/SpectralEmbedding.ts:21

Accessors

affinity_matrix_

Affinity_matrix constructed from samples or precomputed.

Signature

affinity_matrix_(): Promise<ArrayLike[]>;

Returns

Promise<ArrayLike[]>

Defined in: generated/manifold/SpectralEmbedding.ts:315

embedding_

Spectral embedding of the training matrix.

Signature

embedding_(): Promise<ArrayLike[]>;

Returns

Promise<ArrayLike[]>

Defined in: generated/manifold/SpectralEmbedding.ts:288

feature_names_in_

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

Signature

feature_names_in_(): Promise<ArrayLike>;

Returns

Promise<ArrayLike>

Defined in: generated/manifold/SpectralEmbedding.ts:369

n_features_in_

Number of features seen during fit.

Signature

n_features_in_(): Promise<number>;

Returns

Promise<number>

Defined in: generated/manifold/SpectralEmbedding.ts:342

n_neighbors_

Number of nearest neighbors effectively used.

Signature

n_neighbors_(): Promise<number>;

Returns

Promise<number>

Defined in: generated/manifold/SpectralEmbedding.ts:396

py

Signature

py(): PythonBridge;

Returns

PythonBridge

Defined in: generated/manifold/SpectralEmbedding.ts:82

Signature

py(pythonBridge: PythonBridge): void;

Parameters

Name Type
pythonBridge PythonBridge

Returns

void

Defined in: generated/manifold/SpectralEmbedding.ts:86