We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Fix notebooks on netlify
Issues with setting jupyter notebook kernels prevent them from running on netlify

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `graspy/embed/lse.py`
Content:
```
1 # ase.py
2 # Created by Ben Pedigo on 2018-09-26.
3 # Email: bpedigo@jhu.edu
4 import warnings
5 
6 from .embed import BaseEmbed
7 from .svd import selectSVD
8 from ..utils import import_graph, to_laplace, get_lcc, is_fully_connected
9 
10 
11 class LaplacianSpectralEmbed(BaseEmbed):
12     r"""
13     Class for computing the laplacian spectral embedding of a graph 
14     
15     The laplacian spectral embedding (LSE) is a k-dimensional Euclidean representation of 
16     the graph based on its Laplacian matrix [1]_. It relies on an SVD to reduce the dimensionality
17     to the specified k, or if k is unspecified, can find a number of dimensions automatically.
18 
19     Parameters
20     ----------
21     n_components : int or None, default = None
22         Desired dimensionality of output data. If "full", 
23         n_components must be <= min(X.shape). Otherwise, n_components must be
24         < min(X.shape). If None, then optimal dimensions will be chosen by
25         ``select_dimension`` using ``n_elbows`` argument.
26     n_elbows : int, optional, default: 2
27         If `n_compoents=None`, then compute the optimal embedding dimension using
28         `select_dimension`. Otherwise, ignored.
29     algorithm : {'full', 'truncated' (default), 'randomized'}, optional
30         SVD solver to use:
31 
32         - 'full'
33             Computes full svd using ``scipy.linalg.svd``
34         - 'truncated'
35             Computes truncated svd using ``scipy.sparse.linalg.svd``
36         - 'randomized'
37             Computes randomized svd using 
38             ``sklearn.utils.extmath.randomized_svd``
39     n_iter : int, optional (default = 5)
40         Number of iterations for randomized SVD solver. Not used by 'full' or 
41         'truncated'. The default is larger than the default in randomized_svd 
42         to handle sparse matrices that may have large slowly decaying spectrum.
43     lcc : bool, optional (default=True)
44         If True, computes the largest connected component for the input graph.
45 
46     Attributes
47     ----------
48     latent_left_ : array, shape (n_samples, n_components)
49         Estimated left latent positions of the graph.
50     latent_right_ : array, shape (n_samples, n_components), or None
51         Only computed when the graph is directed, or adjacency matrix is assymetric.
52         Estimated right latent positions of the graph. Otherwise, None.
53     singular_values_ : array, shape (n_components)
54         Singular values associated with the latent position matrices.
55     indices_ : array, or None
56         If ``lcc`` is True, these are the indices of the vertices that were kept.
57 
58     See Also
59     --------
60     graspy.embed.selectSVD
61     graspy.embed.select_dimension
62     graspy.utils.to_laplace
63 
64     Notes
65     -----
66     The singular value decomposition: 
67 
68     .. math:: A = U \Sigma V^T
69 
70     is used to find an orthonormal basis for a matrix, which in our case is the Laplacian
71     matrix of the graph. These basis vectors (in the matrices U or V) are ordered according 
72     to the amount of variance they explain in the original matrix. By selecting a subset of these
73     basis vectors (through our choice of dimensionality reduction) we can find a lower dimensional 
74     space in which to represent the graph
75 
76     References
77     ----------
78     .. [1] Sussman, D.L., Tang, M., Fishkind, D.E., Priebe, C.E.  "A
79        Consistent Adjacency Spectral Embedding for Stochastic Blockmodel Graphs,"
80        Journal of the American Statistical Association, Vol. 107(499), 2012
81     """
82 
83     def __init__(
84             self,
85             form='DAD',
86             n_components=None,
87             n_elbows=2,
88             algorithm='randomized',
89             n_iter=5,
90     ):
91         super().__init__(
92             n_components=n_components,
93             n_elbows=n_elbows,
94             algorithm=algorithm,
95             n_iter=n_iter,
96         )
97         self.form = form
98 
99     def fit(self, graph):
100         """
101         Fit LSE model to input graph
102 
103         By default, uses the Laplacian normalization of the form:
104 
105         .. math:: L = D^{-1/2} A D^{-1/2}
106 
107         Parameters
108         ----------
109         graph : array_like or networkx.Graph
110             Input graph to embed. see graphstats.utils.import_graph
111 
112         form : {'DAD' (default), 'I-DAD'}, optional
113             Specifies the type of Laplacian normalization to use.
114 
115         Returns
116         -------
117         self : returns an instance of self.
118         """
119         A = import_graph(graph)
120 
121         if not is_fully_connected(A):
122             msg = """Input graph is not fully connected. Results may not \
123             be optimal. You can compute the largest connected component by \
124             using ``graspy.utils.get_lcc``."""
125             warnings.warn(msg, UserWarning)
126 
127         L_norm = to_laplace(A, form=self.form)
128         self._reduce_dim(L_norm)
129         return self
130
```

Path: `graspy/embed/ase.py`
Content:
```
1 # ase.py
2 # Created by Ben Pedigo on 2018-09-15.
3 # Email: bpedigo@jhu.edu
4 import warnings
5 
6 from .embed import BaseEmbed
7 from .svd import selectSVD
8 from ..utils import import_graph, get_lcc, is_fully_connected
9 
10 
11 class AdjacencySpectralEmbed(BaseEmbed):
12     r"""
13     Class for computing the adjacency spectral embedding of a graph 
14     
15     The adjacency spectral embedding (ASE) is a k-dimensional Euclidean representation of 
16     the graph based on its adjacency matrix [1]_. It relies on an SVD to reduce the dimensionality
17     to the specified k, or if k is unspecified, can find a number of dimensions automatically
18     (see graphstats.embed.svd.selectSVD).
19 
20     Parameters
21     ----------
22     n_components : int or None, default = None
23         Desired dimensionality of output data. If "full", 
24         n_components must be <= min(X.shape). Otherwise, n_components must be
25         < min(X.shape). If None, then optimal dimensions will be chosen by
26         ``select_dimension`` using ``n_elbows`` argument.
27     n_elbows : int, optional, default: 2
28         If `n_compoents=None`, then compute the optimal embedding dimension using
29         `select_dimension`. Otherwise, ignored.
30     algorithm : {'full', 'truncated' (default), 'randomized'}, optional
31         SVD solver to use:
32 
33         - 'full'
34             Computes full svd using ``scipy.linalg.svd``
35         - 'truncated'
36             Computes truncated svd using ``scipy.sparse.linalg.svd``
37         - 'randomized'
38             Computes randomized svd using 
39             ``sklearn.utils.extmath.randomized_svd``
40     n_iter : int, optional (default = 5)
41         Number of iterations for randomized SVD solver. Not used by 'full' or 
42         'truncated'. The default is larger than the default in randomized_svd 
43         to handle sparse matrices that may have large slowly decaying spectrum.
44     lcc : bool, optional (default=True)
45         If True, computes the largest connected component for the input graph.
46 
47     Attributes
48     ----------
49     latent_left_ : array, shape (n_samples, n_components)
50         Estimated left latent positions of the graph. 
51     latent_right_ : array, shape (n_samples, n_components), or None
52         Only computed when the graph is directed, or adjacency matrix is assymetric.
53         Estimated right latent positions of the graph. Otherwise, None.
54     singular_values_ : array, shape (n_components)
55         Singular values associated with the latent position matrices. 
56     indices_ : array, or None
57         If ``lcc`` is True, these are the indices of the vertices that were kept.
58 
59     See Also
60     --------
61     graspy.embed.selectSVD
62     graspy.embed.select_dimension
63 
64     Notes
65     -----
66     The singular value decomposition: 
67 
68     .. math:: A = U \Sigma V^T
69 
70     is used to find an orthonormal basis for a matrix, which in our case is the adjacency
71     matrix of the graph. These basis vectors (in the matrices U or V) are ordered according 
72     to the amount of variance they explain in the original matrix. By selecting a subset of these
73     basis vectors (through our choice of dimensionality reduction) we can find a lower dimensional 
74     space in which to represent the graph
75 
76     References
77     ----------
78     .. [1] Sussman, D.L., Tang, M., Fishkind, D.E., Priebe, C.E.  "A
79        Consistent Adjacency Spectral Embedding for Stochastic Blockmodel Graphs,"
80        Journal of the American Statistical Association, Vol. 107(499), 2012
81     """
82 
83     def __init__(
84             self,
85             n_components=None,
86             n_elbows=2,
87             algorithm='randomized',
88             n_iter=5,
89     ):
90         super().__init__(
91             n_components=n_components,
92             n_elbows=n_elbows,
93             algorithm=algorithm,
94             n_iter=n_iter,
95         )
96 
97     def fit(self, graph):
98         """
99         Fit ASE model to input graph
100 
101         Parameters
102         ----------
103         graph : array_like or networkx.Graph
104             input graph to embed. see graphstats.utils.import_graph
105 
106         Returns
107         -------
108         self : returns an instance of self.
109         """
110         A = import_graph(graph)
111 
112         if not is_fully_connected(A):
113             msg = """Input graph is not fully connected. Results may not \
114             be optimal. You can compute the largest connected component by \
115             using ``graspy.utils.get_lcc``."""
116             warnings.warn(msg, UserWarning)
117 
118         self._reduce_dim(A)
119         return self
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/graspy/embed/ase.py b/graspy/embed/ase.py
--- a/graspy/embed/ase.py
+++ b/graspy/embed/ase.py
@@ -41,8 +41,6 @@
         Number of iterations for randomized SVD solver. Not used by 'full' or 
         'truncated'. The default is larger than the default in randomized_svd 
         to handle sparse matrices that may have large slowly decaying spectrum.
-    lcc : bool, optional (default=True)
-        If True, computes the largest connected component for the input graph.
 
     Attributes
     ----------
diff --git a/graspy/embed/lse.py b/graspy/embed/lse.py
--- a/graspy/embed/lse.py
+++ b/graspy/embed/lse.py
@@ -40,8 +40,6 @@
         Number of iterations for randomized SVD solver. Not used by 'full' or 
         'truncated'. The default is larger than the default in randomized_svd 
         to handle sparse matrices that may have large slowly decaying spectrum.
-    lcc : bool, optional (default=True)
-        If True, computes the largest connected component for the input graph.
 
     Attributes
     ----------

{"golden_diff": "diff --git a/graspy/embed/ase.py b/graspy/embed/ase.py\n--- a/graspy/embed/ase.py\n+++ b/graspy/embed/ase.py\n@@ -41,8 +41,6 @@\n         Number of iterations for randomized SVD solver. Not used by 'full' or \n         'truncated'. The default is larger than the default in randomized_svd \n         to handle sparse matrices that may have large slowly decaying spectrum.\n-    lcc : bool, optional (default=True)\n-        If True, computes the largest connected component for the input graph.\n \n     Attributes\n     ----------\ndiff --git a/graspy/embed/lse.py b/graspy/embed/lse.py\n--- a/graspy/embed/lse.py\n+++ b/graspy/embed/lse.py\n@@ -40,8 +40,6 @@\n         Number of iterations for randomized SVD solver. Not used by 'full' or \n         'truncated'. The default is larger than the default in randomized_svd \n         to handle sparse matrices that may have large slowly decaying spectrum.\n-    lcc : bool, optional (default=True)\n-        If True, computes the largest connected component for the input graph.\n \n     Attributes\n     ----------\n", "issue": "Fix notebooks on netlify\nIssues with setting jupyter notebook kernels prevent them from running on netlify\n", "before_files": [{"content": "# ase.py\n# Created by Ben Pedigo on 2018-09-26.\n# Email: bpedigo@jhu.edu\nimport warnings\n\nfrom .embed import BaseEmbed\nfrom .svd import selectSVD\nfrom ..utils import import_graph, to_laplace, get_lcc, is_fully_connected\n\n\nclass LaplacianSpectralEmbed(BaseEmbed):\n    r\"\"\"\n    Class for computing the laplacian spectral embedding of a graph \n    \n    The laplacian spectral embedding (LSE) is a k-dimensional Euclidean representation of \n    the graph based on its Laplacian matrix [1]_. It relies on an SVD to reduce the dimensionality\n    to the specified k, or if k is unspecified, can find a number of dimensions automatically.\n\n    Parameters\n    ----------\n    n_components : int or None, default = None\n        Desired dimensionality of output data. If \"full\", \n        n_components must be <= min(X.shape). Otherwise, n_components must be\n        < min(X.shape). If None, then optimal dimensions will be chosen by\n        ``select_dimension`` using ``n_elbows`` argument.\n    n_elbows : int, optional, default: 2\n        If `n_compoents=None`, then compute the optimal embedding dimension using\n        `select_dimension`. Otherwise, ignored.\n    algorithm : {'full', 'truncated' (default), 'randomized'}, optional\n        SVD solver to use:\n\n        - 'full'\n            Computes full svd using ``scipy.linalg.svd``\n        - 'truncated'\n            Computes truncated svd using ``scipy.sparse.linalg.svd``\n        - 'randomized'\n            Computes randomized svd using \n            ``sklearn.utils.extmath.randomized_svd``\n    n_iter : int, optional (default = 5)\n        Number of iterations for randomized SVD solver. Not used by 'full' or \n        'truncated'. The default is larger than the default in randomized_svd \n        to handle sparse matrices that may have large slowly decaying spectrum.\n    lcc : bool, optional (default=True)\n        If True, computes the largest connected component for the input graph.\n\n    Attributes\n    ----------\n    latent_left_ : array, shape (n_samples, n_components)\n        Estimated left latent positions of the graph.\n    latent_right_ : array, shape (n_samples, n_components), or None\n        Only computed when the graph is directed, or adjacency matrix is assymetric.\n        Estimated right latent positions of the graph. Otherwise, None.\n    singular_values_ : array, shape (n_components)\n        Singular values associated with the latent position matrices.\n    indices_ : array, or None\n        If ``lcc`` is True, these are the indices of the vertices that were kept.\n\n    See Also\n    --------\n    graspy.embed.selectSVD\n    graspy.embed.select_dimension\n    graspy.utils.to_laplace\n\n    Notes\n    -----\n    The singular value decomposition: \n\n    .. math:: A = U \\Sigma V^T\n\n    is used to find an orthonormal basis for a matrix, which in our case is the Laplacian\n    matrix of the graph. These basis vectors (in the matrices U or V) are ordered according \n    to the amount of variance they explain in the original matrix. By selecting a subset of these\n    basis vectors (through our choice of dimensionality reduction) we can find a lower dimensional \n    space in which to represent the graph\n\n    References\n    ----------\n    .. [1] Sussman, D.L., Tang, M., Fishkind, D.E., Priebe, C.E.  \"A\n       Consistent Adjacency Spectral Embedding for Stochastic Blockmodel Graphs,\"\n       Journal of the American Statistical Association, Vol. 107(499), 2012\n    \"\"\"\n\n    def __init__(\n            self,\n            form='DAD',\n            n_components=None,\n            n_elbows=2,\n            algorithm='randomized',\n            n_iter=5,\n    ):\n        super().__init__(\n            n_components=n_components,\n            n_elbows=n_elbows,\n            algorithm=algorithm,\n            n_iter=n_iter,\n        )\n        self.form = form\n\n    def fit(self, graph):\n        \"\"\"\n        Fit LSE model to input graph\n\n        By default, uses the Laplacian normalization of the form:\n\n        .. math:: L = D^{-1/2} A D^{-1/2}\n\n        Parameters\n        ----------\n        graph : array_like or networkx.Graph\n            Input graph to embed. see graphstats.utils.import_graph\n\n        form : {'DAD' (default), 'I-DAD'}, optional\n            Specifies the type of Laplacian normalization to use.\n\n        Returns\n        -------\n        self : returns an instance of self.\n        \"\"\"\n        A = import_graph(graph)\n\n        if not is_fully_connected(A):\n            msg = \"\"\"Input graph is not fully connected. Results may not \\\n            be optimal. You can compute the largest connected component by \\\n            using ``graspy.utils.get_lcc``.\"\"\"\n            warnings.warn(msg, UserWarning)\n\n        L_norm = to_laplace(A, form=self.form)\n        self._reduce_dim(L_norm)\n        return self\n", "path": "graspy/embed/lse.py"}, {"content": "# ase.py\n# Created by Ben Pedigo on 2018-09-15.\n# Email: bpedigo@jhu.edu\nimport warnings\n\nfrom .embed import BaseEmbed\nfrom .svd import selectSVD\nfrom ..utils import import_graph, get_lcc, is_fully_connected\n\n\nclass AdjacencySpectralEmbed(BaseEmbed):\n    r\"\"\"\n    Class for computing the adjacency spectral embedding of a graph \n    \n    The adjacency spectral embedding (ASE) is a k-dimensional Euclidean representation of \n    the graph based on its adjacency matrix [1]_. It relies on an SVD to reduce the dimensionality\n    to the specified k, or if k is unspecified, can find a number of dimensions automatically\n    (see graphstats.embed.svd.selectSVD).\n\n    Parameters\n    ----------\n    n_components : int or None, default = None\n        Desired dimensionality of output data. If \"full\", \n        n_components must be <= min(X.shape). Otherwise, n_components must be\n        < min(X.shape). If None, then optimal dimensions will be chosen by\n        ``select_dimension`` using ``n_elbows`` argument.\n    n_elbows : int, optional, default: 2\n        If `n_compoents=None`, then compute the optimal embedding dimension using\n        `select_dimension`. Otherwise, ignored.\n    algorithm : {'full', 'truncated' (default), 'randomized'}, optional\n        SVD solver to use:\n\n        - 'full'\n            Computes full svd using ``scipy.linalg.svd``\n        - 'truncated'\n            Computes truncated svd using ``scipy.sparse.linalg.svd``\n        - 'randomized'\n            Computes randomized svd using \n            ``sklearn.utils.extmath.randomized_svd``\n    n_iter : int, optional (default = 5)\n        Number of iterations for randomized SVD solver. Not used by 'full' or \n        'truncated'. The default is larger than the default in randomized_svd \n        to handle sparse matrices that may have large slowly decaying spectrum.\n    lcc : bool, optional (default=True)\n        If True, computes the largest connected component for the input graph.\n\n    Attributes\n    ----------\n    latent_left_ : array, shape (n_samples, n_components)\n        Estimated left latent positions of the graph. \n    latent_right_ : array, shape (n_samples, n_components), or None\n        Only computed when the graph is directed, or adjacency matrix is assymetric.\n        Estimated right latent positions of the graph. Otherwise, None.\n    singular_values_ : array, shape (n_components)\n        Singular values associated with the latent position matrices. \n    indices_ : array, or None\n        If ``lcc`` is True, these are the indices of the vertices that were kept.\n\n    See Also\n    --------\n    graspy.embed.selectSVD\n    graspy.embed.select_dimension\n\n    Notes\n    -----\n    The singular value decomposition: \n\n    .. math:: A = U \\Sigma V^T\n\n    is used to find an orthonormal basis for a matrix, which in our case is the adjacency\n    matrix of the graph. These basis vectors (in the matrices U or V) are ordered according \n    to the amount of variance they explain in the original matrix. By selecting a subset of these\n    basis vectors (through our choice of dimensionality reduction) we can find a lower dimensional \n    space in which to represent the graph\n\n    References\n    ----------\n    .. [1] Sussman, D.L., Tang, M., Fishkind, D.E., Priebe, C.E.  \"A\n       Consistent Adjacency Spectral Embedding for Stochastic Blockmodel Graphs,\"\n       Journal of the American Statistical Association, Vol. 107(499), 2012\n    \"\"\"\n\n    def __init__(\n            self,\n            n_components=None,\n            n_elbows=2,\n            algorithm='randomized',\n            n_iter=5,\n    ):\n        super().__init__(\n            n_components=n_components,\n            n_elbows=n_elbows,\n            algorithm=algorithm,\n            n_iter=n_iter,\n        )\n\n    def fit(self, graph):\n        \"\"\"\n        Fit ASE model to input graph\n\n        Parameters\n        ----------\n        graph : array_like or networkx.Graph\n            input graph to embed. see graphstats.utils.import_graph\n\n        Returns\n        -------\n        self : returns an instance of self.\n        \"\"\"\n        A = import_graph(graph)\n\n        if not is_fully_connected(A):\n            msg = \"\"\"Input graph is not fully connected. Results may not \\\n            be optimal. You can compute the largest connected component by \\\n            using ``graspy.utils.get_lcc``.\"\"\"\n            warnings.warn(msg, UserWarning)\n\n        self._reduce_dim(A)\n        return self", "path": "graspy/embed/ase.py"}], "after_files": [{"content": "# ase.py\n# Created by Ben Pedigo on 2018-09-26.\n# Email: bpedigo@jhu.edu\nimport warnings\n\nfrom .embed import BaseEmbed\nfrom .svd import selectSVD\nfrom ..utils import import_graph, to_laplace, get_lcc, is_fully_connected\n\n\nclass LaplacianSpectralEmbed(BaseEmbed):\n    r\"\"\"\n    Class for computing the laplacian spectral embedding of a graph \n    \n    The laplacian spectral embedding (LSE) is a k-dimensional Euclidean representation of \n    the graph based on its Laplacian matrix [1]_. It relies on an SVD to reduce the dimensionality\n    to the specified k, or if k is unspecified, can find a number of dimensions automatically.\n\n    Parameters\n    ----------\n    n_components : int or None, default = None\n        Desired dimensionality of output data. If \"full\", \n        n_components must be <= min(X.shape). Otherwise, n_components must be\n        < min(X.shape). If None, then optimal dimensions will be chosen by\n        ``select_dimension`` using ``n_elbows`` argument.\n    n_elbows : int, optional, default: 2\n        If `n_compoents=None`, then compute the optimal embedding dimension using\n        `select_dimension`. Otherwise, ignored.\n    algorithm : {'full', 'truncated' (default), 'randomized'}, optional\n        SVD solver to use:\n\n        - 'full'\n            Computes full svd using ``scipy.linalg.svd``\n        - 'truncated'\n            Computes truncated svd using ``scipy.sparse.linalg.svd``\n        - 'randomized'\n            Computes randomized svd using \n            ``sklearn.utils.extmath.randomized_svd``\n    n_iter : int, optional (default = 5)\n        Number of iterations for randomized SVD solver. Not used by 'full' or \n        'truncated'. The default is larger than the default in randomized_svd \n        to handle sparse matrices that may have large slowly decaying spectrum.\n\n    Attributes\n    ----------\n    latent_left_ : array, shape (n_samples, n_components)\n        Estimated left latent positions of the graph.\n    latent_right_ : array, shape (n_samples, n_components), or None\n        Only computed when the graph is directed, or adjacency matrix is assymetric.\n        Estimated right latent positions of the graph. Otherwise, None.\n    singular_values_ : array, shape (n_components)\n        Singular values associated with the latent position matrices.\n    indices_ : array, or None\n        If ``lcc`` is True, these are the indices of the vertices that were kept.\n\n    See Also\n    --------\n    graspy.embed.selectSVD\n    graspy.embed.select_dimension\n    graspy.utils.to_laplace\n\n    Notes\n    -----\n    The singular value decomposition: \n\n    .. math:: A = U \\Sigma V^T\n\n    is used to find an orthonormal basis for a matrix, which in our case is the Laplacian\n    matrix of the graph. These basis vectors (in the matrices U or V) are ordered according \n    to the amount of variance they explain in the original matrix. By selecting a subset of these\n    basis vectors (through our choice of dimensionality reduction) we can find a lower dimensional \n    space in which to represent the graph\n\n    References\n    ----------\n    .. [1] Sussman, D.L., Tang, M., Fishkind, D.E., Priebe, C.E.  \"A\n       Consistent Adjacency Spectral Embedding for Stochastic Blockmodel Graphs,\"\n       Journal of the American Statistical Association, Vol. 107(499), 2012\n    \"\"\"\n\n    def __init__(\n            self,\n            form='DAD',\n            n_components=None,\n            n_elbows=2,\n            algorithm='randomized',\n            n_iter=5,\n    ):\n        super().__init__(\n            n_components=n_components,\n            n_elbows=n_elbows,\n            algorithm=algorithm,\n            n_iter=n_iter,\n        )\n        self.form = form\n\n    def fit(self, graph):\n        \"\"\"\n        Fit LSE model to input graph\n\n        By default, uses the Laplacian normalization of the form:\n\n        .. math:: L = D^{-1/2} A D^{-1/2}\n\n        Parameters\n        ----------\n        graph : array_like or networkx.Graph\n            Input graph to embed. see graphstats.utils.import_graph\n\n        form : {'DAD' (default), 'I-DAD'}, optional\n            Specifies the type of Laplacian normalization to use.\n\n        Returns\n        -------\n        self : returns an instance of self.\n        \"\"\"\n        A = import_graph(graph)\n\n        if not is_fully_connected(A):\n            msg = \"\"\"Input graph is not fully connected. Results may not \\\n            be optimal. You can compute the largest connected component by \\\n            using ``graspy.utils.get_lcc``.\"\"\"\n            warnings.warn(msg, UserWarning)\n\n        L_norm = to_laplace(A, form=self.form)\n        self._reduce_dim(L_norm)\n        return self\n", "path": "graspy/embed/lse.py"}, {"content": "# ase.py\n# Created by Ben Pedigo on 2018-09-15.\n# Email: bpedigo@jhu.edu\nimport warnings\n\nfrom .embed import BaseEmbed\nfrom .svd import selectSVD\nfrom ..utils import import_graph, get_lcc, is_fully_connected\n\n\nclass AdjacencySpectralEmbed(BaseEmbed):\n    r\"\"\"\n    Class for computing the adjacency spectral embedding of a graph \n    \n    The adjacency spectral embedding (ASE) is a k-dimensional Euclidean representation of \n    the graph based on its adjacency matrix [1]_. It relies on an SVD to reduce the dimensionality\n    to the specified k, or if k is unspecified, can find a number of dimensions automatically\n    (see graphstats.embed.svd.selectSVD).\n\n    Parameters\n    ----------\n    n_components : int or None, default = None\n        Desired dimensionality of output data. If \"full\", \n        n_components must be <= min(X.shape). Otherwise, n_components must be\n        < min(X.shape). If None, then optimal dimensions will be chosen by\n        ``select_dimension`` using ``n_elbows`` argument.\n    n_elbows : int, optional, default: 2\n        If `n_compoents=None`, then compute the optimal embedding dimension using\n        `select_dimension`. Otherwise, ignored.\n    algorithm : {'full', 'truncated' (default), 'randomized'}, optional\n        SVD solver to use:\n\n        - 'full'\n            Computes full svd using ``scipy.linalg.svd``\n        - 'truncated'\n            Computes truncated svd using ``scipy.sparse.linalg.svd``\n        - 'randomized'\n            Computes randomized svd using \n            ``sklearn.utils.extmath.randomized_svd``\n    n_iter : int, optional (default = 5)\n        Number of iterations for randomized SVD solver. Not used by 'full' or \n        'truncated'. The default is larger than the default in randomized_svd \n        to handle sparse matrices that may have large slowly decaying spectrum.\n\n    Attributes\n    ----------\n    latent_left_ : array, shape (n_samples, n_components)\n        Estimated left latent positions of the graph. \n    latent_right_ : array, shape (n_samples, n_components), or None\n        Only computed when the graph is directed, or adjacency matrix is assymetric.\n        Estimated right latent positions of the graph. Otherwise, None.\n    singular_values_ : array, shape (n_components)\n        Singular values associated with the latent position matrices. \n    indices_ : array, or None\n        If ``lcc`` is True, these are the indices of the vertices that were kept.\n\n    See Also\n    --------\n    graspy.embed.selectSVD\n    graspy.embed.select_dimension\n\n    Notes\n    -----\n    The singular value decomposition: \n\n    .. math:: A = U \\Sigma V^T\n\n    is used to find an orthonormal basis for a matrix, which in our case is the adjacency\n    matrix of the graph. These basis vectors (in the matrices U or V) are ordered according \n    to the amount of variance they explain in the original matrix. By selecting a subset of these\n    basis vectors (through our choice of dimensionality reduction) we can find a lower dimensional \n    space in which to represent the graph\n\n    References\n    ----------\n    .. [1] Sussman, D.L., Tang, M., Fishkind, D.E., Priebe, C.E.  \"A\n       Consistent Adjacency Spectral Embedding for Stochastic Blockmodel Graphs,\"\n       Journal of the American Statistical Association, Vol. 107(499), 2012\n    \"\"\"\n\n    def __init__(\n            self,\n            n_components=None,\n            n_elbows=2,\n            algorithm='randomized',\n            n_iter=5,\n    ):\n        super().__init__(\n            n_components=n_components,\n            n_elbows=n_elbows,\n            algorithm=algorithm,\n            n_iter=n_iter,\n        )\n\n    def fit(self, graph):\n        \"\"\"\n        Fit ASE model to input graph\n\n        Parameters\n        ----------\n        graph : array_like or networkx.Graph\n            input graph to embed. see graphstats.utils.import_graph\n\n        Returns\n        -------\n        self : returns an instance of self.\n        \"\"\"\n        A = import_graph(graph)\n\n        if not is_fully_connected(A):\n            msg = \"\"\"Input graph is not fully connected. Results may not \\\n            be optimal. You can compute the largest connected component by \\\n            using ``graspy.utils.get_lcc``.\"\"\"\n            warnings.warn(msg, UserWarning)\n\n        self._reduce_dim(A)\n        return self", "path": "graspy/embed/ase.py"}]}