8000 DOC manifold examples added to docstrings (#11823) · scikit-learn/scikit-learn@99a6742 · GitHub
[go: up one dir, main page]

Skip to content

Commit 99a6742

Browse files
adrinjalaliqinhanmin2014
authored andcommitted
DOC manifold examples added to docstrings (#11823)
1 parent fd15a12 commit 99a6742

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed

sklearn/manifold/isomap.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,18 @@ class Isomap(BaseEstimator, TransformerMixin):
8080
dist_matrix_ : array-like, shape (n_samples, n_samples)
8181
Stores the geodesic distance matrix of training data.
8282
83+
Examples
84+
--------
85+
>>> from sklearn.datasets import load_digits
86+
>>> from sklearn.manifold import Isomap
87+
>>> X, _ = load_digits(return_X_y=True)
88+
>>> X.shape
89+
(1797, 64)
90+
>>> embedding = Isomap(n_components=2)
91+
>>> X_transformed = embedding.fit_transform(X[:100])
92+
>>> X_transformed.shape
93+
(100, 2)
94+
8395
References
8496
----------
8597

sklearn/manifold/locally_linear.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,18 @@ class LocallyLinearEmbedding(BaseEstimator, TransformerMixin):
598598
Stores nearest neighbors instance, including BallTree or KDtree
599599
if applicable.
600600
601+
Examples
602+
--------
603+
>>> from sklearn.datasets import load_digits
604+
>>> from sklearn.manifold import LocallyLinearEmbedding
605+
>>> X, _ = load_digits(return_X_y=True)
606+
>>> X.shape
607+
(1797, 64)
608+
>>> embedding = LocallyLinearEmbedding(n_components=2)
609+
>>> X_transformed = embedding.fit_transform(X[:100])
610+
>>> X_transformed.shape
611+
(100, 2)
612+
601613
References
602614
----------
603615

sklearn/manifold/mds.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,17 @@ class MDS(BaseEstimator):
340340
The final value of the stress (sum of squared distance of the
341341
disparities and the distances for all constrained points).
342342
343+
Examples
344+
--------
345+
>>> from sklearn.datasets import load_digits
346+
>>> from sklearn.manifold import MDS
347+
>>> X, _ = load_digits(return_X_y=True)
348+
>>> X.shape
349+
(1797, 64)
350+
>>> embedding = MDS(n_components=2)
351+
>>> X_transformed = embedding.fit_transform(X[:100])
352+
>>> X_transformed.shape
353+
(100, 2)
343354
344355
References
345356
----------

sklearn/manifold/spectral_embedding_.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,18 @@ class SpectralEmbedding(BaseEstimator):
395395
affinity_matrix_ : array, shape = (n_samples, n_samples)
396396
Affinity_matrix constructed from samples or precomputed.
397397
398+
Examples
399+
--------
400+
>>> from sklearn.datasets import load_digits
401+
>>> from sklearn.manifold import SpectralEmbedding
402+
>>> X, _ = load_digits(return_X_y=True)
403+
>>> X.shape
404+
(1797, 64)
405+
>>> embedding = SpectralEmbedding(n_components=2)
406+
>>> X_transformed = embedding.fit_transform(X[:100])
407+
>>> X_transformed.shape
408+
(100, 2)
409+
398410
References
399411
----------
400412

0 commit comments

Comments
 (0)
0