aprel.assessing package

aprel.assessing.metrics module

Functions that are useful for assessing the accuracy of the given learning agent.

aprel.assessing.metrics.cosine_similarity(belief: aprel.learning.belief_models.LinearRewardBelief, true_user: aprel.learning.user_models.User)float

This function tests how well the belief models the true user, when the reward model is linear. It performs this test by returning the cosine similarity between the true and predicted reward weights.

Parameters
  • belief (LinearRewardBelief) – the learning agent’s belief about the user

  • true_user (User) – a User which has given true weights

Returns

the cosine similarity of the predicted weights and the true weights

Return type

float