Example #1
0
        public static void TestSlopeOne()
        {
            var algorithm   = new SlopeOne();
            var recommender = new CollaborativeFilteringRecommender(algorithm);

            recommender.AddPlayerRating(3, true);
            recommender.AddPlayerRating(6, false);
            recommender.AddPlayerRating(39, true);
            recommender.AddPlayerRating(50, false);
            recommender.AddPlayerRating(61, true);
            recommender.Fit();
            for (var i = 0; i < recommender.m_DataSet.itemCount; i++)
            {
                Debug.Log($"SlopeOne est={algorithm.Predict(recommender.m_PlayerUserId, i).est}");
            }
        }
Example #2
0
        public static void TestNonnegativeMatrixFactorization()
        {
            var algorithm = new NonnegativeMatrixFactorization()
            {
                nEpochs  = 1,
                initLow  = 0.5f,
                initHigh = 0.5f
            };

            var recommender = new CollaborativeFilteringRecommender(algorithm);

            recommender.AddPlayerRating(3, true);
            recommender.AddPlayerRating(6, false);
            recommender.AddPlayerRating(39, true);
            recommender.AddPlayerRating(50, false);
            recommender.AddPlayerRating(61, true);
            recommender.Fit();
            for (var i = 0; i < recommender.m_DataSet.itemCount; i++)
            {
                Debug.Log($"NMF est={algorithm.Predict(recommender.m_PlayerUserId, i).est}");
            }
        }