From d47d7da5e5c37481a7580b3afddfac76b01c0941 Mon Sep 17 00:00:00 2001 From: evenmatencio Date: Thu, 30 May 2024 17:39:40 +0200 Subject: [PATCH] syntax and spell checks --- docs/user-guide/costs/costgfssl2.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/user-guide/costs/costgfssl2.md b/docs/user-guide/costs/costgfssl2.md index ed810b03..a5f3b33d 100644 --- a/docs/user-guide/costs/costgfssl2.md +++ b/docs/user-guide/costs/costgfssl2.md @@ -4,7 +4,7 @@ This cost function is specifically designed to detect localized mean-shifts in a graph signal. It relies on the least squared deviation of a graph signal filtered with a low-pass graph spectral filter $h$. -Formally, let $G = (V, E, W)$ a graph containing $p =|V|$ nodes, with a weighted adjacency matrix $W$. We define its combinatorial Laplacian matrix $L$ as classicaly done in Graph Signal Processing [[Shuman2013](#Shuman2013)]: +Formally, let $G = (V, E, W)$ a graph containing $p =|V|$ nodes, with a weighted adjacency matrix $W$. We define its combinatorial Laplacian matrix $L$ as classically done in Graph Signal Processing [[Shuman2013](#Shuman2013)]: $$ L = D - W = U \Lambda U^T, @@ -19,10 +19,10 @@ where Let $\{y_t\}_t, ~ y_t \in \mathbb{R}^p$, a multivariate signal on an interval $I$. The Graph Fourier Scan Statistic (GFSS) [[Sharpnack2016](#Sharpnack2016)] of a graph signal $y_t$ is $\|G(y_t)\|_2^2$ with: $$ -G(y) = \sum_{i=2}^p h(\lambda_i) (u_i^T y) u_i \quad \text{ and } \quad h(\lambda) = \min \left\{ 1, \sqrt{\frac{\rho}{\lambda}} \right\} +G(y) = \sum_{i=2}^p h(\lambda_i) (u_i^T y) u_i \quad \text{ and } \quad h(\lambda) = \min \left( 1, \sqrt{\frac{\rho}{\lambda}} \right) $$ -where $\rho$ is the so-called cut-sparsity. The cost function [`CostGFSSL2`][ruptures.costs.costrbf.CostGFSSL2] over interval $I$ is given by: +where $\rho$ is the so-called cut-sparsity. The cost function [`CostGFSSL2`][ruptures.costs.costgfssl2.CostGFSSL2] over interval $I$ is given by: $$ c(y_{I}) = \sum_{t\in I} \|G(y_t - \bar{y})\|_2^2 @@ -48,11 +48,11 @@ G = nx.gnp_random_graph(n=nb_nodes, p=0.5) # creation of the signal n, dim = 500, nb_nodes # number of samples, dimension -n_bkps, sigma = 3, 1 # number of change points, noise standart deviation +n_bkps, sigma = 3, 1 # number of change points, noise standard deviation signal, bkps = rpt.pw_constant(n, dim, n_bkps, noise_std=sigma) ``` -Then create a [`CostGFSSL2`][ruptures.costs.costrbf.CostGFSSL2] instance and print the cost of the sub-signal `signal[50:150]`. The initialization of the class requires the Laplacian matrix of the underlying graph and the value of the cut-sparsity $\rho$ should be set based on the eigenvalues of $L$ (see [Graph signal change point detection](../../examples/merging-cost-functions.ipynb)). +Then create a [`CostGFSSL2`][ruptures.costs.costgfssl2.CostGFSSL2] instance and print the cost of the sub-signal `signal[50:150]`. The initialization of the class requires the Laplacian matrix of the underlying graph and the value of the cut-sparsity $\rho$ should be set based on the eigenvalues of $L$ (see [Graph signal change point detection](../../examples/merging-cost-functions.ipynb)). ```python # creation of the cost function instance @@ -69,7 +69,7 @@ print(c.sum_of_costs(bkps)) print(c.sum_of_costs([10, 100, 200, 250, n])) ``` -In order to use this cost class in a change point detection algorithm (inheriting from [`BaseEstimator`][ruptures.base.BaseEstimator]), pass a [`CostGFSSL2`][ruptures.costs.costrbf.CostGFSSL2] instance (through the argument `custom_cost`). +In order to use this cost class in a change point detection algorithm (inheriting from [`BaseEstimator`][ruptures.base.BaseEstimator]), pass a [`CostGFSSL2`][ruptures.costs.costgfssl2.CostGFSSL2] instance (through the argument `custom_cost`). ```python c = rpt.costs.CostL2()