ExamplesΒΆ

An example was created as a health monitor at the moment that a user is punching. The data EMG Physical Action Data Set was collected from UCI Machine Learning.

There is a Jupyter Notebook analysis that illustrates how different voltage signals are collected from the following muscles:

  • R-Bic: right bicep (C1)

  • R-Tri: right tricep (C2)

  • L-Bic: left bicep (C3)

  • L-Tri: left tricep (C4)

  • R-Thi: right thigh (C5)

  • R-Ham: right hamstring (C6)

  • L-Thi: left thigh (C7)

  • L-Ham: left hamstring (C8)

The analysis show how ADWIN drift detection algorithm adapts to each signal.

One example for each kind of agent was implemented:

  • Spark Monitor: as a Monitor integrated with Apache Spark Structured Streaming to read csv punching signals from muscles.

  • ADWIN Analyser: as an Analyser for each muscle signal using ADWIN from Skmultiflow to detect drifts on muscle activity.

  • Voting Planner: as a Planner for voting with a threshold 3 >= X < 8. If X muscle signals are interpreted having drift in the threshold, than it alerts a drift to the Executor.

  • Csv Executor: as an Executor that validates if filesystem is ok and saves detected Concept Drift.

As Knowledge Base TimescaleDB was chosen because it is full compatible with SQLAlchemy used in connection adapter and handles time series data very well.

The full example can be executed using Docker Compose following these 3 steps:

1. Cloning the repository:

git clone https://github.com/dmvieira/driftage.git

2. If you already have Docker Compose installed, run in driftage folder:

make example

3. Wait until Executor logs that already written drift and take a look on the file with drifts:

cat example/health_monitor/build/executor/output.csv

For more details, take a look at API.