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 (opens in a new tab)
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 (opens in a new tab) 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
Defined in: generated/manifold/SpectralEmbedding.ts:27 (opens in a new tab)
Properties
_isDisposed
boolean
=false
Defined in: generated/manifold/SpectralEmbedding.ts:25 (opens in a new tab)
_isInitialized
boolean
=false
Defined in: generated/manifold/SpectralEmbedding.ts:24 (opens in a new tab)
_py
PythonBridge
Defined in: generated/manifold/SpectralEmbedding.ts:23 (opens in a new tab)
id
string
Defined in: generated/manifold/SpectralEmbedding.ts:20 (opens in a new tab)
opts
any
Defined in: generated/manifold/SpectralEmbedding.ts:21 (opens in a new tab)
Accessors
affinity_matrix_
Affinity_matrix constructed from samples or precomputed.
Signature
affinity_matrix_(): Promise<ArrayLike[]>;
Returns
Promise
<ArrayLike
[]>
Defined in: generated/manifold/SpectralEmbedding.ts:275 (opens in a new tab)
embedding_
Spectral embedding of the training matrix.
Signature
embedding_(): Promise<ArrayLike[]>;
Returns
Promise
<ArrayLike
[]>
Defined in: generated/manifold/SpectralEmbedding.ts:248 (opens in a new tab)
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:329 (opens in a new tab)
n_features_in_
Number of features seen during fit.
Signature
n_features_in_(): Promise<number>;
Returns
Promise
<number
>
Defined in: generated/manifold/SpectralEmbedding.ts:302 (opens in a new tab)
n_neighbors_
Number of nearest neighbors effectively used.
Signature
n_neighbors_(): Promise<number>;
Returns
Promise
<number
>
Defined in: generated/manifold/SpectralEmbedding.ts:356 (opens in a new tab)
py
Signature
py(): PythonBridge;
Returns
PythonBridge
Defined in: generated/manifold/SpectralEmbedding.ts:82 (opens in a new tab)
Signature
py(pythonBridge: PythonBridge): void;
Parameters
Name | Type |
---|---|
pythonBridge | PythonBridge |
Returns
void
Defined in: generated/manifold/SpectralEmbedding.ts:86 (opens in a new tab)
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 (opens in a new tab)
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 (opens in a new tab)
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 (opens in a new tab)
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 (opens in a new tab)