<p>Without looking in too much detail:</p>
<ul>
<li>We may suppose that <span class="math-container">$S$</span> is a matrix with dimensions indexed as <span class="math-container">$(i, j)$</span>. So <span class="math-container">$s_{ij}$</span> is the cell of <span class="math-container">$S$</span> indexed to the <span class="math-container">$i$</span>th row and <span class="math-container">$j$</span>th column, and <span class="math-container">$s_{ji}$</span> is the cell vice versa. Therefore, symmetrizing <span class="math-container">$S$</span> is a matter of ensuring that <span class="math-container">$s_{ij} == s_{ji}$</span>, which you can achieve by multiplying the (ranked?) entries. Symmetric matrices are nice for doing certain kinds of math, and yield a handy representation of undirected graphs, which the authors appear to be using for <a href="https://en.wikipedia.org/wiki/K-nearest_neighbors_algorithm" rel="nofollow noreferrer">kNN</a>.</li>
<li><span class="math-container">$max(x, 0)$</span> is just saying that you want either <span class="math-container">$x$</span> if <span class="math-container">$x$</span> is non-negative, or <span class="math-container">$0$</span> if it is negative. Thus, you make the whole matrix non-negative, which makes some handy matrix math possible. You can see how this works computationally by inspecting e.g. the Python <code>max()</code> <a href="https://docs.python.org/3/library/functions.html#max" rel="nofollow noreferrer">function</a>.</li>
</ul>

CC BY-SA 4.0
2022-11-20T22:22:30.313Z
2022-11-20T22:22:30.313Z
Maximilian Press
<p>I'm reading through this paper: Baran, Y., Bercovich, A., Sebe-Pedros, A., Lubling, Y., Giladi, A., Chomsky, E., ... &amp; Tanay, A. (2019). <a href="https://genomebiology.biomedcentral.com/articles/10.1186/s13059-019-1812-2" rel="nofollow noreferrer">MetaCell: analysis of single-cell RNA-seq data using K-nn graph partitions</a>. Genome biology, 20(1), 1-19.</p>
<p><a href="https://i.sstatic.net/BMITn.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/BMITn.png" alt="enter image description here" /></a></p>
<p>Maybe I am not familiar with this notation but I don't understand the regularization procedure as follows:</p>
<ol>
<li>What is happening in these max functions? What does the 0 indicate? They have some terms <span class="math-container">$x$</span> and then in the max function they write <span class="math-container">$max( x, 0)$</span>.</li>
<li>I assume <span class="math-container">$K$</span> is some regularization parameter, like a cost. Is <span class="math-container">$s_{ij} * s_{ji}$</span> the rank product?  I.e. the geometric mean?</li>
</ol>

<scrnaseq><r><graphs>
Understanding regularization step in Meta-cell pre processing
# Understanding regularization step in Meta-cell pre processing

(Asked by: username_0 on 2022-11-20)

I'm reading through this paper: Baran, Y., Bercovich, A., Sebe-Pedros, A., Lubling, Y., Giladi, A., Chomsky, E., ... & Tanay, A. (2019). [MetaCell: analysis of single-cell RNA-seq data using K-nn graph partitions](https://genomebiology.biomedcentral.com/articles/10.1186/s13059-019-1812-2). Genome biology, 20(1), 1-19.

[![enter image description here](https://i.sstatic.net/BMITn.png)](https://i.sstatic.net/BMITn.png)

Maybe I am not familiar with this notation but I don't understand the regularization procedure as follows:

1. What is happening in these max functions? What does the 0 indicate? They have some terms $x$ and then in the max function they write $max( x, 0)$.
2. I assume $K$ is some regularization parameter, like a cost. Is $s\_{ij} \* s\_{ji}$ the rank product? I.e. the geometric mean?

**Tags:** scrnaseq, r, graphs

---

## 1 answers

### Answer by username_1 on 2022-11-20. Score: 2 | Accepted answer

Without looking in too much detail:

* We may suppose that $S$ is a matrix with dimensions indexed as $(i, j)$. So $s\_{ij}$ is the cell of $S$ indexed to the $i$th row and $j$th column, and $s\_{ji}$ is the cell vice versa. Therefore, symmetrizing $S$ is a matter of ensuring that $s\_{ij} == s\_{ji}$, which you can achieve by multiplying the (ranked?) entries. Symmetric matrices are nice for doing certain kinds of math, and yield a handy representation of undirected graphs, which the authors appear to be using for [kNN](https://en.wikipedia.org/wiki/K-nearest_neighbors_algorithm).
* $max(x, 0)$ is just saying that you want either $x$ if $x$ is non-negative, or $0$ if it is negative. Thus, you make the whole matrix non-negative, which makes some handy matrix math possible. You can see how this works computationally by inspecting e.g. the Python `max()` [function](https://docs.python.org/3/library/functions.html#max).


---

