Routines to interact with the Numerai Machine Learning Tournament API < https://numer.ai>. The functionality includes the ability to automatically download the current tournament data, submit predictions, and to get information for your user.
R Interface to the Numerai Machine Learning Tournament API
This interface allows download of tournament data, submit predictions, get user information, stake NMR's and much more. Using the functions from this package end user can write R code to automate the whole procedure related to numerai tournament.
If you encounter a problem or have suggestions, feel free to open an issue.
devtools::install_github("Omni-Analytics-Group/Rnumerai")
install.packages("Rnumerai")
library(Rnumerai)
Get your public key and api key by going to numer.ai and then going to Custom API Keys section under your Account Tab. Select appropriate scopes to generate the key or select all scopes to use the full functionality of this package.
set_public_id("public_id_here")
set_api_key("api_key_here")
get_account()
get_models(tournament=8)
get_models(tournament=11)
get_current_round()
get_competitions(tournament=8)
get_competitions(tournament=11)
set_bio(model_id = get_models()[["bayo"]], bio = "This Model Rocks")
set_link(model_id = get_models()[["bayo"]], link = "https://www.google.com",link_text = "Google")
wallet_transactions()
set_submission_webhook(model_id = get_models()[["bayo"]], webhook = "..")
round_model_performances(username = "bayo",tournament=8)
round_model_performances(username = "bayo",tournament=11)
daily_model_performances(username = "bayo",tournament=8)
daily_model_performances(username = "bayo",tournament=11)
daily_submission_performances(username = "bayo",tournament=8)
daily_submission_performances(username = "bayo",tournament=11)
get_leaderboard(tournament=8)
get_leaderboard(tournament=11)
model_id = get_models(tournament=8)[["bayo"]]
submission_status(model_id = model_id, tournament=8)
model_id = get_models(tournament=11)[["test5678"]]
submission_status(model_id = model_id, tournament=11)
run_query(query = 'query{account{username}}', auth=TRUE)
run_query(query = 'query{rounds{number,closeTime}}', auth=FALSE)
library(Rnumerai)
Get your public key and api key by going to numer.ai and then going to Custom API Keys section under your Account Tab. Select appropriate scopes to generate the key or select all scopes to use the full functionality of this package.
set_public_id("public_id_here")
set_api_key("api_key_here")
list_datasets()
download_dataset("v2/numerai_datasets.zip", "numerai_datasets.zip")
download_dataset("v2/numerai_live_data.parquet", "numerai_live_data.parquet")
unzip("numerai_datasets.zip",overwrite = TRUE, list = FALSE)
data_train <- read.csv("numerai_training_data.csv")
data_tournament <- read.csv("numerai_tournament_data.csv")
data_live <- data.table::setDT(arrow::read_parquet("numerai_live_data.parquet"))
predictions <- data.frame(id=data_live$id,prediction=sample(400:600,nrow(data_live),replace=TRUE)/1000)
upload_predictions(model_id = get_models()[["bayo"]],df=predictions)
download_dataset("v3/numerai_training_data.parquet", "numerai_training_data.parquet")
download_dataset("v3/numerai_validation_data.parquet", "numerai_validation_data.parquet")
download_dataset("v3/numerai_live_data.parquet", "numerai_live_data.parquet")
download_dataset("v3/numerai_datasets.zip", "numerai_datasets.zip")
data_train <- data.table::setDT(arrow::read_parquet("numerai_training_data.parquet"))
data_validation <- data.table::setDT(arrow::read_parquet("numerai_validation_data.parquet"))
data_live <- data.table::setDT(arrow::read_parquet("numerai_live_data.parquet"))
predictions <- data.frame(id=data_live$id,prediction=sample(400:600,nrow(data_live),replace=TRUE)/1000)
upload_predictions(model_id = get_models()[["bayo"]],df=predictions)
diagnostics <- data.frame(id=data_validation$id,prediction=sample(400:600,nrow(data_validation),replace=TRUE)/1000)
diagnostics_id <- upload_diagnostics(model_id = get_models()[["bayo"]],df=diagnostics)
diagnostics(model_id = get_models()[["bayo"]],diagnostics_id=diagnostics_id)
download_dataset("v4/train.parquet", "train.parquet")
download_dataset("v4/validation.parquet", "validation.parquet")
download_dataset("v4/live.parquet", "live.parquet")
download_dataset("v4/live_example_preds.parquet", "live_example_preds.parquet")
download_dataset("v4/validation_example_preds.parquet", "validation_example_preds.parquet")
download_dataset("v4/features.json", "features.json")
data_train <- data.table::setDT(arrow::read_parquet("train.parquet"))
data_validation <- data.table::setDT(arrow::read_parquet("validation.parquet"))
data_live <- data.table::setDT(arrow::read_parquet("live.parquet"))
predictions <- data.frame(id=data_live$id,prediction=sample(400:600,nrow(data_live),replace=TRUE)/1000)
upload_predictions(model_id = get_models()[["bayo"]],df=predictions)
diagnostic_preds <- data.frame(id=data_validation$id,prediction=sample(400:600,nrow(data_validation),replace=TRUE)/1000)
diagnostics_id <- upload_diagnostics(model_id = get_models()[["bayo"]],df=diagnostic_preds)
diagnostics(model_id = get_models()[["bayo"]],diagnostics_id=diagnostics_id)
stake_change(nmr=.01,action="increase",model_id = get_models()[["bayo"]])
stake_change(nmr=.01,action="decrease",model_id = get_models()[["bayo"]])
set_stake_type(model_id = get_models()[["bayo"]],corr_multiplier=1,tc_multiplier=2,tournament=8)
library(Rnumerai)
Get your public key and api key by going to numer.ai and then going to Custom API Keys section under your Account Tab. Select appropriate scopes to generate the key or select all scopes to use the full functionality of this package.
set_public_id("public_id_here")
set_api_key("api_key_here")
tickers <- ticker_universe()
predictions <- cbind(tickers,signal = sample(400:600,nrow(tickers),replace=TRUE)/1000)
upload_predictions(model_id = get_models(tournament=11)[["test5678"]],df=predictions,tournament=11)
download_validation_data(file_path = "signals_historical_targets.csv")
data_validation <- read.csv("signals_historical_targets.csv")
data_validation <- data_validation[sample(1:nrow(data_validation),1000),1:3]
data_validation$data_type <- "validation"
diagnostic_preds <- cbind(data_validation,signal = sample(400:600,nrow(data_validation),replace=TRUE)/1000)
diagnostics_id <- upload_diagnostics(model_id = get_models(tournament=11)[["test5678"]],df=diagnostic_preds,tournament=11)
diagnostics(model_id = get_models(tournament=11)[["test5678"]],tournament=11,diagnostics_id=diagnostics_id)
stake_change(nmr=.01,action="increase",tournament=11,model_id = get_models(tournament=11)[["test5678"]])
stake_change(nmr=.01,action="decrease",tournament=11,model_id = get_models(tournament=11)[["test5678"]])
set_stake_type(model_id = get_models(tournament=11)[["test5678"]],corr_multiplier=1,tc_multiplier=2,tournament=11)