in sourcecode/scoring/matrix_factorization/pseudo_raters.py [0:0]
def _fit_note_params_for_each_dataset_with_extreme_ratings(self):
noteParamsList = []
for ratingToAddWithoutNoteId in self.extremeRatingsToAddWithoutNotes:
ratingFeaturesAndLabelsWithExtremeRatings = (
self._create_dataset_with_extreme_rating_on_each_note(ratingToAddWithoutNoteId)
)
if self._log:
logger.info("------------------")
logger.info(f"Re-scoring all notes with extra rating added: {ratingToAddWithoutNoteId}")
with c.time_block("Pseudo: fit all notes with raters constant"):
fitNoteParams = self._fit_all_notes_with_raters_constant(
ratingFeaturesAndLabelsWithExtremeRatings
)
fitNoteParams[Constants.extraRaterInterceptKey] = ratingToAddWithoutNoteId[
c.internalRaterInterceptKey
]
fitNoteParams[Constants.extraRaterFactor1Key] = ratingToAddWithoutNoteId[
c.internalRaterFactor1Key
]
fitNoteParams[Constants.extraRatingHelpfulNumKey] = ratingToAddWithoutNoteId[c.helpfulNumKey]
noteParamsList.append(fitNoteParams)
return noteParamsList