lenskit.tuning.spec.SearchConfig#

classlenskit.tuning.spec.SearchConfig#

Bases: pydantic.BaseModel

Configuration options for the hyperparameter search.

method:Literal['tpe','random','hyperopt']|None =None#

The search method to use.

max_points:int |None =None#

The maximum number of points to try.

default_points:int =60#

The default number of search points, if not limited by a maximum configuration.

max_epochs:int =100#

The maximum number of epochs to use in iterative training.

min_epochs:int =3#

The minimum number of epochs for iterative training.

metric:str |None =None#

The metric to use.

list_length:int |None =None#

The length of recommendation lists to use.

num_cpus:int |Literal['threads','backend-threads','all-threads']='threads'#

The number of CPUs to request from Ray Tune.

num_gpus:int |float =0#

The number of GPUs to requrest from Ray Tune.

checkpoint_iters:int =2#

The frequency for saving checkpoints.

update_max_points(n)#

Limit the search points to a new maximum, if it exceeds the current maximum.

Parameters:

n (int | None)

num_search_points()#

Get the number of search points to use.

Return type:

int