tirank.TrainPre.get_best_model

tirank.TrainPre.get_best_model(savePath)[source]

Loads the best performing model from the hyperparameter tuning.

This function reads the ‘best_params.pkl’ file, reconstructs the corresponding model filename, initializes a new TiRankModel with the saved parameters, and loads the weights.

Parameters:

savePath (str) – The main project directory path.

Returns:

The trained TiRank model with the best weights loaded.

Return type:

TiRankModel