File tree Expand file tree Collapse file tree 3 files changed +22
-23
lines changed
ads/opctl/operator/lowcode/forecast/model Expand file tree Collapse file tree 3 files changed +22
-23
lines changed Original file line number Diff line number Diff line change @@ -175,10 +175,8 @@ def _build_model(self) -> pd.DataFrame:
175175 "time_series_period" : model .time_series_period ,
176176 "min_class_instances" : model .min_class_instances ,
177177 "max_tuning_trials" : model .max_tuning_trials ,
178- "contamination" : model_kwargs_cleaned .get ("contamination" , 0.01 ),
179178 "selected_model" : model .selected_model_ ,
180179 "selected_model_params" : model .selected_model_params_ ,
181- "time_budget" : time_budget ,
182180 }
183181
184182 logger .debug ("===========Forecast Generated===========" )
Original file line number Diff line number Diff line change @@ -547,14 +547,7 @@ def _save_report(
547547
548548 # model pickle
549549 if self .spec .generate_model_pickle :
550- utils .write_pkl (
551- obj = self .models ,
552- filename = "model.pkl" ,
553- output_dir = output_dir ,
554- storage_options = storage_options ,
555- )
556-
557- self ._save_model_specific_files (output_dir , storage_options )
550+ self ._save_model (output_dir , storage_options )
558551
559552 logger .info (
560553 f"The outputs have been successfully "
@@ -595,11 +588,14 @@ def _load_model(self):
595588 except :
596589 logger .info ("model.pkl is not present" )
597590
598- def _save_model_specific_files (self , output_dir , storage_options ):
599- """
600- The method that needs to be implemented on the particular model level
601- """
602- pass
591+ def _save_model (self , output_dir , storage_options ):
592+ utils .write_pkl (
593+ obj = self .models ,
594+ filename = "model.pkl" ,
595+ output_dir = output_dir ,
596+ storage_options = storage_options ,
597+ )
598+
603599
604600
605601 @runtime_dependency (
Original file line number Diff line number Diff line change @@ -323,14 +323,19 @@ def objective(trial):
323323
324324 return output_col
325325
326- def _save_model_specific_files (self , output_dir , storage_options ):
327- if self .spec .generate_model_pickle and self .trainers is not None :
328- utils .write_pkl (
329- obj = self .trainers ,
330- filename = "trainer.pkl" ,
331- output_dir = output_dir ,
332- storage_options = storage_options ,
333- )
326+ def _save_model (self , output_dir , storage_options ):
327+ utils .write_pkl (
328+ obj = self .models ,
329+ filename = "model.pkl" ,
330+ output_dir = output_dir ,
331+ storage_options = storage_options ,
332+ )
333+ utils .write_pkl (
334+ obj = self .trainers ,
335+ filename = "trainer.pkl" ,
336+ output_dir = output_dir ,
337+ storage_options = storage_options ,
338+ )
334339
335340 def _generate_report (self ):
336341 import datapane as dp
You can’t perform that action at this time.
0 commit comments