To click, or not to click, that is the question
... that we are trying to answer automatically, once and for all, by using machine learning.
This project is hosted on Github at https://github.com/lePerdu/cwaas and deployed using Github Pages and Heroku, web-accessible at https://clickworthiness.online.
The back end is developed usng Python, with the scikit-learn
library. Machine-learning and data-processing protions of the code are in the
ml/
subdirectory. main.py
is used to train the model, exporting a
pickle file to models/
.
The front end is coded in Elm and deployed using Github Pages. We have the domain clickworthiness.online, registered using Domain.com, which can be accessed gobally.
Server code is in the server/
subdirectory. It uses the
Flask framework to make a
simple JSON api which uses the model trained by main.py
. The server is
deployed with the pickle to Heroku and hosted at
https://clickworthiness.herokuapp.com (CORS is enabled so that it can be
accessed from the clickworthiness.online domain).
To minimize dependency problems, it is recommended to use a virtual environment. Basic setup is:
# Create a virtual environment
python3 -m venv venv
# On Mac or Linux
source venv/bin/activate
# On Windows cmd.exe
venv\Scripts\activate.bat
# On Windows PowerShell
venv\Scripts\Activate.ps1
# Install packages
pip install -r requirements.txt
Once the virtual environment has been created and the packages have been
installed, it can just be entered by running the activate
script.