private static void LogNormalize(int userCount, string playcountsFile, string saveFile) { var rating = RatingProvider.Load(playcountsFile); rating.LogNormalize(userCount); RatingProvider.Save(saveFile, rating); }
private static void ConvertToLogEqualWidthFiveScale(int userCount, string playcountsFile, string saveFile) { var ratings = RatingProvider.Load(playcountsFile); ratings.ConvertToLogEqualWidthFiveScale(userCount); RatingProvider.Save(saveFile, ratings); }
private static void LoadAndSaveRatings(string playcountsFile, List <IUser> users, List <string> artistLut) { var userLut = users.GetLookupTable(); var ratings = RatingProvider.ImportFromDataset(DataFiles.RatingDataset, userLut, artistLut); users.PopulateWithRatings(ratings, true); ratings.ExtractFromUsers(users); RatingProvider.Save(playcountsFile, ratings); }
private static int LoadFromDataset() { Console.WriteLine("Loading users from dataset... {0}", DateTime.Now.ToLongTimeString()); List <string> userLut, artistLut; var users = UserProvider.ImportFromDataset(DataFiles.UserDataset, out userLut); UserProvider.Save(DataFiles.Users, users); GC.Collect(); Console.WriteLine("Loading artists from dataset... {0}", DateTime.Now.ToLongTimeString()); var artists = ArtistProvider.ImportFromDataset(DataFiles.RatingDataset, out artistLut); ArtistProvider.Save(DataFiles.Artists, artists); Console.WriteLine("Loading ratings from dataset... {0}", DateTime.Now.ToLongTimeString()); var ratings = RatingProvider.ImportFromDataset(DataFiles.RatingDataset, userLut, artistLut); Console.WriteLine("Populating users with ratings... {0}", DateTime.Now.ToLongTimeString()); users.PopulateWithRatings(ratings, true); GC.Collect(); Console.WriteLine("Extracting ratings from users... {0}", DateTime.Now.ToLongTimeString()); ratings.ExtractFromUsers(users, false); RatingProvider.Save(DataFiles.Playcounts, ratings); return(users.Count); }