Public | Automated Build

Last pushed: 2 years ago
Short Description
Fitomo prediction service
Full Description

Fitomo Prediction Service

Fitomo Prediction Service is a tool to forecast users' future health, based on their current steps, sleep and heart rate data as well as previous trends.

Table of Contents

  1. Usage
  2. Getting started
    1. Clone the latest version
    2. Setup Environment
    3. Install dependencies
    4. Run the application
  3. Tech Stack
  4. Directory Layout
  5. Contributing
  6. License


This service takes 'GET' requests at '/api/getPrediction'; data to include is a dictionary with the following keys:


The service will then output the current health score and predicted health score (calculated using a gradient boosting regression). Incorrect requests will not return health scores.

Getting started

1. Clone the latest version

Start by cloning the latest version of the Fitomo Prediction Service on your local machine by running:

  $ git clone
  $ cd Prediction-Service

2. Setup Environment

  1. Install virtualenv:

    $ pip install virtualenv
  2. Setup a virtual environment for the application:

    $ virtualenv venv
    $ source venv/bin/activate

3. Install Dependencies

From within the root directory run the following command to install all dependencies:

  $ pip install -r requirements.txt

4. Run the application

  1. Start your local PostgreSQL database instance

  2. Run the following command in your terminal to run the app:

    $ python app/

    After that open in your browser the localhost with your chosen port, e.g. http://localhost:5000/ to access the application.

Tech Stack

Back end:
  • Flask
  • PostgreSQL
  • SQLAlchemy
  • Scikit-Learn

Directory Layout

├── /algorithm/                          # Algorithm-related code
│   ├── /  # Creating and tuning the algorithm
│   ├── /data_prep/                      # Prepping and cleaning code for the algorithm
│     ├── /                # Putting data into useful format for the algorithm
│     ├── /       # Prepare generated user data to be cleaned
│   ├── /results/                        # Results and analysis of algorithm
│     ├── /  # Prepare generated user data to be cleaned
├── /app/                                # Server source code
│   ├── /migrations/                     # Database migration data
│   ├── /                         # Core server file
│   ├── /                      # Configs for different situations
│   ├── /                      # Manage database migrations
│   ├── /                      # Data model
│   ├── /health_prediction.pkl/          # Prediction algorithm
├── /tests/                              # Server and client side tests
└── requirements.txt                     # List of 3rd party libraries and utilities to be installed
└── .env                                 # Environment variables


  1. Fork the repo.
  2. Clone it to your local computer
  3. Cut a namespaced feature branch from master and name it appropriately
  4. Make commits and prefix each commit with the type of work you were doing
  5. BEFORE PUSHING UP YOUR CHANGES, rebase upstream changes into your branch, fix any potential conflicts, and then push to your fork.
  6. Submit a pull request directly to the master
  7. Someone else will perform code review to keep codebase clean
  8. Fix any errors or issues raised by the reviewer and push the fixes as a single new commit
  9. Repeat until the pull request is merged.

See for contribution guidelines in detail.



Docker Pull Command
Source Repository