Skip to content

Instantly share code, notes, and snippets.

@microprediction
Created February 18, 2020 18:14
Show Gist options
  • Save microprediction/3acbd63425dc943dd4f79e0aacac0270 to your computer and use it in GitHub Desktop.
Save microprediction/3acbd63425dc943dd4f79e0aacac0270 to your computer and use it in GitHub Desktop.
Supercollider submission example
import Algorithmia
import numpy as np
import json
# Only works inside Algorithmia, but easily modified
sc_pred = Algorithmia.client().algo('microprediction/sc_predict')
NUM_PREDICTIONS = Algorithmia.client().algo('micropredictoin/sc_num').pipe("").result
write_key = json.loads("data://.my/threeza_private/write_key.json").getString())['key']
scenarios = sorted(list(np.random.randn(NUM_PREDICTIONS))
predictions = {"name":"cop.json","write_key":write_key,"values":scenarios}
submission = sc_pred.pipe(predictions).result
def apply(input):
return "Hey you need not have called but thanks for the 1000 credits"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment