Code Monkey home page Code Monkey logo

numerapi's Introduction

Numerai Python API

Automatically download and upload data for the Numerai machine learning competition

This library is a client to the Numerai API. The interface is programmed in Python and allows downloading the training data, uploading predictions, and accessing some user information. Some parts of the code were taken from numerflow by ChristianSch. Visit his wiki, if you need further information on the reverse engineering process.

If you encounter a problem or have suggestions, feel free to open an issue.

Installation

This library supports both Python 2 and 3. Clone this repository, then cd into this repository's directory. Then pip install -e .

Usage

See the example.py. You can run it as ./example.py

Documentation

download_current_dataset

Parameters

  • dest_path: Optional parameter. Destination folder for the dataset. Default: currrent working directory.
  • unzip: Optional parameter. Decide if you wish to unzip the downloaded training data. Default: True

Return values

  • status_code: Status code of the requests operation.

upload_prediction

Parameters

  • file_path: Path to the prediction. It should already contain the file name ('path/to/file/prediction.csv')

Return values

  • status_code: Status code of the requests operation.

Notes

  • Uploading a prediction shortly before a new dataset is released may result in a <400 Bad Request>. If this happens, just wait for the new dataset and upload new predictions then.
  • Uploading too many predictions in a certain amount of time will result in a <429 Too Many Requests>.
  • Uploading predictions to an account that has 2FA (Two Factor Authentication) enabled is not currently supported

get_user

Parameters

  • username: Name of the user you want to request.

Return values

  • array-like: Tuple of size nine containing the username, submission_id, validation_logloss, validation_consistency, originality, concordance, career_usd, career_nmr and the status code of the requests operation. If it fails all values except the status code will be None.

get_scores

Parameters

  • username: Name of the user you want to request.

Return values

  • array-like: Tuple of size 2 containing a numpy.ndarray containing the scores of all uploaded predictions with the newest first and the status code of the requests operation. If it fails all values except the status code will be None.

get_earnings_per_round

Parameters

  • username: Name of the user you want to request.

Return values

  • array-like: Tuple of size 2 containing a numpy.ndarray containing the earnings of each round with the oldest first and the status code of the requests operation. If it fails all values except the status code will be None.

login

Return values

  • array-like: Tuple of size four containing the accessToken, refreshToken, id, and the status code of the requests operation. If it fails all values except the status code will be None.

authorize

Parameters

  • file_path: Path to the prediction. It should already contain the file name ('path/to/file/prediction.csv')

Return values

  • array-like: Tuple of size four containing the filename, signedRequest, headers, and the status code of the requests operation. If it fails all values except the status code will be None.

get_current_competition

Return values

  • array-like: Tuple of size three containing the dataset_id, _id and the status code of the requests operation. If it fails all values except the status code will be None.

get_new_leaderboard

Return Values

  • list: A list of every user that has submitted in this round of the competition, including statistics like how much USD and NMR were earned by that user in that round.

Notes

  • Each round of the competition is numbered. The first competition is 1. Specify a round of the competition to get leaderboard information for that round, or leave off the round of the competition to get the current round of the competition.

numerapi's People

Contributors

atreichel avatar dhj-io avatar wsteitz avatar xanderdunn avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.