Class: Isomap
Isomap Embedding.
Non-linear dimensionality reduction through Isometric Mapping
Read more in the User Guide.
Constructors
new Isomap()
new Isomap(
opts
?):Isomap
Parameters
Parameter | Type | Description |
---|---|---|
opts ? | object | - |
opts.eigen_solver ? | "auto" | "arpack" | "dense" | ‘auto’ : Attempt to choose the most efficient solver for the given problem. ‘arpack’ : Use Arnoldi decomposition to find the eigenvalues and eigenvectors. ‘dense’ : Use a direct solver (i.e. LAPACK) for the eigenvalue decomposition. |
opts.max_iter ? | number | Maximum number of iterations for the arpack solver. not used if eigen_solver == ‘dense’. |
opts.metric ? | any | The metric to use when calculating distance between instances in a feature array. If metric is a string or callable, it must be one of the options allowed by sklearn.metrics.pairwise_distances for its metric parameter. If metric is “precomputed”, X is assumed to be a distance matrix and must be square. X may be a Glossary. |
opts.metric_params ? | any | Additional keyword arguments for the metric function. |
opts.n_components ? | number | Number of coordinates for the manifold. |
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 neighbors to consider for each point. If n_neighbors is an int, then radius must be undefined . |
opts.neighbors_algorithm ? | "auto" | "ball_tree" | "kd_tree" | "brute" | Algorithm to use for nearest neighbors search, passed to neighbors.NearestNeighbors instance. |
opts.p ? | number | Parameter for the Minkowski metric from sklearn.metrics.pairwise.pairwise_distances. When p = 1, this is equivalent to using manhattan_distance (l1), and euclidean_distance (l2) for p = 2. For arbitrary p, minkowski_distance (l_p) is used. |
opts.path_method ? | "auto" | "FW" | "D" | Method to use in finding shortest path. ‘auto’ : attempt to choose the best algorithm automatically. ‘FW’ : Floyd-Warshall algorithm. ‘D’ : Dijkstra’s algorithm. |
opts.radius ? | number | Limiting distance of neighbors to return. If radius is a float, then n_neighbors must be set to undefined . |
opts.tol ? | number | Convergence tolerance passed to arpack or lobpcg. not used if eigen_solver == ‘dense’. |
Returns Isomap
Defined in generated/manifold/Isomap.ts:25
Properties
Property | Type | Default value | Defined in |
---|---|---|---|
_isDisposed | boolean | false | generated/manifold/Isomap.ts:23 |
_isInitialized | boolean | false | generated/manifold/Isomap.ts:22 |
_py | PythonBridge | undefined | generated/manifold/Isomap.ts:21 |
id | string | undefined | generated/manifold/Isomap.ts:18 |
opts | any | undefined | generated/manifold/Isomap.ts:19 |
Accessors
dist_matrix_
Get Signature
get dist_matrix_():
Promise
<ArrayLike
>
Stores the geodesic distance matrix of training data.
Returns Promise
<ArrayLike
>
Defined in generated/manifold/Isomap.ts:493
embedding_
Get Signature
get embedding_():
Promise
<ArrayLike
>
Stores the embedding vectors.
Returns Promise
<ArrayLike
>
Defined in generated/manifold/Isomap.ts:425
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/Isomap.ts:539
kernel_pca_
Get Signature
get kernel_pca_():
Promise
<any
>
KernelPCA
object used to implement the embedding.
Returns Promise
<any
>
Defined in generated/manifold/Isomap.ts:448
n_features_in_
Get Signature
get n_features_in_():
Promise
<number
>
Number of features seen during fit.
Returns Promise
<number
>
Defined in generated/manifold/Isomap.ts:516
nbrs_
Get Signature
get nbrs_():
Promise
<any
>
Stores nearest neighbors instance, including BallTree or KDtree if applicable.
Returns Promise
<any
>
Defined in generated/manifold/Isomap.ts:471
py
Get Signature
get py():
PythonBridge
Returns PythonBridge
Set Signature
set py(
pythonBridge
):void
Parameters
Parameter | Type |
---|---|
pythonBridge | PythonBridge |
Returns void
Defined in generated/manifold/Isomap.ts:116
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/Isomap.ts:167
fit()
fit(
opts
):Promise
<any
>
Compute the embedding vectors for data X.
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.X ? | any | Sample data, shape = (n_samples, n_features), in the form of a numpy array, sparse matrix, precomputed tree, or NearestNeighbors object. |
opts.y ? | any | Not used, present for API consistency by convention. |
Returns Promise
<any
>
Defined in generated/manifold/Isomap.ts:184
fit_transform()
fit_transform(
opts
):Promise
<ArrayLike
>
Fit the model from data in X and transform X.
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.X ? | any | Training vector, where n_samples is the number of samples and n_features is the number of features. |
opts.y ? | any | Not used, present for API consistency by convention. |
Returns Promise
<ArrayLike
>
Defined in generated/manifold/Isomap.ts:221
get_feature_names_out()
get_feature_names_out(
opts
):Promise
<any
>
Get output feature names for transformation.
The feature names out will prefixed by the lowercased class name. For example, if the transformer outputs 3 features, then the feature names out are: \["class_name0", "class_name1", "class_name2"\]
.
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.input_features ? | any | Only used to validate feature names with the names seen in fit . |
Returns Promise
<any
>
Defined in generated/manifold/Isomap.ts:260
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
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.routing ? | any | A MetadataRequest encapsulating routing information. |
Returns Promise
<any
>
Defined in generated/manifold/Isomap.ts:294
init()
init(
py
):Promise
<void
>
Initializes the underlying Python resources.
This instance is not usable until the Promise
returned by init()
resolves.
Parameters
Parameter | Type |
---|---|
py | PythonBridge |
Returns Promise
<void
>
Defined in generated/manifold/Isomap.ts:129
reconstruction_error()
reconstruction_error(
opts
):Promise
<any
>
Compute the reconstruction error for the embedding.
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.reconstruction_error ? | number | Reconstruction error. |
Returns Promise
<any
>
Defined in generated/manifold/Isomap.ts:326
set_output()
set_output(
opts
):Promise
<any
>
Set output container.
See Introducing the set_output API for an example on how to use the API.
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.transform ? | "default" | "pandas" | "polars" | Configure output of transform and fit_transform . |
Returns Promise
<any
>
Defined in generated/manifold/Isomap.ts:360
transform()
transform(
opts
):Promise
<ArrayLike
>
Transform X.
This is implemented by linking the points X into the graph of geodesic distances of the training data. First the n_neighbors
nearest neighbors of X are found in the training data, and from these the shortest geodesic distances from each point in X to each point in the training data are computed in order to construct the kernel. The embedding of X is the projection of this kernel onto the embedding vectors of the training set.
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.X ? | any | If neighbors_algorithm=’precomputed’, X is assumed to be a distance matrix or a sparse graph of shape (n_queries, n_samples_fit). |
Returns Promise
<ArrayLike
>
Defined in generated/manifold/Isomap.ts:394