pykt.utils package
Submodules
pykt.utils.utils module
- pykt.utils.utils.debug_print(text, fuc_name='')[source]
Printing text with function name.
- Parameters
text (str) – the text will print
fuc_name (str, optional) – _description_. Defaults to “”.
pykt.utils.wandb_utils module
- class pykt.utils.wandb_utils.WandbUtils(user, project_name)[source]
Bases:
object
wandb utils
wandb_api = WandbUtils(user=’tabchen’, project_name=’pykt_iekt_pred’) >self.sweep_dict is {‘mx2tvwfy’: [‘mx2tvwfy’]}
- check_sweep_by_pattern(sweep_pattern, metric='testauc', metric_type='max', min_run_num=300, patience=100)[source]
Check sweeps by pattern :param sweep_pattern: check the sweeps which sweep names start with sweep_pattern :type sweep_pattern: str :param metric: the metric to check. Defaults to testauc. :type metric: str, optional :param metric_type: the type of metric max or min. Defaults to max. :type metric_type: str, optional :param min_run_num: the min run num to check. Defaults to 300. :type min_run_num: int, optional :param patience: the patience to stop. Defaults to 100. :type patience: int, optional
- Returns
the list of dict, each dict is {“id”:id,”state”:state,’df’:df,”num_run”:num_run}, state is ‘RUNNING’, ‘CANCELED’ or ‘FINISHED’,df is the df of the sweep, num_run is the num of sweep run, -1 mean the sweep is finished to save time we will not check it again.
- Return type
list
- check_sweep_early_stop(id, input_type='sweep_name', metric='testauc', metric_type='max', min_run_num=300, patience=100)[source]
Check sweep early stop
- Parameters
id (str) – the sweep name or sweep id.
input_type (str, optional) – the type of id. Defaults to sweep_name.
metric (str, optional) – the metric to check. Defaults to testauc.
metric_type (str, optional) – the type of metric max or min. Defaults to max.
min_run_num (int, optional) – the min run num to check. Defaults to 300.
patience (int, optional) – the patience to stop. Defaults to 100.
- Returns
{“state”:state,’df’:df,”num_run”:num_run}, state is ‘RUNNING’, ‘CANCELED’ or ‘FINISHED’,df is the df of the sweep, num_run is the num of sweep run, -1 mean the sweep is finished to save time we will not check it again.
- Return type
dict
- get_df(id, input_type='sweep_name')[source]
Get one sweep result
- Parameters
id (str) – the sweep name or sweep id.
input_type (str, optional) – the type of id. Defaults to sweep_name.
- Returns
_description_
- Return type
pd.Data
- get_multi_df(id_list=[], input_type='sweep_name')[source]
Get multi sweep result
- Parameters
id_list (list) – the list of sweep name or sweep id.
input_type (str, optional) – the type of id. Defaults to sweep_name.
- Returns
_description_
- Return type
_type_