IRecommenderEvaluator Evaluate Method NReco.Recommender Class Library
Evaluates the quality of a IRecommender's recommendations. The range of values that may be returned depends on the implementation, but lower values must mean better recommendations, with 0 being the lowest / best possible evaluation, meaning a perfect match. This method does not accept a IRecommender directly, but rather a [!:NReco.CF.Taste.Recommender.IRecommenderBuilder] which can build the IRecommender to test on top of a given IDataModel.

Implementations will take a certain percentage of the preferences supplied by the given IDataModel as "training data". This is typically most of the data, like 90%. This data is used to produce recommendations, and the rest of the data is compared against estimated preference values to see how much the IRecommender's predicted preferences match the user's real preferences. Specifically, for each user, this percentage of the user's ratings are used to produce recommendations, and for each user, the remaining preferences are compared against the user's real preferences.

For large datasets, it may be desirable to only evaluate based on a small percentage of the data.

evaluationPercentage
controls how many of the IDataModel's users are used in evaluation.

To be clear,

trainingPercentage
and
evaluationPercentage
are not related. They do not need to add up to 1.0, for example.

Namespace: NReco.CF.Taste.Eval
Assembly: NReco.Recommender (in NReco.Recommender.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax

double Evaluate(
	IRecommenderBuilder recommenderBuilder,
	IDataModelBuilder dataModelBuilder,
	IDataModel dataModel,
	double trainingPercentage,
	double evaluationPercentage
)

Parameters

recommenderBuilder
Type: NReco.CF.Taste.Eval IRecommenderBuilder
object that can build a IRecommender to test
dataModelBuilder
Type: NReco.CF.Taste.Eval IDataModelBuilder
IDataModelBuilder to use, or if null, a default IDataModel implementation will be used
dataModel
Type: NReco.CF.Taste.Model IDataModel
dataset to test on
trainingPercentage
Type: System Double
percentage of each user's preferences to use to produce recommendations; the rest are compared to estimated preference values to evaluate IRecommender performance
evaluationPercentage
Type: System Double
percentage of users to use in evaluation

Return Value

Type: Double
a "score" representing how well the IRecommender's estimated preferences match real values; lower scores mean a better match and 0 is a perfect match
See Also