This repository creates a web app that simulates the evolving probability distribution of an unfair coin to come up heads using Bayes's theorem. The prior distribution is a Beta distribution with both shape parameters set to one, resulting in a uniform distribution. This repository is ready to deploy a web application using Flask and Bokeh to services such as Render. An example of the app can be seen at here.
You will need either Python 3.8 or 3.9. All required Python packages can be found in the requirements.txt
file.
You may want to run the app using Flask locally before deploying it to Heroku, especially if you have made any changes to the code. To run locally:
- clone the repository.
- in the repository, run
make deploy-prod
. - open the link provided in the command line.
Alternatively, you can deploy using Docker. You can run using make docker-deploy
or
docker build -t unfair-coin-bayes .
docker run --init --rm -d --publish 127.0.0.1:8000:8000 --env SECRET_KEY=$(bin/set-secret-key --) unfair-coin-bayes
This project is distributed under the MIT license. Please see LICENSE
for more information.