Skip to content

what do recommendation predict_one methods return for unknown items? #795

Answered by gbolmier
victusfate asked this question in Q&A
Discussion options

You must be logged in to vote

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 defaultdicts so that they return a default value (can be zero or anything from a pre-defined distribution, cf. the weight_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:

feature_seen: bool = feature_name in my_model.<

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@victusfate
Comment options

@gbolmier
Comment options

@victusfate
Comment options

@victusfate
Comment options

@gbolmier
Comment options

Answer selected by victusfate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants