/muvr-analytics-1

Deep analytics and learning for muvr

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Muvr

muvr is a demonstration of an application that uses wearable devices (Pebble)—in combination with a mobile app—to submit physical (i.e. accelerometer, compass) and biological (i.e. heart rate) information to a CQRS/ES cluster to be analysed.

muvr-analytics

muvr-analytics contains analytics pipelines external to the main application, including

  • pipelines to suggest future exercise sessions
  • pipelines to classify users to groups by attribute similarity
  • pipelines to improve classification and other models
  • pipelines to train models to recognize repetitions of exercises

This part of the project can be viewed as a data science playground. The models used in the application are trained using spark jobs written in either scala or python. Tasks that require more explorational analysis can be done using R.

Other components of the system

Getting started

Basic information to get started is below. Please also have a look at the other components of the system to get a better understanding how everything fits together.

Installation

Make sure your Java is up to date (>= 1.8.0) and you got sbt installed .

git clone git@github.com:muvr/muvr-analytics.git

# To deserialize the messages stored in the cassandra cluster 
# we need some libraries of the `muvr-server`
git clone git@github.com:muvr/muvr-server.git

cd muvr-analytics

There are two steps to train models that can be used by mobile clients. First the data needs to be prepared. This includes reading data from the cassandra cluser and grouping it in a way that a single group contains all examples the machine learning algorithm will be trained on.

# Build the jar that will be run using spark
sbt assembly

# To run the data preparation pipeline use the scala spark job
./run_spark.sh "basic.DatasetExtractionMain"

The second step is to train a machine learning model for each of this groups.

cd mlp
./run_spark.sh

This will train a Multi Layer Perceptron on the previously generated datasets.

Setup Python environment

cd muvr-analytics
./init-env.sh

To start development on Python code or notebooks

source venv/bin/activate
# After you call this line, you should see (venv) added at the beginning of your shell prompt. 

Start notebooks

jupyter notebook

Issues

For any bugs or feature requests please:

  1. Search the open and closed issues list to see if we're already working on what you have uncovered.
  2. Make sure the issue / feature gets filed in the relevant components (e.g. server, analytics, ios)
  3. File a new issue or contribute a pull request

License

Please have a look at the LICENSE file.