lkauto.implicit package

Submodules

lkauto.implicit.implicit_evaler module

class lkauto.implicit.implicit_evaler.ImplicitEvaler(train: pandas.core.frame.DataFrame, optimization_metric, filer: lkauto.utils.filer.Filer, validation=None, random_state=42, split_folds: int = 1, split_strategie: str = 'user_based', split_frac: float = 0.25, num_recommendations: int = 10, minimize_error_metric_val: bool = True)

Bases: object

the ImplicitEvaler class handles the evaluation of the optimization tool. An Evaluation run consists of training a model and predict the performance on a validation split.

train

pandas dataset containing the train split.

Type

pd.DataFrame

optimization_metric

LensKit top-n metric used to evaluate the model

Type

function

filer

filer to organize the output.

Type

Filer

validation

pandas dataset containing the validation split.

random_state :

The random number generator or seed (see lenskit.util.rng()).

Type

pd.DataFrame

split_folds

The number of folds of the validation split

split_strategie

The strategie used to split the data. Possible values are ‘user_based’ and ‘row_based’

split_frac

The fraction of the data used for the validation split. If the split_folds value is greater than 1, this value is ignored.

num_recommendations

The number of recommendations to be made and evaluated for each user.

minimize_error_metric_val

If True, the error metric is minimized. If False, the error metric is maximized. This parameter needs to be set in corelation with the optimization metric.

Methods

----------
evaluate_explicit(config_space
Type

ConfigurationSpace) -> float

evaluate(config_space: ConfigSpace.configuration_space.ConfigurationSpace) → float

evaluates model defined in config_space

The config_space parameter defines a model. This model is build, trained and evaluated with the validation split.

Parameters

config_space (ConfigurationSpace) – configuration space containing information to build a model

Returns

validation_error – the error of the considered model

Return type

float

Module contents