misc¶
In this module, several miscellaneous functions are defined for using in other module, such as date time formatting and customized progress bar.
Functions
progress_bar_gs (iteration, total, e_time, …) |
It shows a customizable progress bar for grid search. |
time_fmt (t_delta) |
It converts datetime objects to formatted string. |
-
misc.
time_fmt
(t_delta)[source]¶ It converts datetime objects to formatted string.
Parameters: t_delta : object
The difference between two dates or time.
Returns: str
A readable formatted-datetime string.
-
misc.
progress_bar_gs
(iteration, total, e_time, accuracy, best_acc, prefix='', suffix='', decimals=1, length=25, fill='#')[source]¶ It shows a customizable progress bar for grid search.
Parameters: iteration : int
Current iteration.
total : int
Maximumn number of iterations.
e_time : str
Elapsed time.
accuracy : tuple
The accuracy and its std at current iteration (acc, std).
best_acc : tuple
The best accuracy and its std that were obtained at current iteration (best_acc, std).
prefix : str, optional (default=’‘)
Prefix string.
suffix : str, optional (default=’‘)
Suffix string.
decimals : int, optinal (default=1)
Number of decimal places for percentage of completion.
length : int, optional (default=25)
Character length of the progress bar.
fill : str, optional (default=’#’)
Bar fill character.