Beispiel #1
0
 public void getReport(double alpha)
 {
     Forms.RunningProcess.frmRunningProcessDialog rd = new Forms.RunningProcess.frmRunningProcessDialog(false);
     rd.Text               = "Regression Results";
     rd.TopLevel           = true;
     rd.pgbProcess.Visible = false;
     rd.FormBorderStyle    = System.Windows.Forms.FormBorderStyle.Sizable;
     rd.addMessage("Dependent field = " + DependentFieldNames[0]);
     rd.addMessage("Independent fields = " + String.Join(", ", IndependentFieldNames));
     rd.addMessage("Sample size = " + SampleSize.ToString());
     rd.addMessage("Intercept Through Origin = " + InterceptThroughOrigin.ToString());
     rd.addMessage("F-statistic = " + FValue.ToString() + " p-value = " + PValue.ToString());
     rd.addMessage("RMSE = " + RMSE.ToString());
     rd.addMessage("R2 = " + Rsquared.ToString());
     rd.addMessage("Adj-R2 = " + AdjustedRsquared.ToString() + "\n\nCoefficents and standard errors:\n");
     rd.addMessage("Param: Intercept, " + String.Join(", ", IndependentFieldNames));
     rd.addMessage("Coef:  " + string.Join(", ", (from double d in Coefficients select d.ToString()).ToArray()));
     rd.addMessage("STE:   " + string.Join(", ", (from double d in StandardErrors select d.ToString()).ToArray()) + "\n");
     try
     {
         if (ModelHelper.chartingAvailable())
         {
             regChart();
         }
     }
     catch
     {
         System.Windows.Forms.MessageBox.Show("Cannot create charts");
     }
     rd.Show();
     rd.enableClose();
 }
Beispiel #2
0
 public string writeModel(string outModelPath)
 {
     outPath = outModelPath;
     using (System.IO.StreamWriter sw = new System.IO.StreamWriter(outPath))
     {
         sw.WriteLine(modelTypes.LinearRegression.ToString());
         sw.WriteLine(InTablePath);
         sw.WriteLine(String.Join(",", IndependentFieldNames));
         sw.WriteLine(String.Join(",", DependentFieldNames));
         sw.WriteLine(String.Join(",", ClassFieldNames));
         sw.WriteLine(SampleSize.ToString());
         sw.WriteLine(NumberOfVariables.ToString());
         sw.WriteLine(InterceptThroughOrigin.ToString());
         sw.WriteLine(RMSE);
         sw.WriteLine(FValue.ToString());
         sw.WriteLine(PValue.ToString());
         sw.WriteLine(Rsquared.ToString());
         sw.WriteLine(AdjustedRsquared.ToString());
         sw.WriteLine(String.Join(" ", (from double d in Coefficients select d.ToString()).ToArray()));
         sw.WriteLine(String.Join(" ", (from double d in StandardErrors select d.ToString()).ToArray()));
         sw.WriteLine(String.Join(" ", (from double d in minValues select d.ToString()).ToArray()));
         sw.WriteLine(String.Join(" ", (from double d in maxValues select d.ToString()).ToArray()));
         sw.WriteLine(String.Join(" ", (from double d in sumValues select d.ToString()).ToArray()));
         sw.Close();
     }
     return(outPath);
 }