Skip to content

This repository is the official implementation of [Opening the Black Box: Towards inherently interpretable energy data imputation models using building physics insight](Energy and Buildings)

License

Notifications You must be signed in to change notification settings

Antonio955/PI_DAE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Opening the Black Box: Towards inherently interpretable energy data imputation models using building physics insight

This repository is the official implementation of [Opening the Black Box: Towards inherently interpretable energy data imputation models using building physics insight][https://doi.org/10.1016/j.enbuild.2024.114071]

Requirements

To install requirements (python 3.6.8):

pip install Keras==2.2.4
pip install optuna==1.5.0
pip install pickle5==0.0.12
pip install scipy==1.5.4
pip install tensorflow==1.14.0

Data

Download the full dataset from https://bbd.labworks.org/ds/bbd/lbnlbldg59

Preprocessing

To preprocess the data, run this command (use --help for further information):

py codes/processing.py --input_directory your_directory/lbnlbldg59/lbnlbldg59.processed/LBNLBLDG59/clean_Bldg59_2018to2020/clean data/ --output_directory your_directory/processed_data/

Day-to-day matrix

Create 10 random shuffled day-to-day matrices, by running this command (use --help for further information):

py codes/create_matrices.py --input_data your_directory/processed_data/dataset_processed.csv --output_directory your_directory/processed_data/shuffled_data/ --seeds 1

Correlations and statistics

To get the correlation coefficients and general statistics, run these command (use --help for further information):

py codes/statistics.py --path your_directory
py codes/statistics_training.py --path your_directory

Tuning

To tune the model(s) in the paper, run this command (use --help for further information):

py codes/tune.py --path your_directory --lambdaa 1 --features 4 --target t_ra --corr 0.2

Tuned hyperparameters can be accessed here: your_directory/Results/Tuning.csv

Training

To train the model(s) in the paper, run this command (use --help for further information):

py codes/train.py --path your_directory --threshold_q_cool 50 --threshold_q_heat 20 --train_rate 0.1 --seeds_coeff 0 --aug 80 --lambdaa 1 --features 4 --target t_ra

Evaluation

To evaluate the model(s) in the paper, run these commands (use --help for further information):

py codes/evaluate.py --path your_directory --threshold_q_cool 50 --threshold_q_heat 20 --train_rate 0.1 --aug 80 --lambdaa 1 --features 4 --target t_ra
py codes/computational_req.py --path your_directory --train_rate 0.1 --lambdaa 1 --features 4 --target t_ra
py codes/LIN_train_evaluate.py --path your_directory --threshold_q_cool 50 --threshold_q_heat 20 --train_rate 0.1
py codes/KNN_train_evaluate.py --path your_directory --threshold_q_cool 50 --threshold_q_heat 20 --train_rate 0.1

Pre-trained Models

You can access the pretrained models here: your_directory/results/pre_trained_models/

Physics-based coefficients

To print the optimized physics-based coefficients, run this command (use --help for further information):

py codes/physics_coeff_print.py --path your_directory --threshold_q_cool 50 --threshold_q_heat 20 --seeds_coeff 0

Results

Complete results (including physics-based coefficients, trainable parameters, computational requirements and cluster documentation) can be accessed here: your_directory/results/Results.xlsx

To reproduce the plots in the paper, run these commands (use --help for further information):

py codes/draw_days.py --path your_directory --threshold_q_cool 50 --threshold_q_heat 20 --train_rate 0.1 --aug 80 --lambdaa 1 --features 4 --target t_ra  --corr 0.2 --seeds 1
py codes/computational_curves_draw.py --path your_directory
py codes/learning_curves_avg_draw.py
py codes/learning_curves_std_draw.py
py codes/physics_coeff_draw.py
py codes/physics_coeff_draw_2.py

Contributing

MIT License

About

This repository is the official implementation of [Opening the Black Box: Towards inherently interpretable energy data imputation models using building physics insight](Energy and Buildings)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages