private MalTrainingData FilterOutSpecialsAndTrim(MalTrainingData trainingData) { Dictionary <int, MalUserListEntries> filteredUsers = new Dictionary <int, MalUserListEntries>(); foreach (int userId in trainingData.Users.Keys.Take(m_recommender.NumRecommenders)) { List <ReadOnlyMalListEntryDictionary.ListEntryAndAnimeId> filteredEntryList = new List <ReadOnlyMalListEntryDictionary.ListEntryAndAnimeId>(); foreach (int animeId in trainingData.Users[userId].Entries.Keys) { if (trainingData.Animes[animeId].Type != MalAnimeType.Special) { filteredEntryList.Add(new ReadOnlyMalListEntryDictionary.ListEntryAndAnimeId(animeId, trainingData.Users[userId].Entries[animeId])); } } ReadOnlyMalListEntryDictionary filteredEntries = new ReadOnlyMalListEntryDictionary(filteredEntryList); MalUserListEntries filteredUser = new MalUserListEntries(filteredEntries, trainingData.Users[userId].AnimesEligibleForRecommendation, trainingData.Users[userId].MalUsername, trainingData.Users[userId].OkToRecommendPredicate); filteredUsers[userId] = filteredUser; } MalTrainingData filteredTrainingData = new MalTrainingData(filteredUsers, trainingData.Animes); return(filteredTrainingData); }
public ReadOnlyMalListEntryDictionaryValueCollection(ReadOnlyMalListEntryDictionary dict) { m_dict = dict; }