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

Recommender Systems by User-based Collaborative Filtering #483

Merged
merged 4 commits into from
Oct 23, 2024

Conversation

ngtduc693
Copy link
Contributor

@ngtduc693 ngtduc693 commented Oct 21, 2024

This PR introduces a User-based Collaborative Filtering algorithm implemented in C#. The algorithm predicts a user's rating for a given item based on ratings from other users with similar preferences. The main components of this PR include

CollaborativeFiltering included:

  • CalculateSimilarity: Computes the similarity between two users based on their shared item ratings using the Pearson correlation coefficient.
  • PredictRating: Using ratings from other users who have rated the same item, it forecasts a target user's rating for a particular item. The prediction is a weighted sum determined by user similarity.

image

  • I have performed a self-review of my code
  • My code follows the style guidelines of this project
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Comments in areas I changed are up to date
  • I have added comments to hard-to-understand areas of my code
  • I have made corresponding changes to the README.md

@ngtduc693 ngtduc693 marked this pull request as ready for review October 21, 2024 17:26
@ngtduc693 ngtduc693 requested a review from siriak as a code owner October 21, 2024 17:26
@ngtduc693
Copy link
Contributor Author

First time attending hacktoberfest 2024, and this is my first PR, I hope everything goes well 😃

siriak
siriak previously approved these changes Oct 22, 2024
Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

Copy link

codecov bot commented Oct 22, 2024

Codecov Report

Attention: Patch coverage is 97.77778% with 1 line in your changes missing coverage. Please review.

Project coverage is 95.02%. Comparing base (7f6eed4) to head (8397f46).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...rithms/RecommenderSystem/CollaborativeFiltering.cs 97.77% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #483      +/-   ##
==========================================
+ Coverage   95.01%   95.02%   +0.01%     
==========================================
  Files         254      255       +1     
  Lines       10570    10615      +45     
  Branches     1491     1497       +6     
==========================================
+ Hits        10043    10087      +44     
  Misses        403      403              
- Partials      124      125       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@siriak
Copy link
Member

siriak commented Oct 22, 2024

Please increase test coverage

@ngtduc693
Copy link
Contributor Author

Hi @siriak , I just added some test cases to increase the test coverage percent

Thanks for your help to review

@ngtduc693 ngtduc693 requested a review from siriak October 23, 2024 02:28
Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@siriak siriak merged commit fe93f57 into TheAlgorithms:master Oct 23, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants