recbole.trainer.hyper_tuning

exception recbole.trainer.hyper_tuning.ExhaustiveSearchError[source]

Bases: Exception

class recbole.trainer.hyper_tuning.HyperTuning(objective_function, space=None, params_file=None, fixed_config_file_list=None, algo='exhaustive', max_evals=100)[source]

Bases: object

HyperTuning Class is used to manage the parameter tuning process of recommender system models. Given objective funciton, parameters range and optimization algorithm, using HyperTuning can find the best result among these parameters

Note

HyperTuning is based on the hyperopt (https://github.com/hyperopt/hyperopt)

Thanks to sbrodeur for the exhaustive search code. https://github.com/hyperopt/hyperopt/issues/200

export_result(output_file=None)[source]

Write the searched parameters and corresponding results to the file

Parameters

output_file (str) – the output file

static params2str(params)[source]

convert dict to str

Parameters

params (dict) – parameters dict

Returns

parameters string

Return type

str

run()[source]

begin to search the best parameters

trial(params)[source]

Given a set of parameters, return results and optimization status

Parameters

params (dict) – the parameter dictionary

This is for exhaustive search in HyperTuning.