Skip to main content

Numerox is a Numerai tournament toolbox written in Python

Project description

Numerox is a Numerai tournament toolbox written in Python.

All you have to do is create a model. Take a look at model.py for examples.

Once you have a model numerox will do the rest. First download the Numerai dataset and then load it:

>>> import numerox as nx
>>> nx.download_dataset('numerai_dataset.zip')
>>> data = nx.load_zip('numerai_dataset.zip')
>>> data
rows      637184
era       133, [era1, eraX]
x         50, min 0.0000, mean 0.5025, max 1.0000
y         mean 0.499924, fraction missing 0.3095

Let’s use the logistic regression model in numerox to run 5-fold cross validation on the training data:

>>> model = nx.logistic()
>>> prediction = nx.backtest(model, data, verbosity=1)
logistic(inverse_l2=0.0001)
      logloss   auc     acc     ystd   stats
mean  0.692885  0.5165  0.5116  0.0056  region     train
std   0.000536  0.0281  0.0215  0.0003    eras       120
min   0.691360  0.4478  0.4540  0.0050  sharpe  0.488866
max   0.694202  0.5944  0.5636  0.0061  consis  0.691667

OK, results are good enough for a demo so let’s make a submission file for the tournament. We will fit the model on the train data and make our predictions for the tournament data:

>>> prediction = nx.production(model, data, verbosity=1)
logistic(inverse_l2=0.0001)
      logloss   auc     acc     ystd   stats
mean  0.692808  0.5194  0.5142  0.0063  region  validation
std   0.000375  0.0168  0.0137  0.0001    eras          12
min   0.691961  0.4903  0.4925  0.0062  sharpe    0.903277
max   0.693460  0.5553  0.5342  0.0064  consis    0.916667
>>> prediction.to_csv('logistic.csv')  # 6 decimal places by default

Examples

Have a look at the examples.

Install

Install with pip:

$ pip install numerox

After you have installed numerox, run the unit tests (please report any failures):

>>> import numerox as nx
>>> nx.test()

Requirements: python, setuptools, numpy, pandas, pytables, sklearn, numerapi, requests, nose.

Resources

License

Numerox is distributed under the the GPL v3+. See LICENSE file for details. Where indicated by code comments parts of NumPy and SciPy are included in numerox. Their licenses appear in the licenses directory.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

numerox-0.1.2.tar.gz (3.0 MB view details)

Uploaded Source

File details

Details for the file numerox-0.1.2.tar.gz.

File metadata

  • Download URL: numerox-0.1.2.tar.gz
  • Upload date:
  • Size: 3.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for numerox-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e01d69932680c74c7f63b6c8e5c7e182fcb8ee19d923e408482ffc4dc9908ccf
MD5 5239758fa637cc97e5dd1e8e4a6cf198
BLAKE2b-256 09b2a06548fd5dd17ceebbc56e33ca2a7ce3b78e4cf85db3a2a719e379c08ce8

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page