Merge pull request #71 from Hestia-Homes/carbon-dev-model

400 second model
This commit is contained in:
quandanrepo 2023-10-11 16:47:13 +01:00 committed by GitHub
commit a0b91e5deb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 31 deletions

View file

@ -13,6 +13,6 @@ default:
output_filepath: ./data/model/allmodels/ output_filepath: ./data/model/allmodels/
problem_type: regression problem_type: regression
eval_metric: mean_squared_error #mean_absolute_error eval_metric: mean_squared_error #mean_absolute_error
time_limit: 60 time_limit: 400
presets: medium_quality presets: medium_quality
excluded_model_types: ['KNN', 'RF'] excluded_model_types: ['KNN', 'RF']

View file

@ -5,19 +5,18 @@ import pandas as pd
def clip_predictions_to_minimum_value( def clip_predictions_to_minimum_value(
data: pd.DataFrame, predictions: pd.Series, minimum_value: int = 1 data: pd.DataFrame,
predictions: pd.Series,
) -> pd.Series: ) -> pd.Series:
series_name = predictions.name series_name = predictions.name
predictions.name = "predictions" predictions.name = "predictions"
predictions_df = pd.concat([data, predictions], axis=1) predictions_df = pd.concat([data, predictions], axis=1)
# We expect all prediction to be atleast one point improvement # We expect all prediction to be atleast one point improvement
replace_index = ( replace_index = predictions_df["predictions"] > predictions_df["CARBON_STARTING"]
predictions_df["predictions"] > predictions_df["CARBON_STARTING"] - 1 predictions_df.loc[replace_index, "predictions"] = predictions_df.loc[
) replace_index, "CARBON_STARTING"
predictions_df.loc[replace_index, "predictions"] = ( ]
predictions_df.loc[replace_index, "CARBON_STARTING"] - minimum_value
)
predictions_new = predictions_df["predictions"] predictions_new = predictions_df["predictions"]
predictions_new.name = series_name predictions_new.name = series_name

View file

@ -29,8 +29,8 @@ stages:
outs: outs:
- path: data/prepared_data/ - path: data/prepared_data/
hash: md5 hash: md5
md5: cd9a3d5e6208c1fd5de513b4d5c51b5b.dir md5: 5fd3c01804ee2994ee77fc501d178be4.dir
size: 30121189 size: 30137355
nfiles: 2 nfiles: 2
build_model: build_model:
cmd: python 2_build_model.py cmd: python 2_build_model.py
@ -41,8 +41,8 @@ stages:
size: 5359 size: 5359
- path: data/prepared_data - path: data/prepared_data
hash: md5 hash: md5
md5: cd9a3d5e6208c1fd5de513b4d5c51b5b.dir md5: 5fd3c01804ee2994ee77fc501d178be4.dir
size: 30121189 size: 30137355
nfiles: 2 nfiles: 2
params: params:
configs/build_model.yaml: configs/build_model.yaml:
@ -58,7 +58,7 @@ stages:
output_filepath: ./data/model/allmodels/ output_filepath: ./data/model/allmodels/
problem_type: regression problem_type: regression
eval_metric: mean_squared_error eval_metric: mean_squared_error
time_limit: 60 time_limit: 400
presets: medium_quality presets: medium_quality
excluded_model_types: excluded_model_types:
- KNN - KNN
@ -66,13 +66,13 @@ stages:
outs: outs:
- path: data/model/ - path: data/model/
hash: md5 hash: md5
md5: 0d43e4ac3985da215dadf5fed8e68200.dir md5: 4b49c12395a645e35e50a9de8840f08d.dir
size: 210841782 size: 282024140
nfiles: 21 nfiles: 24
- path: metrics/fit_metrics.json - path: metrics/fit_metrics.json
hash: md5 hash: md5
md5: 06f8bb0d004b91c33493dbee9a8763e7 md5: a6d139fa59f5ddf75023bb7d3364f6d2
size: 206 size: 225
generate_predictions: generate_predictions:
cmd: python 3_generate_predictions.py cmd: python 3_generate_predictions.py
deps: deps:
@ -82,13 +82,13 @@ stages:
size: 3028 size: 3028
- path: data/model - path: data/model
hash: md5 hash: md5
md5: 0d43e4ac3985da215dadf5fed8e68200.dir md5: 4b49c12395a645e35e50a9de8840f08d.dir
size: 210841782 size: 282024140
nfiles: 21 nfiles: 24
- path: data/prepared_data - path: data/prepared_data
hash: md5 hash: md5
md5: cd9a3d5e6208c1fd5de513b4d5c51b5b.dir md5: 5fd3c01804ee2994ee77fc501d178be4.dir
size: 30121189 size: 30137355
nfiles: 2 nfiles: 2
params: params:
configs/settings.yaml: configs/settings.yaml:
@ -100,8 +100,8 @@ stages:
outs: outs:
- path: data/predictions/ - path: data/predictions/
hash: md5 hash: md5
md5: acdcb06ee7574672b1148c10c37a868b.dir md5: 8f724261b3d17bf87067e91a1ff99077.dir
size: 275959 size: 441423
nfiles: 1 nfiles: 1
generate_metrics: generate_metrics:
cmd: python 4_generate_metrics.py cmd: python 4_generate_metrics.py
@ -112,13 +112,13 @@ stages:
size: 4487 size: 4487
- path: data/predictions - path: data/predictions
hash: md5 hash: md5
md5: acdcb06ee7574672b1148c10c37a868b.dir md5: 8f724261b3d17bf87067e91a1ff99077.dir
size: 275959 size: 441423
nfiles: 1 nfiles: 1
- path: data/prepared_data - path: data/prepared_data
hash: md5 hash: md5
md5: cd9a3d5e6208c1fd5de513b4d5c51b5b.dir md5: 5fd3c01804ee2994ee77fc501d178be4.dir
size: 30121189 size: 30137355
nfiles: 2 nfiles: 2
params: params:
configs/settings.yaml: configs/settings.yaml:
@ -128,8 +128,8 @@ stages:
outs: outs:
- path: metrics/metrics.json - path: metrics/metrics.json
hash: md5 hash: md5
md5: e3bdc173023a7d909704f0313aa1609f md5: 38787835f838f65c6cc75654843eb311
size: 219 size: 223
startup_cleanup: startup_cleanup:
cmd: python 0_startup_cleanup.py cmd: python 0_startup_cleanup.py
deps: deps: