Example #1
0
        public void TestDefaultBehaviorIsNoDecay()
        {
            var mf = new MatrixFactorization()
            {
                LearnRate = 1.1f, NumIter = 10, Ratings = TestUtils.CreateRatings()
            };

            mf.Train();
            Assert.AreEqual(1.1f, mf.current_learnrate);
        }
        IFoldInRatingPredictor CreateRecommender()
        {
            var training_data = RatingData.Read("../../../../data/ml-100k/u.data");
            var recommender   = new MatrixFactorization();

            recommender.Ratings    = training_data;
            recommender.NumFactors = 4;
            recommender.NumIter    = 5;
            recommender.Train();

            return(recommender);
        }
Example #3
0
        public void TestDecay()
        {
            var mf = new MatrixFactorization()
            {
                LearnRate = 1.0f, Decay = 0.5f,
                NumIter   = 1, Ratings = TestUtils.CreateRatings()
            };

            mf.Train();
            Assert.AreEqual(0.5f, mf.current_learnrate);

            mf.Iterate();
            Assert.AreEqual(0.25f, mf.current_learnrate);
        }