Exemple #1
0
        /// <summary>
        /// Predict all unknown values as global mean rating.
        /// </summary>
        public string RunGlobalMean()
        {
            if (!ReadyForNumerical)
            {
                GetReadyForNumerical();
            }
            StringBuilder log = new StringBuilder();

            log.AppendLine(Utils.PrintHeading("Global Mean"));

            // Prediction
            Utils.StartTimer();
            double     globalMean  = R_train.GetGlobalMean();
            DataMatrix R_predicted = R_unknown.Multiply(globalMean);

            log.AppendLine(Utils.StopTimer());

            // Numerical Evaluation
            log.AppendLine(Utils.PrintValue("RMSE", RMSE.Evaluate(R_test, R_predicted).ToString("0.0000")));
            log.AppendLine(Utils.PrintValue("MAE", MAE.Evaluate(R_test, R_predicted).ToString("0.0000")));

            return(log.ToString());
        }