Since recommended movies are fetched from TMDB's movie recommendations API, and scored by the ratings given to their source movie, scores can easily be inflated by having them appear in lots of movies' recommendations.
Solution
The following models could improve the recommendation algorithm by using a normalized scoring system based on averages of the associated ratings:
type Suggestion struct {
gorm.Model
MediaType string // movies or tvs
MediaID uint
UserID uint
SuggestionSources []SuggestionSource
}
func (s *Suggestion) Score() {
return AvgScore(s.SuggestionSources)
}
type SuggestionSource struct {
gorm.Model
SuggestionID uint
Suggestion Suggestion
MediaType string
MediaID uint
ReviewID uint
Review Review
}
func (s *SuggestionSource) Score() {
return s.Review.Rating
}
What is the problem?
Since recommended movies are fetched from TMDB's movie recommendations API, and scored by the ratings given to their source movie, scores can easily be inflated by having them appear in lots of movies' recommendations.
Solution
The following models could improve the recommendation algorithm by using a normalized scoring system based on averages of the associated ratings: