# Some info on multiple targets?

**URL:** https://forum.numer.ai/t/some-info-on-multiple-targets/5606
**Category:** Tournament
**Created:** [July 28, 2022, 6:30am UTC](https://forum.numer.ai/t/some-info-on-multiple-targets/5606 "2022-07-28T06:30:46Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![taori](https://avatars.discourse-cdn.com/v4/letter/t/ebca7d/32.png) [@taori](https://forum.numer.ai/u/taori)
#### Post date: [August 25, 2022, 9:37pm UTC](https://forum.numer.ai/t/some-info-on-multiple-targets/5606/4 "2022-08-25T21:37:26Z")

</div>

[This](http://forum.numer.ai/t/generating-feature-groups/4744/12) post made me curious and so here is the correlation matrix between targets and the dendrogram to better highlight relationships.

 ![Figure_1](https://canada1.discourse-cdn.com/flex009/uploads/numerai/original/2X/4/404b87d1da36118ebc3260966cb8d5c6bccdb96b.png)

 ![Figure_2](https://canada1.discourse-cdn.com/flex009/uploads/numerai/original/2X/d/d5de53d8e61894c470ab6e416029f5e1e706db4d.png)

Here is the code.

```auto
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt

targets = [
    'target_nomi_v4_20',
    'target_nomi_v4_60',
    'target_jerome_v4_20',
    'target_jerome_v4_60',
    'target_janet_v4_20',
    'target_janet_v4_60',
    'target_ben_v4_20',
    'target_ben_v4_60',
    'target_alan_v4_20',
    'target_alan_v4_60',
    'target_paul_v4_20',
    'target_paul_v4_60',
    'target_george_v4_20',
    'target_george_v4_60',
    'target_william_v4_20',
    'target_william_v4_60',
    'target_arthur_v4_20',
    'target_arthur_v4_60',
    'target_thomas_v4_20',
    'target_thomas_v4_60']

# analyse the validation data, but we could do the same on the training data
df = pd.read_parquet('v4/validation.parquet', columns=targets + ['era'])

# compute the mean of the era correlation of every target with any other target
corr = df.groupby('era').corr(method='spearman').mean(axis=0, level=1)

# arrange the order of the columns and rows (for visualization) so that they
# are sorted by correlation with the target 'target_nomi_v4_20' 
corr = corr.sort_values(
    'target_nomi_v4_20',
    axis=0,
    ascending=False).sort_values(
        'target_nomi_v4_20',
        axis=1,
    ascending=False)

sns.heatmap(corr, annot=True)
plt.show()

sns.clustermap(corr)
plt.show()

```

---

_[View the full topic](https://forum.numer.ai/t/some-info-on-multiple-targets/5606)._
