string_formatter
log.string_formatter
list_to_pretty_string
list_to_pretty_string(list_of_number: List[Union[int, float]], row_name: str = None, each_length: int = 10, indent: int = 12) -> str
list of Union[int, float] string으로 바꾸는 함수입니다. each_length의 길이가 되도록 " "를 늘려줍니다. log 예시:
Args: list_of_number (List[Union[int, float]]): 숫자가 들어있는 list입니다. row_name (str, optional): 각 row의 이름을 넣어줍니다. Defaults to None. each_length (int, optional): 각 원소마다 가지는 길이. Defaults to 10. indent (int, optional): indentation. Defaults to 12.Returns: str
Source code in SaigeToolkit/log/string_formatter.py
confusion_matrix_to_pretty_string
confusion_matrix_to_pretty_string(confusion_matrix: List[List[Union[int, float]]], each_length: int = 10, indent: int = 12) -> str
confusion matrix를 logging하기 위해 string으로 바꾸는 함수입니다. each_length의 길이가 되도록 " "를 늘려줍니다. log 예시:
...
2023-xx-xx xx:yy:zz,000 INFO [train.py:143]
object/confusion_matrix:
| class 0| class 1| class 2|
class 0| 0| 132| 123|
class 1| 1| 458| 8394|
class 2| 10| 1| 2|
object/accuracy: 0.0000
...
Returns: str