示例#1
0
        override public String ToString()
        {
            StringBuilder result = new StringBuilder();

            result.Append(ReadCSV.DisplayDate(this.date));
            result.Append(", Amount: ");
            result.Append(this.amount);
            result.Append(", Prime Rate: ");
            result.Append(this.rate);
            result.Append(", Percent from Previous: ");
            result.Append(this.percent.ToString("N2"));
            return(result.ToString());
        }
        public void display()
        {
            double[] present      = new double[INPUT_SIZE * 2];
            double[] predict      = new double[OUTPUT_SIZE];
            double[] actualOutput = new double[OUTPUT_SIZE];

            int index = 0;

            foreach (FinancialSample sample in this.actual.getSamples())
            {
                if (sample.getDate().CompareTo(this.PREDICT_FROM) > 0)
                {
                    StringBuilder str = new StringBuilder();
                    str.Append(ReadCSV.DisplayDate(sample.getDate()));
                    str.Append(":Start=");
                    str.Append(sample.getAmount());

                    this.actual.getInputData(index - INPUT_SIZE, present);
                    this.actual.getOutputData(index - INPUT_SIZE, actualOutput);

                    predict = this.network.ComputeOutputs(present);
                    str.Append(",Actual % Change=");
                    str.Append(actualOutput[0].ToString("N2"));
                    str.Append(",Predicted % Change= ");
                    str.Append(predict[0].ToString("N2"));

                    str.Append(":Difference=");

                    ErrorCalculation error = new ErrorCalculation();
                    error.UpdateError(predict, actualOutput);
                    str.Append(error.CalculateRMS().ToString("N2"));

                    //

                    Console.WriteLine(str.ToString());
                }

                index++;
            }
        }