Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
The Recommender
gem is a versatile recommendation engine built for Ruby on Rails applications. It leverages collaborative filtering techniques to generate personalized recommendations based on user interactions and similarities. This gem supports various association types, including has_and_belongs_to_many
, has_many :through
, and has_many
, making it flexible and easy to integrate into different relational database models.
has_and_belongs_to_many
, has_many :through
, and has_many
associations, allowing seamless integration with different data models.Add this line to your application's Gemfile:
gem 'recommender'
And then execute:
bundle install
Include the Recommender::Recommendation
module in your model and set the association:
class User < ApplicationRecord
include Recommender::Recommendation
has_many :movie_likes, dependent: :destroy
has_many :movies, through: :movie_likes
validates :name, presence: true, uniqueness: { case_sensitive: false }
set_association :movies
end
Now you can get recommendations for an instance:
user = User.find(1)
recommendations = user.recommendations(results: 5)
recommendations.each do |recommended_movie, score|
puts "#{recommended_movie.name} - Score: #{score}"
end
The gem computes recommendations by comparing the preferences of different users. It uses the following measures to calculate similarity:
These measures are combined to generate a final similarity score, which is then used to recommend items that the user has not yet interacted with but are popular among similar users.
Bug reports and pull requests are welcome on GitHub at https://github.com/Mutuba/recommender. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that recommender demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.