Merge pull request #145 from Hestia-Homes/sap-dev-model

add model with new data
This commit is contained in:
KhalimCK 2024-10-08 15:30:49 +01:00 committed by GitHub
commit c12af458d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 50 additions and 40 deletions

View file

@ -13,7 +13,11 @@ RUN yum install -y gcc python3-devel gcc-c++
# Install python packages
COPY modules/ml-pipeline/src/pipeline/requirements/predictions/requirements.txt ./requirements.txt
RUN pip install --no-cache-dir -r ./requirements.txt
RUN pip install uv
RUN uv pip install -r requirements.txt --system
# RUN pip install --no-cache-dir -r ./requirements.txt
# Copy the project code
COPY modules/ml-pipeline/src/pipeline ./pipeline

View file

@ -6,7 +6,12 @@ RUN apt-get update && apt-get install -y libgomp1 gcc python3-dev
COPY pipeline/requirements/predictions/requirements.txt requirements.txt
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
RUN pip install uv
RUN uv pip install -r requirements.txt --system
# RUN pip install -r requirements.txt
# Assuming in the CI/CD step, there will be a dvc pull step to get data and model, so will just need to run a single script
COPY pipeline/ /home/pipeline/

View file

@ -3,11 +3,8 @@ default:
input_dataclient_type: aws-s3
output_dataclient_type: local
scenario_data_filepaths:
# - s3://retrofit-data-dev/scenario_data/22-03-2024-19-20-09/recommendations_scoring_data.parquet
# - s3://retrofit-data-dev/scenario_data/24-03-2024-20-23-25/recommendations_scoring_data.parquet
# - s3://retrofit-data-dev/scenario_data/27-03-2024-11-38-15/recommendations_scoring_data.parquet
# - s3://retrofit-data-dev/scenario_data/26-05-2024-08-47-45/recommendations_scoring_data.parquet
# - s3://retrofit-data-dev/scenario_data/26-05-2024-10-44-53/recommendations_scoring_data.parquet
- s3://retrofit-data-dev/scenario_data/28-05-2024-19-22-41/recommendations_scoring_data.parquet
# - s3://retrofit-data-dev/scenario_data/28-05-2024-19-22-41/recommendations_scoring_data.parquet
# - s3://retrofit-data-dev/scenario_data/07-10-2024-16-26-06/recommendations_scoring_data.parquet
- s3://retrofit-data-dev/scenario_data/08-10-2024-15-07-33/recommendations_scoring_data.parquet
comparison_output_filepath: ./metrics/scenario_table.md
metrics_output_filepath: ./metrics/scenario_metrics.md

View file

@ -18,10 +18,8 @@ default:
prepare_data:
input_dataclient_type: aws-s3
output_dataclient_type: local
# data_filepath: s3://retrofit-data-dev/sap_change_model/2024-03-22-18-56-53/dataset_rooms.parquet
# data_filepath: s3://retrofit-data-dev/sap_change_model/2024-05-25-08-36-36/dataset_rooms.parquet
# data_filepath: s3://retrofit-data-dev/sap_change_model/2024-05-26-10-31-39/dataset_rooms.parquet
data_filepath: s3://retrofit-data-dev/sap_change_model/2024-05-28-19-08-25/dataset_rooms.parquet
# data_filepath: s3://retrofit-data-dev/sap_change_model/2024-05-28-19-08-25/dataset_rooms.parquet
data_filepath: s3://retrofit-data-dev/sap_change_model/2024-10-03-22-57-23/dataset_rooms.parquet
train_proportion: 0.9
output_train_filepath: ./data/prepared_data/train.parquet
output_test_filepath: ./data/prepared_data/test.parquet
@ -37,7 +35,7 @@ default:
drop_columns: [
"heat_demand_change", "carbon_change", "rdsap_change", "heat_demand_ending", "carbon_ending", "days_to_starting", "days_to_ending",
'number_habitable_rooms_starting', 'number_habitable_rooms_ending', 'number_heated_rooms_starting', 'number_heated_rooms_ending',
'number_habitable_rooms', 'number_heated_rooms']
'number_habitable_rooms', 'number_heated_rooms', 'lighting_cost_starting', 'lighting_cost_ending', 'heating_cost_starting', 'heating_cost_ending', 'hot_water_cost_starting', 'hot_water_cost_ending',]
retain_features: null
# retain_features: ['uprn', 'sap_starting', 'hot_water_energy_eff_ending',
# 'mainheat_energy_eff_ending', 'constituency', 'roof_energy_eff_ending',

View file

@ -34,13 +34,19 @@ stages:
- number_heated_rooms_ending
- number_habitable_rooms
- number_heated_rooms
- lighting_cost_starting
- lighting_cost_ending
- heating_cost_starting
- heating_cost_ending
- hot_water_cost_starting
- hot_water_cost_ending
default.feature_processor.feature_processor_config.retain_features:
default.feature_processor.feature_processor_config.subsample_amount:
default.feature_processor.feature_processor_config.subsample_seed: 0
default.feature_processor.feature_processor_config.target: sap_ending
default.feature_processor.feature_processor_type: dataframe
default.prepare_data.data_filepath:
s3://retrofit-data-dev/sap_change_model/2024-05-28-19-08-25/dataset_rooms.parquet
s3://retrofit-data-dev/sap_change_model/2024-10-03-22-57-23/dataset_rooms.parquet
default.prepare_data.input_dataclient_type: aws-s3
default.prepare_data.output_dataclient_type: local
default.prepare_data.output_test_filepath: ./data/prepared_data/test.parquet
@ -49,8 +55,8 @@ stages:
outs:
- path: data/prepared_data/
hash: md5
md5: 80c9e138146a1d96b9d16091c207e2e8.dir
size: 45056059
md5: 8ce9c629a531d54fa9b0bfc305391400.dir
size: 49665833
nfiles: 2
build_model:
cmd: python 2_build_model.py
@ -61,8 +67,8 @@ stages:
size: 4820
- path: data/prepared_data
hash: md5
md5: 80c9e138146a1d96b9d16091c207e2e8.dir
size: 45056059
md5: 8ce9c629a531d54fa9b0bfc305391400.dir
size: 49665833
nfiles: 2
params:
configs/build_model.yaml:
@ -94,18 +100,18 @@ stages:
outs:
- path: data/fit_predictions/
hash: md5
md5: d9c9afc05e8780db47c0548b19bf7d19.dir
size: 3349989
md5: 9dafd875d76676a06890af9be8778567.dir
size: 3617506
nfiles: 1
- path: data/model/
hash: md5
md5: 13c3100e1486c27a83a8a47491077842.dir
size: 773523079
md5: 36fb8323508e968a297d650954ccbc58.dir
size: 800833479
nfiles: 36
- path: metrics/fit_metrics.json
hash: md5
md5: 2ff70a2a45813e1bcdf2ea3aa8e07d4a
size: 224
md5: e2bc34ae26afbb854f0b021d12b1b569
size: 223
generate_predictions:
cmd: python 3_generate_predictions.py
deps:
@ -115,13 +121,13 @@ stages:
size: 2464
- path: data/model
hash: md5
md5: 13c3100e1486c27a83a8a47491077842.dir
size: 773523079
md5: 36fb8323508e968a297d650954ccbc58.dir
size: 800833479
nfiles: 36
- path: data/prepared_data
hash: md5
md5: 80c9e138146a1d96b9d16091c207e2e8.dir
size: 45056059
md5: 8ce9c629a531d54fa9b0bfc305391400.dir
size: 49665833
nfiles: 2
params:
configs/settings.yaml:
@ -133,8 +139,8 @@ stages:
outs:
- path: data/predictions/
hash: md5
md5: 5d07bcebf3160a72bb18dfd79106e85c.dir
size: 463197
md5: 8f4de36de171006cb6d9eacff7718ba3.dir
size: 508400
nfiles: 1
generate_metrics:
cmd: python 4_generate_metrics.py
@ -145,13 +151,13 @@ stages:
size: 3484
- path: data/predictions
hash: md5
md5: 5d07bcebf3160a72bb18dfd79106e85c.dir
size: 463197
md5: 8f4de36de171006cb6d9eacff7718ba3.dir
size: 508400
nfiles: 1
- path: data/prepared_data
hash: md5
md5: 80c9e138146a1d96b9d16091c207e2e8.dir
size: 45056059
md5: 8ce9c629a531d54fa9b0bfc305391400.dir
size: 49665833
nfiles: 2
params:
configs/settings.yaml:
@ -161,8 +167,8 @@ stages:
outs:
- path: metrics/metrics.json
hash: md5
md5: 3e08df02fd5c5d094bcf936e1338d596
size: 223
md5: 58e25eb5e1699dbb33e78af9ba4c2964
size: 222
generate_scenerio_metrics:
cmd: python 5_generate_scenarios.py
deps:
@ -176,15 +182,15 @@ stages:
input_dataclient_type: aws-s3
output_dataclient_type: local
scenario_data_filepaths:
- s3://retrofit-data-dev/scenario_data/28-05-2024-19-22-41/recommendations_scoring_data.parquet
- s3://retrofit-data-dev/scenario_data/08-10-2024-15-07-33/recommendations_scoring_data.parquet
comparison_output_filepath: ./metrics/scenario_table.md
metrics_output_filepath: ./metrics/scenario_metrics.md
outs:
- path: metrics/scenario_metrics.md
hash: md5
md5: fa4d6d7bbd7818613800da5f8f37ea96
md5: 746ffa7d10fcdceaf2330d07c7ee623b
size: 363
- path: metrics/scenario_table.md
hash: md5
md5: d6baf100a1623cc2467c2f8221d314c9
size: 2133
md5: 3b7dfc36054bce065f849423abf31a5d
size: 969