Prevent: An Unsupervised Approach to Predict Software Failures in Production
Authors/Creators
- 1. University of Milano-Bicocca
- 2. Università della Svizzera Italiana (USI)
- 3. Constructor Institute
Description
Prevent combines the elements of machine learning and statistical data analysis into a unique approach to predict failures and identify their root causes in complex, dynamic software systems, all without the need for predetermined rules or supervised training against documented failure cases.
The results of experiments on a distributed, cloud-based system that meets commercial standards show that Prevent provides more consistent, reliable and timely predictions than supervised learning approaches. Importantly, Prevent achieves these results without requiring lengthy and often infeasible supervised training sessions.
INSTRUCTIONS
# ---------- Prerequisites
# Machine configuration we used in our experiments:
- Type: Google Cloud VM instance e2-standard-4
- Resources: 2 vCPU, 4GB memory, disc space 30GB.
- OS: Ubuntu 20.04 LTS. x86/64, amd64 focal image built on 2023-06-16, supports Shielded VM features
# Software:
- Matlab (We trained and used the Prevent-E RBM network on MacOS using the version of Matlab 2020b)
- python 3 (we used version 3.8.10)
# ---------- Deployment
# Update the package manager
sudo apt update
# Make python3 default
nano ~/.bashrc
add the string and save/close: alias python=python3
source ~/.bashrc
# Install pip for python3
sudo apt install python3-pip
# Upgrade pip
python -m pip install --upgrade pip
# Check the version of Python (we used version 3.8.10)
python --version
# Check the version of pip (we used version 20.0.2)
pip --version
# Install screen tool
sudo apt install screen
# Install Python virtual environment
sudo apt install python3.8-venv
# Install git
sudo apt install git
# Install Jupyter Lab
pip3 install jupyterlab
# Go to the Anomaly Ranker folder
cd AnomalyRanker
# Create/Go to the Anomaly Ranker screen
screen -S prevent_anomaly_ranker
# Create/Activate virtual environment for Anomaly Ranker
python -m venv venv
source venv/bin/activate
# Install Python packages for Anomaly Ranker
python -m pip install -r requirements.txt
# Start the Anomaly Ranker server
python ranker_app.py 5006
# Exit from the screen
CTRL + A + D
# Go to the root folder
cd ..
# Create/Go to the Prevent screen
screen -S prevent
# Create/Activate virtual environment for Prevent and Premise
python -m venv venv
source venv/bin/activate
# Install Java
sudo apt install default-jre
sudo apt install default-jdk
# Install the python-javabridge package
pip3 install git+https://github.com/LeeKamentsky/python-javabridge.git
# expected result: Successfully installed javabridge-1.0.19
# Install Python packages for Prevent and Premise
python -m pip install -r requirements.txt
# Install jupyter kernel
python -m ipykernel install --user --name=Kernel-prevent-23
# Add the path to jupyterlab (alternative way: log out/in)
PATH="$PATH:$HOME/.local/bin/"
# Start Jupiter Lab (copy the auth token from the Jupiter Lab start command output)
jupyter lab --port 5601 --ip 0.0.0.0
# Exit the screen
CTRL + A + D
# ---------- Run
# Note: use the Kernel-prevent-23 kernel for all notebooks
1. Start Matlab
2. Go to the Prevent-E folder in Matlab
3. Run Main.m script <-- Generates predictions using RBM neural network (Prevent-E)
Note: If you run Matlab on a separate machine, move the files in the resources/predictions-e folder to the same folder on the machine you run Jupiter lab
4. Open Jupiter Lab in your browser: {machine IP address}:5601 (your firewall must allow inbound connections on this port)
5. Run all in the prevent_a.ipynb notepad <-- Detects anomalies for Premise and Anomaly Ranker and generates predictions using Autoencoder neural network (Prevent-A), localizes failure using Anomaly Ranker
6. Run all in the premise.ipynb notepad <-- Generates predictions using Logistic Model Tree (Premise)
7. Run all in the results.ipynb notepad <-- Analyses and visualizes the results
Files
AnomalyRanker.zip
Files
(88.0 MB)
| Name | Size | |
|---|---|---|
|
md5:7fa452a15ce21df0b65ac8013e9e6360
|
10.3 MB | Preview Download |
|
md5:b08b9ba3e6e3f88a5b88c58aed3a678b
|
298.1 kB | Preview Download |
|
md5:4b8cb900ef72419ac297346112b10662
|
1.4 MB | Preview Download |
|
md5:46b700c9d52ec02b15a012e7ead98c76
|
659.7 kB | Preview Download |
|
md5:0afa8d3a28cd27bce9d15535f0cd9c25
|
3.2 kB | Preview Download |
|
md5:9e6431d0f315fcefb84f6a9c8eb245f9
|
267 Bytes | Preview Download |
|
md5:5dcfd36b2a94c566bb63bdab9999e616
|
75.2 MB | Preview Download |
|
md5:c11420446f2cad632411b47d77c198ad
|
97.6 kB | Preview Download |