Skip to content

Recommendation engine using collaborative filtering and matrix factorization

License

Notifications You must be signed in to change notification settings

skotz/cp-user-behavior

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C# Recommendation Engine

This project and corresponding article won first place in Code Project's 2018 Machine Learning and Artificial Intelligence Competition. It demonstrates user-based and item-based collaborative filtering with matrix factorization using the user behavior data provided by Code Project for the challenge.

Usage

IRater rate = new LinearRater(-4, 2, 3, 1);
IComparer compare = new CorrelationUserComparer();
IRecommender recommender = new UserCollaborativeFilterRecommender(compare, rate, 50);

UserBehaviorDatabaseParser parser = new UserBehaviorDatabaseParser();
UserBehaviorDatabase db = parser.LoadUserBehaviorDatabase("UserBehavior.txt");
ISplitter split = new DaySplitter(db, 5);

recommender.Train(split.TrainingDB);

ScoreResults scores = recommender.Score(split.TestingDB, rate);
TestResults results = recommender.Test(split.TestingDB, 30);

List<Suggestion> suggestions = recommender.GetSuggestions(someUserId, numberOfRecommendations);

Releases

No releases published

Packages

No packages published

Languages