Skip to content

vmarchaud/ts-mab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi Armed Bandit

Wanted to test a typescript implementation and specially easily scaling it. The service in itself is stateless and push consistency the datastore, which is redis.

I used the thompson-sampling implementation from this repository because i'm no math expert but other implemtation can be easily added (see src/bandits/impls/).

API

The service expose a simple API that expose the MAB logic so you can built on it, here are the endpoints:

Method HTTP request Description
create PUT /bandits/{id}
get GET /bandits/{id}
pick GET /bandits/{id}/pick/{pickId}?count={count} You can use count if you want to make multiple pick within the same request
reward GET /bandits/{id}/reward/{arm}
update POST /bandits/{id}

All URIs are relative to http://localhost/api

Releases

No releases published

Packages

No packages published