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 Heroku. An example of the app can be seen at http://tdi-ml-unfair-coin.herokuapp.com.
All required Python packages can be found in the requirements.txt
file. Additionally, the provided Makefile
can be used to created a virtual environment by running make venv
. You will also need a Heroku account and have installed the Heroku CLI. For more information on the Heroku CLI, go to https://devcenter.heroku.com/articles/heroku-cli#download-and-install.
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
. - open the link provided in the command line.
If you are using Windows, you can:
- create and activate the virtual environment.
set FLASK_APP="flask_app/app.py"
in the command line.- run
python -m flask run
. - open the link in the command line.
Make sure your app is ready to be deployed to Heroku by running Flask locally. To deploy to Heroku:
- clone the repository (if you haven't yet).
heroku login
and enter your credentials.heroku create
orheroku create app-name
where app-name is a custom app name.git push heroku master
.heroku open
or open the app online through your Heroku profile.
This project is distributed under the MIT license. Please see LICENSE
for more information.