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

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第三方库


热门话题
java这种src与构建树时间戳的比较如何更快?   java如何在两个命令处理程序之间通信   java下拉框值更改   Java如何从另一个类中提取字段的值   无字段名的java Jackson序列化   java游戏循环和方法调用   java Spring Security permitAll()匹配器被忽略   java如何在一个方法中将数组中的int作为单独的int传递?   使用ArrayList在Java中实现同步队列   java JButton的操作侦听器在JTable中不工作   java中C++ OOP指针的技巧   java My regex搜索只打印出最后一个匹配项   java如何在Hadoop中序列化非常大的可写对象   spring Paypal JavaSDK支付执行问题   带有SPNEGO SSO的java Tomcat 6仍会提示输入登录名和密码   java HttpResponse主体正在更改   java如何在RxJava中实现链锁   为什么我需要java。lang.ClassNotFoundException:com。mysql。希杰。jdbc。mysqlconnectorjava8时的驱动程序。0.16.jar在类路径中?   java输入错误。即使在接受新输入后仍使用旧输入