# About the Stake Weighted Meta Model

**URL:** <https://forum.numer.ai/t/about-the-stake-weighted-meta-model/6858>\
**Category:** Data Science\
**Created:** [December 16, 2023, 3:36pm UTC](https://forum.numer.ai/t/about-the-stake-weighted-meta-model/6858 "2023-12-16T15:36:52Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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:** [December 21, 2023, 11:38am UTC](https://forum.numer.ai/t/about-the-stake-weighted-meta-model/6858/3 "2023-12-21T11:38:18Z")

</div>

Another curiosity, how do top staked models (models != accounts) perform ?

 ![cumulative](https://canada1.discourse-cdn.com/flex009/uploads/numerai/original/2X/8/844b251c7da7ffeabc9052a1a0c16cd846f114cf.png)

[Download the data](http://forum.numer.ai/t/mmc-vs-corr-vs-corrwmetamodel/6856/2), then plot

```auto
#!/usr/bin/env python3

import sys
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns

if len(sys.argv) < 2:
    print("Usage:")
    print(f" {sys.argv[0]} round-xxx-yyy.csv")
    sys.exit(1)

CORR_COL='v2Corr20'

df = pd.read_csv(sys.argv[1])

# keep only the needed columns
df = df[["corrWMetaModel","mmc","modelName","payoutSettled","selectedStakeValue","tc","v2Corr20","roundNumber"] ]

# keep only staked models
df = df[df["selectedStakeValue"] > 1.0 ]

# make sure of the sorting
df = df.sort_values(by="roundNumber", ascending=True)

plt.rcParams["figure.figsize"] = [12,8] # default is [6.4, 4.8]

def plot(s):
    ax = ((s.fillna(0.) + 1.0).cumprod() - 1.0).plot(kind='line', legend=True, linewidth=3)
    return ax

tmp_series = df.groupby(['roundNumber']).apply(lambda x: x[CORR_COL].mean())
tmp_series.name='All staked models Mean v2Corr20'
plot(tmp_series)

tmp_series = df.groupby(['roundNumber']).apply(lambda x: (x[CORR_COL]*x["selectedStakeValue"]).sum()/x["selectedStakeValue"].sum() )
tmp_series.name='Stake Weighted v2Corr20'
plot(tmp_series)

tmp_series = df.groupby(['roundNumber']).apply(lambda x: x.nlargest(3, "selectedStakeValue")[CORR_COL].mean())
tmp_series.name='Highest 3 Staked Model Mean v2Corr20'
plot(tmp_series)

tmp_series = df.groupby(['roundNumber']).apply(lambda x: x.nlargest(10, "selectedStakeValue")[CORR_COL].mean())
tmp_series.name='Highest 10 Staked Model Mean v2Corr20'
plot(tmp_series)

tmp_series = df.groupby(['roundNumber']).apply(lambda x: x.nlargest(30, "selectedStakeValue")[CORR_COL].mean())
tmp_series.name='Highest 30 Staked Model Mean v2Corr20'
ax = plot(tmp_series)

ax.get_figure().savefig(f"cumulative.png")

```

---

_[View the full topic](https://forum.numer.ai/t/about-the-stake-weighted-meta-model/6858)._
