what do recommendation predict_one methods return for unknown items? #795
-
I was doing some testing earlier and I passed a novel item_id to predict_one and got back a reasonable and consistent score for that item. I was wondering if this is intended?
{"this_does_not_exist":0.3372315214069518} I can also do this for unknown users. Normally when I pass predictions to unrecognized users I default to popular items, but in this case its an unknown user and an unknown item.
{"this_does_not_exist":-0.0014310086721113745} I guess I expected 0 scores for novel items, or novel user/items. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi @victusfate! It happens because of the weights initialization scheme. A desired behaviour in an online learning pipeline is to draw new weights for new features when they appear in order to continuously learn on new observations. This work internally by storing the model weights in If you need to check if an item has been seen or not by your model you can try: feature_seen: bool = feature_name in my_model.<weights_attribute> |
Beta Was this translation helpful? Give feedback.
Hi @victusfate!
It happens because of the weights initialization scheme. A desired behaviour in an online learning pipeline is to draw new weights for new features when they appear in order to continuously learn on new observations. This work internally by storing the model weights in
defaultdict
s so that they return a default value (can be zero or anything from a pre-defined distribution, cf. theweight_initializer
param) when the key doesn't exist in the dict. So what is returned when the features are new is basically a dummy prediction based on the drawn weights.If you need to check if an item has been seen or not by your model you can try: