smart-buildings / README.md
YasiiKB's picture
updated readme.md
4acd2cc
|
raw
history blame
3 kB
metadata
title: Smart Buildings
emoji: 🐨
colorFrom: indigo
colorTo: gray
sdk: streamlit
sdk_version: 1.25.0
app_file: dashboard.py
pinned: false

                    HOW TO RUN THE ENTIRE PIPELINE?							
                    -------------------------------							
            Datastreaming --> Datapipeline --> Dashboard					

  1. Activate the samrtbuilding environment
  2. RUN the below files from smart-buildings directory -----> cd smart-buildings
  3. RUN the mqttpublisher.py file -----> python mqttpublisher.py
  4. RUN the dashboard.py file -----> streamlit run dashboard.py.py

RTUPipeline:

This file handles the data preparation part. It first extracts the relevant parameters from the incoming data stream and creates the 30-minute data buffer for the prediction. Then apply the scaler on that buffer.

input:
    - scaler_1: Standard scaler RTU 1,2
    - scaler_2: Standard scaler RTU 2,3
    - Incoming datastream as a dataframe
output:
     - df_new1: prev 30 samples of input parameters - reshaped for RTU-1,2 prediction model 
    - df_trans1: prev 31 samples of rtu parameters - residual is
    calculated w.r.t 31st sample and predicted value 
    - df_new2: prev 30 samples of input parameters - reshaped for RTU-3,4 prediction model
    - df_trans2: prev 31 samples of rtu parameters - residual is calculated w.r.t 31st sample and predicted value

RTUAnomalizer1/2:

There are two files RTUAnomalizer1 and RTUAnomalizer2, both do the same function. One for RTU 1,2 and the other for RTU 3,4. This file handles the prediction and clustering part of the RTU anomalies/faults

input:
        model: The prediction model.
        kmeans_models: List of clustering models.
        pca_models: List of PCA models.
    df_new: prev 30 samples of input parameters - reshaped for prediction model - Received from RTUPipeline
    df_trans: prev 31 samples of input parameters - residual is calculated w.r.t 31st sample - Received from RTUPipeline
        
output:
        actual_list: List of actual values.
        pred_list: List of predicted values.
        resid_list: List of residual values.
        resid_pca_list: List of residual values after PCA transformation.
        distance_list: List of distances between residuals and cluster centers.
    resid_list for RTU 1:onverted to 0 and 1 based on the threshold
    resid_list for RTU 2: converted to 0 and 1 based on the threshold
        fault_1: Flag indicating the presence of fault in RTU 1.
        fault_2: Flag indicating the presence of fault in RTU 2.

Note:

Other branches of this repository contain tested methods for this project, including: PCA-based methods (PCA) Gaussian Process Regression (Bayesian) Long short-term memory model (lstm) Hierarchical Temporal Memory (htm)