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

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无法使用JSF访问托管bean方法   java是制作具有多值类型的HashMap的正确方法   javafx中TicTacToe的java更新UI   windows Java文件。getCanonicalFile()无法处理冒号“:”   java在一个布局屏幕中创建多个(26)按钮   java Android Studio:Gradle构建完成,有251个错误   我们如何在Java上为callfireapiclient编写单元/集成测试?   java无法将1715UTC转换为本地/gmt类型   具有已定义的数字序列的JAVA循环   Java程序正在netbeans中编译,但未在CMD中编译,包不存在   java Android构造函数和onCreate()之间有什么区别?   java配置弹性搜索结果评分   java LibGDX纹理是否可绘制?   java如何在Android中设置应用程序默认打开pdf   java是否有一种创造性的方法将多个参数传递给contentEquals()方法?   java在Android上存储Ed25519私钥