From a2932de3221c69bc3a1f6064d8cefc2c6f2fef68 Mon Sep 17 00:00:00 2001 From: Amanda Dsouza Date: Sun, 7 Jun 2020 01:51:49 +0530 Subject: [PATCH 1/3] Standardize formatting for default values --- sklearn/mixture/_bayesian_mixture.py | 34 ++++++++++++++-------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/sklearn/mixture/_bayesian_mixture.py b/sklearn/mixture/_bayesian_mixture.py index 70f70dc1f854b..60e2adbb7929d 100644 --- a/sklearn/mixture/_bayesian_mixture.py +++ b/sklearn/mixture/_bayesian_mixture.py @@ -82,14 +82,14 @@ class BayesianGaussianMixture(BaseMixture): Parameters ---------- - n_components : int, defaults to 1. + n_components : int, defaults=1. The number of mixture components. Depending on the data and the value of the `weight_concentration_prior` the model can decide to not use all the components by setting some component `weights_` to values very close to zero. The number of effective components is therefore smaller than n_components. - covariance_type : {'full', 'tied', 'diag', 'spherical'}, defaults to 'full' + covariance_type : {'full', 'tied', 'diag', 'spherical'}, default='full' String describing the type of covariance parameters to use. Must be one of:: @@ -98,23 +98,23 @@ class BayesianGaussianMixture(BaseMixture): 'diag' (each component has its own diagonal covariance matrix), 'spherical' (each component has its own single variance). - tol : float, defaults to 1e-3. + tol : float, defaults=1e-3. The convergence threshold. EM iterations will stop when the lower bound average gain on the likelihood (of the training data with respect to the model) is below this threshold. - reg_covar : float, defaults to 1e-6. + reg_covar : float, defaults=1e-6. Non-negative regularization added to the diagonal of covariance. Allows to assure that the covariance matrices are all positive. - max_iter : int, defaults to 100. + max_iter : int, defaults=100. The number of EM iterations to perform. - n_init : int, defaults to 1. + n_init : int, defaults=1. The number of initializations to perform. The result with the highest lower bound value on the likelihood is kept. - init_params : {'kmeans', 'random'}, defaults to 'kmeans'. + init_params : {'kmeans', 'random'}, defaults='kmeans'. The method used to initialize the weights, the means and the covariances. Must be one of:: @@ -122,14 +122,14 @@ class BayesianGaussianMixture(BaseMixture): 'kmeans' : responsibilities are initialized using kmeans. 'random' : responsibilities are initialized randomly. - weight_concentration_prior_type : str, defaults to 'dirichlet_process'. + weight_concentration_prior_type : str, defaults='dirichlet_process'. String describing the type of the weight concentration prior. Must be one of:: 'dirichlet_process' (using the Stick-breaking representation), 'dirichlet_distribution' (can favor more uniform weights). - weight_concentration_prior : float | None, optional. + weight_concentration_prior : float | None, default=None. The dirichlet concentration of each component on the weight distribution (Dirichlet). This is commonly called gamma in the literature. The higher concentration puts more mass in @@ -138,22 +138,22 @@ class BayesianGaussianMixture(BaseMixture): mixture weights simplex. The value of the parameter must be greater than 0. If it is None, it's set to ``1. / n_components``. - mean_precision_prior : float | None, optional. + mean_precision_prior : float | None, default=None. The precision prior on the mean distribution (Gaussian). Controls the extent of where means can be placed. Larger values concentrate the cluster means around `mean_prior`. The value of the parameter must be greater than 0. If it is None, it is set to 1. - mean_prior : array-like, shape (n_features,), optional + mean_prior : array-like, shape (n_features,), default=None. The prior on the mean distribution (Gaussian). If it is None, it is set to the mean of X. - degrees_of_freedom_prior : float | None, optional. + degrees_of_freedom_prior : float | None, default=None. The prior of the number of degrees of freedom on the covariance distributions (Wishart). If it is None, it's set to `n_features`. - covariance_prior : float or array-like, optional + covariance_prior : float or array-like, default=None. The prior on the covariance distribution (Wishart). If it is None, the emiprical covariance prior is initialized using the covariance of X. The shape depends on `covariance_type`:: @@ -163,7 +163,7 @@ class BayesianGaussianMixture(BaseMixture): (n_features) if 'diag', float if 'spherical' - random_state : int, RandomState instance or None, optional (default=None) + random_state : int, RandomState instance or None, default=None. Controls the random seed given to the method chosen to initialize the parameters (see `init_params`). In addition, it controls the generation of random samples from the @@ -171,19 +171,19 @@ class BayesianGaussianMixture(BaseMixture): Pass an int for reproducible output across multiple function calls. See :term:`Glossary `. - warm_start : bool, default to False. + warm_start : bool, default=False. If 'warm_start' is True, the solution of the last fitting is used as initialization for the next call of fit(). This can speed up convergence when fit is called several times on similar problems. See :term:`the Glossary `. - verbose : int, default to 0. + verbose : int, default=0. Enable verbose output. If 1 then it prints the current initialization and each iteration step. If greater than 1 then it prints also the log probability and the time needed for each step. - verbose_interval : int, default to 10. + verbose_interval : int, default=10. Number of iteration done before the next print. Attributes From 5a380778098401738ec0eb7f8d2e83283eddcf75 Mon Sep 17 00:00:00 2001 From: Amanda Dsouza Date: Sun, 7 Jun 2020 02:22:20 +0530 Subject: [PATCH 2/3] DOC_Standardize formatting for default values --- sklearn/manifold/_t_sne.py | 48 +++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/sklearn/manifold/_t_sne.py b/sklearn/manifold/_t_sne.py index 1abed4ab9fa3c..54b0a9fabf52c 100644 --- a/sklearn/manifold/_t_sne.py +++ b/sklearn/manifold/_t_sne.py @@ -293,39 +293,39 @@ def _gradient_descent(objective, p0, it, n_iter, n_iter : int Maximum number of gradient descent iterations. - n_iter_check : int + n_iter_check : int, default=1 Number of iterations before evaluating the global error. If the error is sufficiently low, we abort the optimization. - n_iter_without_progress : int, optional (default: 300) + n_iter_without_progress : int, default=300 Maximum number of iterations without progress before we abort the optimization. - momentum : float, within (0.0, 1.0), optional (default: 0.8) + momentum : float, within (0.0, 1.0), default=0.8 The momentum generates a weight for previous gradients that decays exponentially. - learning_rate : float, optional (default: 200.0) + learning_rate : float, default=200.0 The learning rate for t-SNE is usually in the range [10.0, 1000.0]. If the learning rate is too high, the data may look like a 'ball' with any point approximately equidistant from its nearest neighbours. If the learning rate is too low, most points may look compressed in a dense cloud with few outliers. - min_gain : float, optional (default: 0.01) + min_gain : float, default=0.01 Minimum individual gain for each parameter. - min_grad_norm : float, optional (default: 1e-7) + min_grad_norm : float, default=1e-7 If the gradient norm is below this threshold, the optimization will be aborted. - verbose : int, optional (default: 0) + verbose : int, default=0 Verbosity level. - args : sequence + args : sequence, default=None Arguments to pass to objective function. - kwargs : dict + kwargs : dict, default=None Keyword arguments to pass to objective function. Returns @@ -430,10 +430,10 @@ def trustworthiness(X, X_embedded, *, n_neighbors=5, metric='euclidean'): X_embedded : array, shape (n_samples, n_components) Embedding of the training data in low-dimensional space. - n_neighbors : int, optional (default: 5) + n_neighbors : int, default=5 Number of neighbors k that will be considered. - metric : string, or callable, optional, default 'euclidean' + metric : string, or callable, default='euclidean' Which metric to use for computing pairwise distances between samples from the original input space. If metric is 'precomputed', X must be a matrix of pairwise distances or squared distances. Otherwise, see the @@ -495,17 +495,17 @@ class TSNE(BaseEstimator): Parameters ---------- - n_components : int, optional (default: 2) + n_components : int, default=2 Dimension of the embedded space. - perplexity : float, optional (default: 30) + perplexity : float, default=30 The perplexity is related to the number of nearest neighbors that is used in other manifold learning algorithms. Larger datasets usually require a larger perplexity. Consider selecting a value between 5 and 50. Different values can result in significanlty different results. - early_exaggeration : float, optional (default: 12.0) + early_exaggeration : float, default=12.0 Controls how tight natural clusters in the original space are in the embedded space and how much space will be between them. For larger values, the space between natural clusters will be larger @@ -514,7 +514,7 @@ class TSNE(BaseEstimator): optimization, the early exaggeration factor or the learning rate might be too high. - learning_rate : float, optional (default: 200.0) + learning_rate : float, default=200.0 The learning rate for t-SNE is usually in the range [10.0, 1000.0]. If the learning rate is too high, the data may look like a 'ball' with any point approximately equidistant from its nearest neighbours. If the @@ -522,11 +522,11 @@ class TSNE(BaseEstimator): cloud with few outliers. If the cost function gets stuck in a bad local minimum increasing the learning rate may help. - n_iter : int, optional (default: 1000) + n_iter : int, default=1000 Maximum number of iterations for the optimization. Should be at least 250. - n_iter_without_progress : int, optional (default: 300) + n_iter_without_progress : int, default=300 Maximum number of iterations without progress before we abort the optimization, used after 250 initial iterations with early exaggeration. Note that progress is only checked every 50 iterations so @@ -535,11 +535,11 @@ class TSNE(BaseEstimator): .. versionadded:: 0.17 parameter *n_iter_without_progress* to control stopping criteria. - min_grad_norm : float, optional (default: 1e-7) + min_grad_norm : float, default=1e-7 If the gradient norm is below this threshold, the optimization will be stopped. - metric : string or callable, optional + metric : string or callable, default='euclidean' The metric to use when calculating distance between instances in a feature array. If metric is a string, it must be one of the options allowed by scipy.spatial.distance.pdist for its metric parameter, or @@ -551,13 +551,13 @@ class TSNE(BaseEstimator): the distance between them. The default is "euclidean" which is interpreted as squared euclidean distance. - init : string or numpy array, optional (default: "random") + init : string or numpy array, default="random" Initialization of embedding. Possible options are 'random', 'pca', and a numpy array of shape (n_samples, n_components). PCA initialization cannot be used with precomputed distances and is usually more globally stable than random initialization. - verbose : int, optional (default: 0) + verbose : int, default=0 Verbosity level. random_state : int, RandomState instance, default=None @@ -566,7 +566,7 @@ class TSNE(BaseEstimator): initializations might result in different local minima of the cost function. See :term: `Glossary `. - method : string (default: 'barnes_hut') + method : string, default='barnes_hut' By default the gradient calculation algorithm uses Barnes-Hut approximation running in O(NlogN) time. method='exact' will run on the slower, but exact, algorithm in O(N^2) time. The @@ -577,7 +577,7 @@ class TSNE(BaseEstimator): .. versionadded:: 0.17 Approximate optimization *method* via the Barnes-Hut. - angle : float (default: 0.5) + angle : float, default=0.5 Only used if method='barnes_hut' This is the trade-off between speed and accuracy for Barnes-Hut T-SNE. 'angle' is the angular size (referred to as theta in [3]) of a distant @@ -587,7 +587,7 @@ class TSNE(BaseEstimator): in the range of 0.2 - 0.8. Angle less than 0.2 has quickly increasing computation time and angle greater 0.8 has quickly increasing error. - n_jobs : int or None, optional (default=None) + n_jobs : int or None, default=None The number of parallel jobs to run for neighbors search. This parameter has no impact when ``metric="precomputed"`` or (``metric="euclidean"`` and ``method="exact"``). From 917b32bb93f19f5f2cada40d19e83ed83e56cf3c Mon Sep 17 00:00:00 2001 From: Amanda Dsouza Date: Sun, 7 Jun 2020 09:55:14 +0530 Subject: [PATCH 3/3] Standardized formatting for default values in manifold --- sklearn/manifold/_isomap.py | 14 ++++---- sklearn/manifold/_locally_linear.py | 48 ++++++++++++------------- sklearn/manifold/_mds.py | 44 +++++++++++------------ sklearn/manifold/_spectral_embedding.py | 20 +++++------ 4 files changed, 63 insertions(+), 63 deletions(-) diff --git a/sklearn/manifold/_isomap.py b/sklearn/manifold/_isomap.py index 1a9ac3862e26c..36c6b8c6ccba2 100644 --- a/sklearn/manifold/_isomap.py +++ b/sklearn/manifold/_isomap.py @@ -22,13 +22,13 @@ class Isomap(TransformerMixin, BaseEstimator): Parameters ---------- - n_neighbors : integer + n_neighbors : integer, default=5 number of neighbors to consider for each point. - n_components : integer + n_components : integer, default=2 number of coordinates for the manifold - eigen_solver : ['auto'|'arpack'|'dense'] + eigen_solver : ['auto'|'arpack'|'dense'], default='auto' 'auto' : Attempt to choose the most efficient solver for the given problem. @@ -38,15 +38,15 @@ class Isomap(TransformerMixin, BaseEstimator): 'dense' : Use a direct solver (i.e. LAPACK) for the eigenvalue decomposition. - tol : float + tol : float, default=0 Convergence tolerance passed to arpack or lobpcg. not used if eigen_solver == 'dense'. - max_iter : integer + max_iter : integer, default=None Maximum number of iterations for the arpack solver. not used if eigen_solver == 'dense'. - path_method : string ['auto'|'FW'|'D'] + path_method : string ['auto'|'FW'|'D'], default='auto' Method to use in finding shortest path. 'auto' : attempt to choose the best algorithm automatically. @@ -55,7 +55,7 @@ class Isomap(TransformerMixin, BaseEstimator): 'D' : Dijkstra's algorithm. - neighbors_algorithm : string ['auto'|'brute'|'kd_tree'|'ball_tree'] + neighbors_algorithm : string ['auto'|'brute'|'kd_tree'|'ball_tree'], default='auto' Algorithm to use for nearest neighbors search, passed to neighbors.NearestNeighbors instance. diff --git a/sklearn/manifold/_locally_linear.py b/sklearn/manifold/_locally_linear.py index a1db0c43daccb..575d9264c8628 100644 --- a/sklearn/manifold/_locally_linear.py +++ b/sklearn/manifold/_locally_linear.py @@ -30,7 +30,7 @@ def barycenter_weights(X, Z, reg=1e-3): Z : array-like, shape (n_samples, n_neighbors, n_dim) - reg : float, optional + reg : float, default=1e-3 amount of regularization to add for the problem to be well-posed in the case of n_neighbors > n_dim @@ -121,10 +121,10 @@ def null_space(M, k, k_skip=1, eigen_solver='arpack', tol=1E-6, max_iter=100, k : integer Number of eigenvalues/vectors to return - k_skip : integer, optional + k_skip : integer, default=1 Number of low eigenvalues to skip. - eigen_solver : string, {'auto', 'arpack', 'dense'} + eigen_solver : string, {'auto', 'arpack', 'dense'}, default='arpack' auto : algorithm will attempt to choose the best method for input data arpack : use arnoldi iteration in shift-invert mode. For this method, M may be a dense matrix, sparse matrix, @@ -136,11 +136,11 @@ def null_space(M, k, k_skip=1, eigen_solver='arpack', tol=1E-6, max_iter=100, or matrix type. This method should be avoided for large problems. - tol : float, optional + tol : float, default=1e-6 Tolerance for 'arpack' method. Not used if eigen_solver=='dense'. - max_iter : int + max_iter : int, default=100 Maximum number of iterations for 'arpack' method. Not used if eigen_solver=='dense' @@ -205,11 +205,11 @@ def locally_linear_embedding( n_components : integer number of coordinates for the manifold. - reg : float + reg : float, default=1e-3 regularization constant, multiplies the trace of the local covariance matrix of the distances. - eigen_solver : string, {'auto', 'arpack', 'dense'} + eigen_solver : string, {'auto', 'arpack', 'dense'}, default='auto' auto : algorithm will attempt to choose the best method for input data arpack : use arnoldi iteration in shift-invert mode. @@ -223,14 +223,14 @@ def locally_linear_embedding( or matrix type. This method should be avoided for large problems. - tol : float, optional + tol : float, default=1e-6 Tolerance for 'arpack' method Not used if eigen_solver=='dense'. - max_iter : integer + max_iter : integer, default=100 maximum number of iterations for the arpack solver. - method : {'standard', 'hessian', 'modified', 'ltsa'} + method : {'standard', 'hessian', 'modified', 'ltsa'}, default='standard' standard : use the standard locally linear embedding algorithm. see reference [1]_ hessian : use the Hessian eigenmap method. This method requires @@ -241,11 +241,11 @@ def locally_linear_embedding( ltsa : use local tangent space alignment algorithm see reference [4]_ - hessian_tol : float, optional + hessian_tol : float, default=1e-4 Tolerance for Hessian eigenmapping method. Only used if method == 'hessian' - modified_tol : float, optional + modified_tol : float, default=1e-12 Tolerance for modified LLE method. Only used if method == 'modified' @@ -254,7 +254,7 @@ def locally_linear_embedding( Pass an int for reproducible results across multiple function calls. See :term: `Glossary `. - n_jobs : int or None, optional (default=None) + n_jobs : int or None, default=None The number of parallel jobs to run for neighbors search. ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` @@ -525,17 +525,17 @@ class LocallyLinearEmbedding(TransformerMixin, Parameters ---------- - n_neighbors : integer + n_neighbors : integer, default=5 number of neighbors to consider for each point. - n_components : integer + n_components : integer, default=2 number of coordinates for the manifold - reg : float + reg : float, default=1e-3 regularization constant, multiplies the trace of the local covariance matrix of the distances. - eigen_solver : string, {'auto', 'arpack', 'dense'} + eigen_solver : string, {'auto', 'arpack', 'dense'}, default='auto' auto : algorithm will attempt to choose the best method for input data arpack : use arnoldi iteration in shift-invert mode. @@ -549,15 +549,15 @@ class LocallyLinearEmbedding(TransformerMixin, or matrix type. This method should be avoided for large problems. - tol : float, optional + tol : float, default=1e-6 Tolerance for 'arpack' method Not used if eigen_solver=='dense'. - max_iter : integer + max_iter : integer, default=100 maximum number of iterations for the arpack solver. Not used if eigen_solver=='dense'. - method : string ('standard', 'hessian', 'modified' or 'ltsa') + method : string ('standard', 'hessian', 'modified' or 'ltsa'), default='standard' standard : use the standard locally linear embedding algorithm. see reference [1] hessian : use the Hessian eigenmap method. This method requires @@ -568,15 +568,15 @@ class LocallyLinearEmbedding(TransformerMixin, ltsa : use local tangent space alignment algorithm see reference [4] - hessian_tol : float, optional + hessian_tol : float, default=1e-4 Tolerance for Hessian eigenmapping method. Only used if ``method == 'hessian'`` - modified_tol : float, optional + modified_tol : float, default=1e-12 Tolerance for modified LLE method. Only used if ``method == 'modified'`` - neighbors_algorithm : string ['auto'|'brute'|'kd_tree'|'ball_tree'] + neighbors_algorithm : string ['auto'|'brute'|'kd_tree'|'ball_tree'], default='auto' algorithm to use for nearest neighbors search, passed to neighbors.NearestNeighbors instance @@ -585,7 +585,7 @@ class LocallyLinearEmbedding(TransformerMixin, ``eigen_solver`` == 'arpack'. Pass an int for reproducible results across multiple function calls. See :term: `Glossary `. - n_jobs : int or None, optional (default=None) + n_jobs : int or None, default=None The number of parallel jobs to run. ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` diff --git a/sklearn/manifold/_mds.py b/sklearn/manifold/_mds.py index 0314007264689..e30cc128b18f3 100644 --- a/sklearn/manifold/_mds.py +++ b/sklearn/manifold/_mds.py @@ -26,26 +26,26 @@ def _smacof_single(dissimilarities, metric=True, n_components=2, init=None, dissimilarities : ndarray, shape (n_samples, n_samples) Pairwise dissimilarities between the points. Must be symmetric. - metric : boolean, optional, default: True + metric : boolean, default=True Compute metric or nonmetric SMACOF algorithm. - n_components : int, optional, default: 2 + n_components : int, default=2 Number of dimensions in which to immerse the dissimilarities. If an ``init`` array is provided, this option is overridden and the shape of ``init`` is used to determine the dimensionality of the embedding space. - init : ndarray, shape (n_samples, n_components), optional, default: None + init : ndarray, shape (n_samples, n_components), default=None Starting configuration of the embedding to initialize the algorithm. By default, the algorithm is initialized with a randomly chosen array. - max_iter : int, optional, default: 300 + max_iter : int, default=300 Maximum number of iterations of the SMACOF algorithm for a single run. - verbose : int, optional, default: 0 + verbose : int, default=0 Level of verbosity. - eps : float, optional, default: 1e-3 + eps : float, default=1e-3 Relative tolerance with respect to stress at which to declare convergence. @@ -158,26 +158,26 @@ def smacof(dissimilarities, *, metric=True, n_components=2, init=None, dissimilarities : ndarray, shape (n_samples, n_samples) Pairwise dissimilarities between the points. Must be symmetric. - metric : boolean, optional, default: True + metric : boolean, default=True Compute metric or nonmetric SMACOF algorithm. - n_components : int, optional, default: 2 + n_components : int, default=2 Number of dimensions in which to immerse the dissimilarities. If an ``init`` array is provided, this option is overridden and the shape of ``init`` is used to determine the dimensionality of the embedding space. - init : ndarray, shape (n_samples, n_components), optional, default: None + init : ndarray, shape (n_samples, n_components), default=None Starting configuration of the embedding to initialize the algorithm. By default, the algorithm is initialized with a randomly chosen array. - n_init : int, optional, default: 8 + n_init : int, default=8 Number of times the SMACOF algorithm will be run with different initializations. The final results will be the best output of the runs, determined by the run with the smallest final stress. If ``init`` is provided, this option is overridden and a single run is performed. - n_jobs : int or None, optional (default=None) + n_jobs : int or None, default=None The number of jobs to use for the computation. If multiple initializations are used (``n_init``), each run of the algorithm is computed in parallel. @@ -189,10 +189,10 @@ def smacof(dissimilarities, *, metric=True, n_components=2, init=None, max_iter : int, optional, default: 300 Maximum number of iterations of the SMACOF algorithm for a single run. - verbose : int, optional, default: 0 + verbose : int, default=0 Level of verbosity. - eps : float, optional, default: 1e-3 + eps : float, default=1e-3 Relative tolerance with respect to stress at which to declare convergence. @@ -201,7 +201,7 @@ def smacof(dissimilarities, *, metric=True, n_components=2, init=None, Pass an int for reproducible results across multiple function calls. See :term: `Glossary `. - return_n_iter : bool, optional, default: False + return_n_iter : bool, default=False Whether or not to return the number of iterations. Returns @@ -281,28 +281,28 @@ class MDS(BaseEstimator): Parameters ---------- - n_components : int, optional, default: 2 + n_components : int, default=2 Number of dimensions in which to immerse the dissimilarities. - metric : boolean, optional, default: True + metric : boolean, default=True If ``True``, perform metric MDS; otherwise, perform nonmetric MDS. - n_init : int, optional, default: 4 + n_init : int, default=4 Number of times the SMACOF algorithm will be run with different initializations. The final results will be the best output of the runs, determined by the run with the smallest final stress. - max_iter : int, optional, default: 300 + max_iter : int, default=300 Maximum number of iterations of the SMACOF algorithm for a single run. - verbose : int, optional, default: 0 + verbose : int, default=0 Level of verbosity. - eps : float, optional, default: 1e-3 + eps : float, default=1e-3 Relative tolerance with respect to stress at which to declare convergence. - n_jobs : int or None, optional (default=None) + n_jobs : int or None, default=None The number of jobs to use for the computation. If multiple initializations are used (``n_init``), each run of the algorithm is computed in parallel. @@ -316,7 +316,7 @@ class MDS(BaseEstimator): Pass an int for reproducible results across multiple function calls. See :term: `Glossary `. - dissimilarity : 'euclidean' | 'precomputed', optional, default: 'euclidean' + dissimilarity : 'euclidean' | 'precomputed', default='euclidean' Dissimilarity measure to use: - 'euclidean': diff --git a/sklearn/manifold/_spectral_embedding.py b/sklearn/manifold/_spectral_embedding.py index a42c97bb5d6b4..727d919651e04 100644 --- a/sklearn/manifold/_spectral_embedding.py +++ b/sklearn/manifold/_spectral_embedding.py @@ -162,10 +162,10 @@ def spectral_embedding(adjacency, *, n_components=8, eigen_solver=None, adjacency : array-like or sparse graph, shape: (n_samples, n_samples) The adjacency matrix of the graph to embed. - n_components : integer, optional, default 8 + n_components : integer, default=8 The dimension of the projection subspace. - eigen_solver : {None, 'arpack', 'lobpcg', or 'amg'}, default None + eigen_solver : {None, 'arpack', 'lobpcg', or 'amg'}, default=None The eigenvalue decomposition strategy to use. AMG requires pyamg to be installed. It can be faster on very large, sparse problems, but may also lead to instabilities. @@ -176,14 +176,14 @@ def spectral_embedding(adjacency, *, n_components=8, eigen_solver=None, an int for reproducible results across multiple function calls. See :term: `Glossary `. - eigen_tol : float, optional, default=0.0 + eigen_tol : float, default=0.0 Stopping criterion for eigendecomposition of the Laplacian matrix when using arpack eigen_solver. - norm_laplacian : bool, optional, default=True + norm_laplacian : bool, default=True If True, then compute normalized Laplacian. - drop_first : bool, optional, default=True + drop_first : bool, default=True Whether to drop the first eigenvector. For spectral embedding, this should be True as the first eigenvector should be constant vector for connected graph, but for spectral clustering, this should be kept as @@ -368,7 +368,7 @@ class SpectralEmbedding(BaseEstimator): n_components : integer, default: 2 The dimension of the projected subspace. - affinity : string or callable, default : "nearest_neighbors" + affinity : string or callable, default="nearest_neighbors" How to construct the affinity matrix. - 'nearest_neighbors' : construct the affinity matrix by computing a graph of nearest neighbors. @@ -382,7 +382,7 @@ class SpectralEmbedding(BaseEstimator): the function takes in data matrix (n_samples, n_features) and return affinity matrix (n_samples, n_samples). - gamma : float, optional, default : 1/n_features + gamma : float, default=1/n_features Kernel coefficient for rbf kernel. random_state : int, RandomState instance, default=None @@ -391,14 +391,14 @@ class SpectralEmbedding(BaseEstimator): reproducible results across multiple function calls. See :term: `Glossary `. - eigen_solver : {None, 'arpack', 'lobpcg', or 'amg'} + eigen_solver : {None, 'arpack', 'lobpcg', or 'amg'}, default=None The eigenvalue decomposition strategy to use. AMG requires pyamg to be installed. It can be faster on very large, sparse problems. - n_neighbors : int, default : max(n_samples/10 , 1) + n_neighbors : int, default=max(n_samples/10 , 1) Number of nearest neighbors for nearest_neighbors graph building. - n_jobs : int or None, optional (default=None) + n_jobs : int or None, default=None The number of parallel jobs to run. ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary `