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
region    live, test, train, validation
rows      884544
era       98, [era1, eraX]
x         50, min 0.0000, mean 0.4993, max 1.0000
y         mean 0.499961, fraction missing 0.3109

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

>>> model = nx.model.logistic()
>>> prediction = nx.backtest(model, data, verbosity=1)
logistic(inverse_l2=1e-05)
      logloss   auc     acc     ystd
mean  0.692974  0.5226  0.5159  0.0023  |  region   train
std   0.000224  0.0272  0.0205  0.0002  |  eras     85
min   0.692360  0.4550  0.4660  0.0020  |  consis   0.7647
max   0.693589  0.5875  0.5606  0.0027  |  75th     0.6931

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)
logistic(inverse_l2=1e-05)
      logloss   auc     acc     ystd
mean  0.692993  0.5157  0.5115  0.0028  |  region   validation
std   0.000225  0.0224  0.0172  0.0000  |  eras     12
min   0.692440  0.4853  0.4886  0.0028  |  consis   0.7500
max   0.693330  0.5734  0.5555  0.0028  |  75th     0.6931
>>> 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, 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.0.8.tar.gz (3.4 MB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for numerox-0.0.8.tar.gz
Algorithm Hash digest
SHA256 45f40821c31bd98ed1a73c3f50310acbc558321681245d8df42426161d1e7429
MD5 361219fc0c742e4fc10eaf5cbaaf5de2
BLAKE2b-256 fa2d090f18b6a6684dba64c73189de4343c73f235a25c5ebbdd96b668f135fac

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