Ejemplo n.º 1
0
        public void Load(string sFileName, double dTrainSetSize)
        {
            RankingDB db = Load(sFileName);

            _test  = new RankingDB();
            _train = new RankingDB();
            DivideDB(db, dTrainSetSize, _train, _test);
            _trainEngine = new RecommenderSystemEngine(_train);
        }
Ejemplo n.º 2
0
        private double ComputeRMSE(PredictionMethod m, RecommenderSystemEngine engineTrain, IEnumerable <RankingDB.RankData> allTest)
        {
            double sum = 0;

            foreach (var rankData in allTest)
            {
                double pretictedRating = Math.Round(engineTrain.PredictRating(m, rankData.ranker, rankData.item));
                sum += Math.Pow((rankData.rank - pretictedRating), 2);
            }
            return(Math.Sqrt(sum / allTest.Count()));
        }