Commit 869c39b4 authored by Yuncong Yu's avatar Yuncong Yu
Browse files

Updated README

parent b09bb719
......@@ -3,19 +3,23 @@
[![](http://img.youtube.com/vi/oJfXoDyZRPY/0.jpg)](http://www.youtube.com/watch?v=oJfXoDyZRPY "")
## Introduction
**PSEUDo** is an application that provides a way to search, explore and find interesting patterns in large multivariate time series data whilst giving a clear understanding of what's going on behind the scenes on the machine learning side. This is done by combining the vast knowledge of domain-experts with the immense processing power of computers, creating the interactive machine learning tool called **PSEUDo**.
**PSEUDo** is an application to explore large multivariate time series and query interesting patterns
while enabling a clear understanding of what's going on behind the scenes on the machine learning side.
This is achieved by combining the vast knowledge of domain-experts with the immense processing power of computers,
creating the interactive machine learning tool called **PSEUDo**.
The application consists of two parts:
1. A client side, which is an Angular application
2. A server side, which is a Flask REST API written in Python
The application consists of three parts:
1. An Angular web application on the client side
2. A Python Flask backend with REST API on the server side
3. A query-aware locality-sensitive hashing algorithm library in C++
## Setup
To run the application, make sure you've installed the following:
1. Python >=3.5: https://www.python.org/downloads/
2. Conda: https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html
1. Python >=3.5 e.g. from https://www.python.org/downloads/
2. Conda e.g. from https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html
3. Angular: https://angular.io/guide/setup-local
4. Java: https://www.java.com/en/download/help/download_options.html
5. `make` in git Bash in Windows: https://gist.github.com/evanwill/0207876c3243bbb6863e65ec5dc3f058
5. (Only for Windows) `make` in git Bash: https://gist.github.com/evanwill/0207876c3243bbb6863e65ec5dc3f058
### Step 1: Creating an environment
All dependencies are listed in the *environment.yml* file. To create an environment, run the following command:
......@@ -24,55 +28,81 @@ This will create a conda environment named *pseudo*. Now activate the environmen
`conda activate pseudo`
### Step 2: Prepare backend - creating the LSH package
The LSH algorithm is maintained locally for now, so you'll have to create it manually. The file that you need to setup this package is located in the Flaskserver folder (this is more efficient when debugging, as for every change you have to rebuild the package). So the package can be created by running the following code:
The LSH algorithm is maintained locally for now, so you'll have to create it manually. The file that you need to setup this package is
located in the backend folder (this is more efficient when debugging, as for every change you have to rebuild the package).
So the package can be created by running the following code:
`cd backend\libs`
`python3 setup.py build_ext --inplace && python3 setup.py install`
`cd ..`
**NOTE 1**: So as a reminder, don't forget to run the 2nd line everytime you change something in the c++ code.
### Step 3: Prepare frontend - install Node packages
The cloned Angular repository cannot be used directly. You have to install the node packages via
The cloned Angular application cannot be launched directly. You have to install the node packages via
`cd frontend`
`npm install`
### Step 4: Running PSEUDo
As mentioned before, PSEUDo exists of a gui and a server. A Makefile is provided to setup both easily. Just run the following code for the server and gui respectively:
As mentioned before, PSEUDo has of a user interface and a server.
A Makefile is provided to setup both easily.
Just run the following commands from PSEUDo's root directory for the server and ui respectively:
`make server`
`make gui`
A browser window should automatically be opened when running the GUI. If not, visit http://localhost:4200/
**NOTE 1**: Both gui and server will need their own terminal window.
**NOTE 2**: Make sure the pseudo environment is activated (step 1) when running the server, otherwise you'll get ModuleNotFound errors.
`make ui`
A browser window should automatically be opened when running the UI. If not, visit http://localhost:4200/
**NOTE 1**: Both ui and server needs their own terminal window.
**NOTE 2**: Make sure the pseudo environment is activated (as described in step 1) when running the server,
otherwise you'll get ModuleNotFound errors.
# Documentation
## GUI
The GUI is an Angular framework. It consists of views (components) and a state (service). Every time an API call is done, the state will alter. Using hooks (EventEmitters), views can subscribe state variable changes and alter their view using the new value(s). The types of views is listed below.
## UI
The UI is backed up by the Angular framework.
It consists of views (components), a state service and an API service.
Every time an API call finishes, the state changes.
Using hooks (EventEmitters), views can subscribe state variable changes and refresh their view with new values.
The views are listed below.
### Overview
This view shows the entire dataset. When windows are labeled and candidates are generated, it should show the locations in this overview.
shows the entire dataset.
Upon receiving labels and predictions, it shows the locations of labels and predictions in this overview.
### Query
This view shows the current query.
shows the current query.
### Training
This view shows the sampled candidates. In this view the user can label the samples as correct or incorrect. When the user is satisfied the labels will be updated and new samples will be generated.
shows the sampled predictions.
In this view the user can label the samples as correct or incorrect.
When the user is satisfied and klick the "Train" button, the labels will be updated and new samples will be generated.
### Progress
This view will show the progress of the learned classifier. It should show whether the classifier is getting better at understanding the desired pattern
shows the progress of the learned classifier.
It shows whether the classifier is getting better at understanding the desired pattern
### Labels
This view shows the currently labeled windows. The user should be able to change and delete labels in this view.
shows the currently labeled windows. The user should be able to change and delete labels in this view.
## API
### /read-data
This API call reads time series data from a file and returns the values and indices.
### /load-data
reads time series data from a file and returns the values and indices.
### /create-windows
This API call reads time series data and chunks it into windows. For now the windows are saved to a file locally.
reads time series data and chunks it into windows. For now the windows are saved to a file locally.
### /get-lsh-parameters
This API call calculates the necessary LSH parameters based on the dataset
calculates the necessary LSH parameters
- envolope `r`,
- mean distances of all samples pairs `a` and
- standard deviation of all sample pairs `sd1
based on the dataset.
### /initialize
This API call starts the first iteration of the LSH algorithm. First some essential parameters are calculated. Then the LSH algorithm is called. The API returns the candidates, distances and hash functions.
starts the initial iteration of the LSH algorithm.
First some essential parameters are calculated.
Then the LSH algorithm is called.
The API returns the candidates, distances and hash functions.
### /weights
This API calculates the new weights for the hash function distributions, based on the relevance feedback given by the user.
calculates the new weights for the hash function distributions, based on the relevance feedback given by the user.
### /update
This API call runs the LSH algorithm with weights that will manipulate the hashing functions. The API returns the candidates, distances and hash functions.
runs the LSH algorithm with weights that will manipulate the hashing functions.
The API returns the candidates, distances and hash functions.
### /query
This API will return the query data based on the provided window indices. If only one index is given, the API call will return the window values according to the index. If multiple indices are given, the DTW-based average of the window values according to the indices is returned.
returns the query data based on the provided window indices.
If only one index is given, the API call will return the window values according to the index.
If multiple indices are given, the DBA-based average of the indexed windows is returned.
### /window
This API simply returns the window values according to the index.
simply returns the window values according to the index.
### /table-info
This API call will return extra info needed for the progression view. The input will be a subdivision of windows into buckets, and for each bucket the prototype (average) will be calculated + the distances between each prototype.
returns extra info needed for the progression view.
The input will be a subdivision of windows into buckets,
and for each bucket the prototype (average) will be calculated + the distances between each prototype.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment