Skip to content

Commit c398a03

Browse files
committed
Feat: Changed diagram step titles and added Type attribute to preprocessors
1 parent 592fa88 commit c398a03

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

cesnet_tszoo/configs/base_config.py

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ def _get_summary_dataset(self) -> css_utils.SummaryDiagramStep:
552552
css_utils.StepAttribute("Aggregation", self.aggregation),
553553
css_utils.StepAttribute("Source", self.source_type)]
554554

555-
return css_utils.SummaryDiagramStep("Get from dataset", attributes)
555+
return css_utils.SummaryDiagramStep("Load from dataset", attributes)
556556

557557
@abstractmethod
558558
def _get_summary_filter_time_series(self) -> css_utils.SummaryDiagramStep:
@@ -571,6 +571,7 @@ def _get_summary_preprocessing(self) -> list[css_utils.SummaryDiagramStep]:
571571

572572
for preprocess_type, train_pr, val_pr, test_pr, all_pr in list(zip(self.preprocess_order, self.train_preprocess_order, self.val_preprocess_order, self.test_preprocess_order, self.all_preprocess_order)):
573573
preprocess_title = None
574+
preprocess_type_name = None
574575
is_per_time_series = train_pr.is_inner_preprocess
575576
target_sets = []
576577
requires_fitting = False
@@ -588,32 +589,43 @@ def _get_summary_preprocessing(self) -> list[css_utils.SummaryDiagramStep]:
588589
continue
589590

590591
if train_pr.preprocess_type == PreprocessType.HANDLING_ANOMALIES:
591-
preprocess_title = self.anomaly_handler_factory.anomaly_handler_type.__name__
592+
preprocess_title = "Handle anomalies"
593+
preprocess_type_name = self.anomaly_handler_factory.anomaly_handler_type.__name__
592594

593595
if self.anomaly_handler_factory.is_empty_factory:
594596
continue
595597

596598
elif train_pr.preprocess_type == PreprocessType.FILLING_GAPS:
597-
preprocess_title = f"{self.filler_factory.filler_type.__name__}"
598-
steps.append(css_utils.SummaryDiagramStep("Pre-filling with default values", [css_utils.StepAttribute("Default values", self.default_values)]))
599+
preprocess_title = "Handle missing values"
600+
preprocess_type_name = f"{self.filler_factory.filler_type.__name__}"
601+
602+
steps.append(css_utils.SummaryDiagramStep("Pre-fill with default values", [css_utils.StepAttribute("Default values", self.default_values)]))
599603

600604
if self.filler_factory.is_empty_factory:
601605
continue
602606

603607
elif train_pr.preprocess_type == PreprocessType.TRANSFORMING:
604-
preprocess_title = self.transformer_factory.transformer_type.__name__
608+
preprocess_title = "Apply transformer"
609+
preprocess_type_name = self.transformer_factory.transformer_type.__name__
610+
605611
if self.transformer_factory.is_empty_factory:
606612
continue
607613

608614
is_per_time_series = self.create_transformer_per_time_series
609615
elif train_pr.preprocess_type == PreprocessType.PER_SERIES_CUSTOM:
610-
preprocess_title = preprocess_type.__name__
616+
preprocess_title = f"Apply {preprocess_type.__name__}"
617+
preprocess_type_name = preprocess_type.__name__
611618
elif train_pr.preprocess_type == PreprocessType.ALL_SERIES_CUSTOM:
612-
preprocess_title = preprocess_type.__name__
619+
preprocess_title = f"Apply {preprocess_type.__name__}"
620+
preprocess_type_name = preprocess_type.__name__
613621
elif train_pr.preprocess_type == PreprocessType.NO_FIT_CUSTOM:
614-
preprocess_title = preprocess_type.__name__
622+
preprocess_title = f"Apply {preprocess_type.__name__}"
623+
preprocess_type_name = preprocess_type.__name__
615624

616-
step = css_utils.SummaryDiagramStep(preprocess_title, [css_utils.StepAttribute("Requires fitting", requires_fitting), css_utils.StepAttribute("Is per time series", is_per_time_series), css_utils.StepAttribute("Target sets", target_sets)])
625+
step = css_utils.SummaryDiagramStep(preprocess_title, [css_utils.StepAttribute("Type", preprocess_type_name),
626+
css_utils.StepAttribute("Requires fitting", requires_fitting),
627+
css_utils.StepAttribute("Is per time series", is_per_time_series),
628+
css_utils.StepAttribute("Target sets", target_sets)])
617629
steps.append(step)
618630

619631
return steps

0 commit comments

Comments
 (0)