<p>The banding is an inherent consequence of the way simple decision trees work. Each leaf in such decision trees provides a leaf-specific answer, right or wrong. In this case, each leaf in the decision tree provides a specific red shift (<span class="math-container">$z$</span>) value.</p>
<p>To illustrate, I'll start with a zero-branch decision tree. Regardless of the input photometric data, this zero-branch decision tree will give the same answer. This singular answer will be <span class="math-container">$\bar z$</span>, the average of all of the true red shift values in the training data set. (Note: The authors chose mean square error as the metric used in the decision tree. The mean is the value that minimizes the mean square error.) When plotted as a predicted <span class="math-container">$z$</span> versus true <span class="math-container">$z$</span> scatter plot when applied against the test data set, the result will be a single horizontal band at that training data set <span class="math-container">$\bar z$</span> value.</p>
<p>The above is ludicrously over the top, but it illustrates why a decision tree will show bands in a predicted versus true scatter plot. With a single branch decision tree there will be two leaves in the tree, one for the <code>then</code> branch of the single decision and another for the <code>else</code> branch, and thus two bands in the scatter plot. A two-branch decision tree will have three leaves (so three bands), and so on. One can sometimes count the number of leaves in a decision tree simply by counting the number of bands in the scatter plot.</p>

CC BY-SA 4.0
2024-01-08T12:52:57.307Z
2024-01-08T12:52:57.307Z
David Hammen
<p>In <a href="https://www.researchgate.net/publication/350647740_Benchmarking_and_Scalability_of_Machine_Learning_Methods_for_Photometric_Redshift_Estimation" rel="nofollow noreferrer">this</a> paper, the authors compare the speed and accuracy of various machine learning algorithms to produce photometric redshift estimates:</p>
<p><a href="https://i.sstatic.net/xACQN.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/xACQN.png" alt="enter image description here" /></a></p>
<p>Why does the DT regressor put the estimates into bands along the <code>True z</code> axis? The only thing I can find in the paper referencing this is</p>
<blockquote>
<p>While the Decision Tree (DT) might be excluded due to the estimates being
put into bands at set redshifts, its errors were still found to be quite
low and it outperformed both the Linear Regression (LR) and MLP
algorithms.</p>
</blockquote>

CC BY-SA 4.0
2024-01-08T13:19:41.977Z
Good question. It made me have to remember how simple decision trees work.
David Hammen
<redshift>
Why does a Decision Tree produce lines in photometric redshift predictions?
Jim421616
# Why does a Decision Tree produce lines in photometric redshift predictions?

(Asked by: username_0 on 2024-01-08)

In [this](https://www.researchgate.net/publication/350647740_Benchmarking_and_Scalability_of_Machine_Learning_Methods_for_Photometric_Redshift_Estimation) paper, the authors compare the speed and accuracy of various machine learning algorithms to produce photometric redshift estimates:

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

Why does the DT regressor put the estimates into bands along the `True z` axis? The only thing I can find in the paper referencing this is

> While the Decision Tree (DT) might be excluded due to the estimates being
> put into bands at set redshifts, its errors were still found to be quite
> low and it outperformed both the Linear Regression (LR) and MLP
> algorithms.

**Tags:** redshift

> **Comments:**
> **username_1**: Good question. It made me have to remember how simple decision trees work.  

---

## 1 answers

### Answer by username_1 on 2024-01-08. Score: 1 | Accepted answer

The banding is an inherent consequence of the way simple decision trees work. Each leaf in such decision trees provides a leaf-specific answer, right or wrong. In this case, each leaf in the decision tree provides a specific red shift ($z$) value.

To illustrate, I'll start with a zero-branch decision tree. Regardless of the input photometric data, this zero-branch decision tree will give the same answer. This singular answer will be $\bar z$, the average of all of the true red shift values in the training data set. (Note: The authors chose mean square error as the metric used in the decision tree. The mean is the value that minimizes the mean square error.) When plotted as a predicted $z$ versus true $z$ scatter plot when applied against the test data set, the result will be a single horizontal band at that training data set $\bar z$ value.

The above is ludicrously over the top, but it illustrates why a decision tree will show bands in a predicted versus true scatter plot. With a single branch decision tree there will be two leaves in the tree, one for the `then` branch of the single decision and another for the `else` branch, and thus two bands in the scatter plot. A two-branch decision tree will have three leaves (so three bands), and so on. One can sometimes count the number of leaves in a decision tree simply by counting the number of bands in the scatter plot.


---

