mirror of
https://github.com/Hestia-Homes/ML.git
synced 2026-06-08 11:17:25 +00:00
add optimised model
This commit is contained in:
parent
bcd2383d8d
commit
51b7049720
5 changed files with 12 additions and 13 deletions
|
|
@ -93,10 +93,8 @@ def build_model(
|
|||
logger.info("--- Training model ---")
|
||||
logger.info("----------------------")
|
||||
|
||||
model_train_data = train_data.drop(columns=identifier_columns)
|
||||
|
||||
model.train_model(
|
||||
data=model_train_data,
|
||||
data=train_data.drop(columns=identifier_columns),
|
||||
target=target,
|
||||
model_hyperparameters=model_hyperparameters,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
default:
|
||||
build_model:
|
||||
model_type: AutogluonAutoML
|
||||
model_save_filepath: ./data/model/autogluonmodel/
|
||||
model_save_filepath: ./data/model/optimised/
|
||||
fit_metrics_filepath: ./metrics/fit_metrics.json
|
||||
|
||||
SKLearnLinearRegression: null
|
||||
|
|
@ -10,9 +10,9 @@ default:
|
|||
kernel: "linear"
|
||||
|
||||
AutogluonAutoML:
|
||||
output_filepath: ./data/model/autogluonmodel/
|
||||
output_filepath: ./data/model/allmodels/
|
||||
problem_type: regression
|
||||
eval_metric: mean_squared_error #mean_absolute_error
|
||||
time_limit: 1000
|
||||
time_limit: 4000
|
||||
presets: medium_quality
|
||||
excluded_model_types: ['KNN', 'RF']
|
||||
|
|
|
|||
|
|
@ -165,8 +165,12 @@ class AutogluonAutoML:
|
|||
if self.model is None:
|
||||
raise KeyError("No model trained/ loaded - unable to save")
|
||||
|
||||
logger.info("In local development mode - no need for s3 client")
|
||||
logger.info("Using AutoGluon Model - Model saving already occured")
|
||||
logger.info(
|
||||
"Using AutoGluon Model - Model saving is using optimised deployment mode"
|
||||
)
|
||||
|
||||
logger.info("Saving optimised model")
|
||||
self.model.clone_for_deployment(str(path))
|
||||
|
||||
return str(path)
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ stages:
|
|||
params:
|
||||
configs/settings.yaml:
|
||||
default.feature_processor.feature_processor_config.drop_columns:
|
||||
- UPRN
|
||||
- HEAT_DEMAND_CHANGE
|
||||
- CARBON_CHANGE
|
||||
- RDSAP_CHANGE
|
||||
|
|
@ -30,8 +29,8 @@ stages:
|
|||
outs:
|
||||
- path: data/prepared_data/
|
||||
hash: md5
|
||||
md5: 951ad046d4fca2b977a314f9520e8235.dir
|
||||
size: 28249626
|
||||
md5: 26f4de635a4c10cd4a07df1ffb4bbb2c.dir
|
||||
size: 33889000
|
||||
nfiles: 2
|
||||
build_model:
|
||||
cmd: python 2_build_model.py
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
/fit_metrics.json
|
||||
/metrics.json
|
||||
Loading…
Add table
Reference in a new issue