Skip to content

Instantly share code, notes, and snippets.

@aficionado
Created May 19, 2016 11:03
Show Gist options
  • Save aficionado/cfcc132f75a90fe6507d40dcfe2931f9 to your computer and use it in GitHub Desktop.
Save aficionado/cfcc132f75a90fe6507d40dcfe2931f9 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
"""A WhizzML simple example
"""
from bigml.api import BigML
API = BigML()
LIBRARY = API.create_library("(define (addition a b) (+ a b))")
API.ok(LIBRARY)
SCRIPT = API.create_script("(addition x 2)", {
"imports": [LIBRARY['resource']],
"inputs": [{"name": "x", "type": "number"}]})
API.ok(SCRIPT)
EXECUTION = API.create_execution(SCRIPT['resource'], {"inputs": [["x", 5]]})
API.ok(EXECUTION)
print EXECUTION['object']['execution']['result']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment