DescartesResearch/TeaStore

Clarify Javadoc about IRecommender

Closed this issue · 1 comments

The Javadoc for the train method in IRecommender states:

Calling this method twice will trigger a retraining.

The meaning of this is unclear to me (what is a "retraining" as opposed to just a "training", why would calling the method train just once not cause training to occur, and so forth), and by reading the code, there seems to be no special handling of repeated calls to the AbstractRecommender that all recommenders seem to inherit from.

Related question

Perhaps related, the RecommenderSelector calls the train method on both the fallbackrecommender and the recommender. If those are equal (pointing to the same instance), that seems like a waste of resources. And if they are not, and triggering a "call the method twice" behavior was expected, then it does not happen for both recommenders.

The comment was intended to signal, that NO special handling of any repeated calls is included. Therefore, calling this method for a second time will trigger the exact same process again (and a new DB-Query is issued.)
The documentation was clarified for the next release to state the following: "Calling this method a second time initiates a new training process from scratch."
Hope this clears up the issue.