# 0 capping in the case of negative values and rounding values to 2 decimal points

**URL:** https://forum.crunchdao.com/t/0-capping-in-the-case-of-negative-values-and-rounding-values-to-2-decimal-points/674
**Category:** (ended) Broad Institute Crunch #1
**Created:** [December 14, 2024, 9:39am UTC](https://forum.crunchdao.com/t/0-capping-in-the-case-of-negative-values-and-rounding-values-to-2-decimal-points/674 "2024-12-14T09:39:32Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![many-kalin](https://forum.crunchdao.com/user_avatar/forum.crunchdao.com/many-kalin/32/383_2.png) [@many-kalin](https://forum.crunchdao.com/u/many-kalin)
#### Post date: [December 14, 2024, 9:39am UTC](https://forum.crunchdao.com/t/0-capping-in-the-case-of-negative-values-and-rounding-values-to-2-decimal-points/674/1 "2024-12-14T09:39:32Z")

</div>

Hi,

1. While I understand the rationale for enforcing 0 as the lowest score in the case of MSE, I wonder if this constraint should also apply to the correlation-based metrics. It is true that the model most likely never encountered negative log1p expression; however, interpolation in the negative domain could still provide meaningful model signal. This signal could be effectively captured by correlation-based metrics, which is another advantage of using them in such cases.

2. I think rounding to two decimals is also smoothing out the model’s signal. Eventually, the normalized expression is multiplied by 100 and then log1p transformed. Rounding to more decimals shouldn’t lead to numerical instability yet.

This model signal smoothing could also make the differences between models smaller on the leaderboard.

---

<div class="post-metadata">

### Author: ![many-kalin](https://forum.crunchdao.com/user_avatar/forum.crunchdao.com/many-kalin/32/383_2.png) [@many-kalin](https://forum.crunchdao.com/u/many-kalin)
#### Post date: [December 14, 2024, 9:49am UTC](https://forum.crunchdao.com/t/0-capping-in-the-case-of-negative-values-and-rounding-values-to-2-decimal-points/674/2 "2024-12-14T09:49:26Z")

</div>

This is the code base I am referring to [competitions/competitions/broad-1/scoring/scoring.py at master · crunchdao/competitions · GitHub](https://github.com/crunchdao/competitions/blob/master/competitions/broad-1/scoring/scoring.py)

In general, I think external output transformations should be avoided as much as possible. Rounding errors add up quickly.

---

<div class="post-metadata">

### Author: ![cruncher-abde](https://forum.crunchdao.com/user_avatar/forum.crunchdao.com/cruncher-abde/32/298_2.png) [@cruncher-abde](https://forum.crunchdao.com/u/cruncher-abde)
#### Post date: [December 16, 2024, 2:20pm UTC](https://forum.crunchdao.com/t/0-capping-in-the-case-of-negative-values-and-rounding-values-to-2-decimal-points/674/3 "2024-12-16T14:20:27Z")

</div>

Which transformation are you referring to in the file `scoring.py`?

---

<div class="post-metadata">

### Author: ![many-kalin](https://forum.crunchdao.com/user_avatar/forum.crunchdao.com/many-kalin/32/383_2.png) [@many-kalin](https://forum.crunchdao.com/u/many-kalin)
#### Post date: [December 16, 2024, 2:30pm UTC](https://forum.crunchdao.com/t/0-capping-in-the-case-of-negative-values-and-rounding-values-to-2-decimal-points/674/4 "2024-12-16T14:30:50Z")

</div>

0 capping [competitions/competitions/broad-1/scoring/scoring.py at 1bc16bfaa98fd351e7c8dbf2fcc002aef8273379 · crunchdao/competitions · GitHub](https://github.com/crunchdao/competitions/blob/1bc16bfaa98fd351e7c8dbf2fcc002aef8273379/competitions/broad-1/scoring/scoring.py#L85)  
and you also have the requirement for 2 decimals rounding.

---

<div class="post-metadata">

### Author: ![cruncher-abde](https://forum.crunchdao.com/user_avatar/forum.crunchdao.com/cruncher-abde/32/298_2.png) [@cruncher-abde](https://forum.crunchdao.com/u/cruncher-abde)
#### Post date: [December 16, 2024, 2:49pm UTC](https://forum.crunchdao.com/t/0-capping-in-the-case-of-negative-values-and-rounding-values-to-2-decimal-points/674/5 "2024-12-16T14:49:16Z")

</div>

You are predicting the expression of genes for a given cell, so it makes sense for the value to be positive as it represents the count of occurrences.

Regarding the rounding, this is a specific requirement outlined in the full specification:

> Make sure your predictions are log1p-normalized as in anucleus.X […] rounded to 2 decimal points…

We will wait for feedback from the Broad team. @separate-orr

---

<div class="post-metadata">

### Author: ![many-kalin](https://forum.crunchdao.com/user_avatar/forum.crunchdao.com/many-kalin/32/383_2.png) [@many-kalin](https://forum.crunchdao.com/u/many-kalin)
#### Post date: [December 16, 2024, 2:57pm UTC](https://forum.crunchdao.com/t/0-capping-in-the-case-of-negative-values-and-rounding-values-to-2-decimal-points/674/6 "2024-12-16T14:57:48Z")

</div>

Negative values represent model interpolation (i.e., model signal) in the negative domain (e.g., underexpression of a given gene)

---

<div class="post-metadata">

### Author: ![cruncher-abde](https://forum.crunchdao.com/user_avatar/forum.crunchdao.com/cruncher-abde/32/298_2.png) [@cruncher-abde](https://forum.crunchdao.com/u/cruncher-abde)
#### Post date: [December 18, 2024, 11:18am UTC](https://forum.crunchdao.com/t/0-capping-in-the-case-of-negative-values-and-rounding-values-to-2-decimal-points/674/7 "2024-12-18T11:18:45Z")

</div>

Broad confirmed what I said:

> gene expression values should not be negative, either detected (positive) or not detected (zero)

---

<div class="post-metadata">

### Author: ![cruncher-abde](https://forum.crunchdao.com/user_avatar/forum.crunchdao.com/cruncher-abde/32/298_2.png) [@cruncher-abde](https://forum.crunchdao.com/u/cruncher-abde)
#### Post date: [December 18, 2024, 11:20am UTC](https://forum.crunchdao.com/t/0-capping-in-the-case-of-negative-values-and-rounding-values-to-2-decimal-points/674/8 "2024-12-18T11:20:18Z")

</div>

About precision:

> I don’t think having more decimal points could boost model performance in a meaningful way, given that the distribution (e.g. standard deviation) of non-zero values in the cell by gene matrix is about two orders of magnitude of two decimal points (0.01).
