예제 #1
0
        public static double TestRecommendation(string dataSetFile, string testSetFile) //tests the algorithm and compares it to the random
        {
            RecommendationSystem rc = new RecommendationSystem();

            rc.Load(dataSetFile);
            Parser      parser   = new Parser();
            List <Song> playList = parser.ParseXML(testSetFile);

            return(rc.TestRecommendation(playList));
        }
예제 #2
0
        public static List <Song> CreatePlaylistFromRecommendations(string dataSetFile) //creates a 500 songs playlist
        {
            RecommendationSystem rc = new RecommendationSystem();

            rc.Load(dataSetFile);
            List <Song> playList = new List <Song>();
            Song        ans      = rc.Recommend(playList);
            int         counter  = 0;

            while (ans != null && counter <= 500)
            {
                playList.Add(ans);
                ans = rc.Recommend(playList);
                counter++;
            }
            return(playList);
        }