build_model_path
improvelib.utils.build_model_path(model_file_name, model_file_format, model_dir)
Returns the path to save/load the trained model.
Used in train and infer.
Parameters:
- model_file_namestr
Name of model file
- model_file_formatstr
Type of file for model (e.g. ‘.pt’)
- model dirPath or str
Directory path to save the model
Returns:
- model_pathpathlib.Path
Path to model
Example
Creates a model path to save the model.
modelpath = frm.build_model_path(model_file_name=params["model_file_name"],
model_file_format=params["model_file_format"],
model_dir=params["output_dir"])
model.save_model(str(modelpath))