Skip to content

Conversation

@jeethu
Copy link
Contributor

@jeethu jeethu commented May 23, 2024

Before:

$ DISABLE_NUMBA_STATS=1 python -m timeit -s "sz=5000;import numpy as np;import pandas as pd;from numerai_tools.scoring import numerai_corr;t = pd.Series(np.random.choice([0, 0.25, 0.5, 0.75, 1.0], size=sz), name='t');df = pd.DataFrame({'predictions': np.random.rand(sz)})" "numerai_corr(df, t)"

50 loops, best of 5: 3.9 msec per loop

After:

$ python -m timeit -s "sz=5000;import numpy as np;import pandas as pd;from numerai_tools.scoring import numerai_corr;t = pd.Series(np.random.choice([0, 0.25, 0.5, 0.75, 1.0], size=sz), name='t');df = pd.DataFrame({'predictions': np.random.rand(sz)})" "numerai_corr(df, t)"

100 loops, best of 5: 3.75 msec per loop

About 3.85% faster for computing numerai_corr(). I haven't benchmarked other functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant