Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More Sophisticated Movie Recommendation Algorithm and Database Structure #10

Open
Dan6erbond opened this issue Apr 11, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Dan6erbond
Copy link
Owner

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:

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
}
@Dan6erbond Dan6erbond self-assigned this Apr 11, 2023
@Dan6erbond Dan6erbond added enhancement New feature or request help wanted Extra attention is needed labels Apr 11, 2023
@Dan6erbond Dan6erbond added this to the v1.0.0 Release milestone Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
Status: Todo
Development

No branches or pull requests

1 participant