自动下载和上传数字机器学习比赛的数据

numerapi的Python项目详细描述


Build StatuscodecovPyPIDocsRequirements Status

numerai python api

自动下载和上传数字机器学习数据 竞争。

这个库是numerai api的python客户端。接口已编程 在python中,允许下载训练数据、上载预测和 访问用户、提交和比赛信息。

如果你遇到问题或有建议,请随时提出问题。

安装

pip install --upgrade numerapi

用法

numerapi可以用作常规的、可导入的python模块,或者从命令 行。

一些操作(如上传预测或立桩)需要一个令牌来验证 实际上是你在和Numerai的API交互。这些代币包括 一个public_idsecret_key。两者都可以通过登录numer.ai和 转到帐户->;自定义API密钥。令牌可以传递给python模块 作为参数,或者可以通过环境变量(NUMERAI_PUBLIC_ID)进行设置 以及NUMERAI_SECRET_KEY)。

python模块

用法示例:

# some API calls do not require logging in
napi = numerapi.NumerAPI(verbosity="info")
# download current dataset
napi.download_current_dataset(unzip=True)
# get competitions
all_competitions = napi.get_competitions()
# get leaderboard for the current round
leaderboard = napi.get_leaderboard()
# leaderboard for a historic round
leaderboard_67 = napi.get_leaderboard(round_num=67)
# check if a new round has started
if napi.check_new_round():
    print("new round has started wihtin the last 24hours!")
else:
    print("no new round within the last 24 hours")

# provide api tokens
example_public_id = "somepublicid"
example_secret_key = "somesecretkey"
napi = NumerAPI(example_public_id, example_secret_key)

# upload predictions
submission_id = napi.upload_predictions("preds.csv", tournament=1)
# check submission status
napi.submission_status()

命令行界面

要开始使用cli界面,请查看帮助页:

$ numerapi --help
Usage: numerapi [OPTIONS] COMMAND [ARGS]...

  Wrapper around the Numerai API

Options:
  --help  Show this message and exit.

Commands:
  check-new-round         Check if a new round has started within the...
  competitions            Retrieves information about all competitions
  current-round           Get number of the current active round.
  dataset-url             Fetch url of the current dataset.
  download-dataset        Download dataset for the current active...
  leaderboard             Retrieves the leaderboard for the given...
  payments                List all your payments
  rankings                Get the overall rankings.
  stake                   Participate in the staking competition.
  stakes                  List all your stakes.
  staking_leaderboard     Retrieves the staking competition leaderboard...
  submission-filenames    Get filenames of your submissions
  submission-ids          Get dict with username->submission_id...
  submission-status       checks the submission status
  submission-successful   Check if the last submission passes...
  submit                  Upload predictions from file.
  tournament-name2number  Translate tournament name to tournament...
  tournament-number2name  Translate tournament number to tournament...
  tournaments             Get all active tournaments.
  transactions            List all your deposits and withdrawals.
  user                    Get all information about you!
  user-activities         Get user activities (works for all users!)
  version                 Installed numerapi version.

每个命令都有自己的帮助页,例如:

$ numerapi submit --help
Usage: numerapi submit [OPTIONS] PATH

  Upload predictions from file.

Options:
  --tournament INTEGER  The ID of the tournament, defaults to 1
  --help                Show this message and exit.

API参考

签出detailed API docs 了解所有可用的方法、参数和返回值。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
JavaSwing:实现TableModel还是扩展AbstractTableModel?   无法在连接了SQL的Java中获取数据抛出结果集   java在运行jar时访问jar外部的prop文件   java如何在使用xPath时选择通过检查的节点,而不是它们的父节点。评估()   java如何将文本文件中的整数值翻两番?   java Update Hibernate给出了一个错误   如何使用Java在类中实现调用mule中onCall方法的Singleton?   java如何修复Hibernate 5的映射未找到异常?   调用AlertDialog。按下后退按钮时Android片段的Java生成器   java基于进度更改JProgressBar中的ColorUIResource   java如何让这个测试通过?   java是否可以在TestNG中对参数化测试进行依赖?   java查询无法通过HQL执行   Spring java 11获取spel问题EL1005E:找不到类型   尝试获取JMH锁时发生java异常