<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def print_to_screen(self, metrics_dict):
 """Print all metrics in metrics_dict to screen"""

        score_strings = defaultdict(list)
        for split_metric, value in metrics_dict.items():
            split, metric = split_metric.split("/", 1)

            if isinstance(value, float):
                score_strings[split].append(f"{metric}={value:0.3f}")
            else:
                score_strings[split].append(f"{metric}={value}")

        header = f"{self.unit_total} {self.log_unit[:3]}"
        if self.log_unit != "epochs":
            epochs = self.example_total / self.epoch_size
            header += f" ({epochs:0.2f} epo)"
        string = f"[{header}]:"

        if score_strings["train"]:
            train_scores = f"{', '.join(score_strings['train'])}"
            string += f" TRAIN:[{train_scores}]"
        if score_strings["valid"]:
            valid_scores = f"{', '.join(score_strings['valid'])}"
            string += f" VALID:[{valid_scores}]"
        print(string)