Giter Site home page Giter Site logo

banditapi-client's Introduction

I created an API for running website tests using bandit algorithms. There is much more info at http://banditapi.herokuapp.com. This is a python client library for accessing the API.

Features that work so far:

  • getting info on a running test
  • selecting an arm to display
  • updating the algorithm with the test results

Features that haven't been implemented yet:

  • create a new test

Usage

B = bandits.BanditAPI('my_test_id', 'my_public_key', 'my_private_key')
B.info()
# {u'algorithm': u'epsilon_greedy', u'epsilon': 0.6, u'n_arms': 3, 
# u'values': [0.24324324324324326, 0.3399999999999999, 0.11538461538461538], 
# u'owner': u'[email protected]', u'counts': [37, 50, 26], 
# u'test_id': u'my_test2'}

chosen_arm = B.select_arm()
# {u'arm': 1}

B.update(chosen_arm['arm'], 0.0)
# {u'total_arm_value': 0.26315789473684215, u'arm': 1, u'pull_count': 38}

Installing

The only dependency is the requests python package. You can install that with the command pip install requests or easy_install requests.

Aside from that, just include the bandits.py file wherever you need it.

banditapi-client's People

Watchers

Alexander Gallego avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.