Hyper-parameter Tuning¶

class cornac.hyperopt.Discrete(name, values)[source]

Domain of a parameter with a set of discrete values.

Parameters: name (str, required) – Name of the parameter. values (list, required) – List of values to be searched.
class cornac.hyperopt.Continuous(name, low=0.0, high=1.0)[source]

Domain of a parameter with continuous values within a range of [low, high).

Parameters: name (str, required) – Name of the parameter. low (float, default: 0.0) – Lower bound of the searched values (included). high (float, default: 1.0) – Upper bound of the searched values (excluded).
class cornac.hyperopt.GridSearch(model, space, metric, eval_method)[source]

Parameter searching on a grid.

Parameters: model (cornac.models.Recommender, required) – Base recommender model to be tuned. space (list, required) – Parameter space to be searched on. It’s a list of cornac.hyperopt.SearchDomain. metric (cornac.metrics.RatingMetric or cornac.metrics.RankingMetric, required) – Scoring metric to measure the performance and rank the parameter settings. eval_method (cornac.eval_methods.BaseMethod, required) – Evaluation method is being used.
class cornac.hyperopt.RandomSearch(model, space, metric, eval_method, n_trails=10)[source]

Parameter searching with random strategy.

Parameters: model (cornac.models.Recommender, required) – Base recommender model to be tuned. space (list, required) – Parameter space to be searched on. It’s a list of cornac.hyperopt.SearchDomain. metric (cornac.metrics.RatingMetric or cornac.metrics.RankingMetric, required) – Scoring metric to measure the performance and rank the parameter settings. eval_method (cornac.eval_methods.BaseMethod, required) – Evaluation method is being used. n_trails (int, default: 10) – Number of trails for random search.