libcity.utils.utils¶
-
libcity.utils.utils.
ensure_dir
(dir_path)[source]¶ Make sure the directory exists, if it does not exist, create it.
- Parameters
dir_path (str) – directory path
-
libcity.utils.utils.
get_evaluator
(config)[source]¶ according the config[‘evaluator’] to create the evaluator
- Parameters
config (ConfigParser) – config
- Returns
the loaded evaluator
- Return type
-
libcity.utils.utils.
get_executor
(config, model, data_feature)[source]¶ according the config[‘executor’] to create the executor
- Parameters
config (ConfigParser) – config
model (AbstractModel) – model
- Returns
the loaded executor
- Return type
-
libcity.utils.utils.
get_logger
(config, name=None)[source]¶ 获取Logger对象
- Parameters
config (ConfigParser) – config
name – specified name
- Returns
logger
- Return type
Logger
-
libcity.utils.utils.
get_model
(config, data_feature)[source]¶ according the config[‘model’] to create the model
- Parameters
config (ConfigParser) – config
data_feature (dict) – feature of the data
- Returns
the loaded model
- Return type