Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9994 for trunk


Ignore:
Timestamp:
09/19/13 17:25:13 (11 years ago)
Author:
gkronber
Message:

#2102 handled estimation bounds in Excel exporter specifically to prevent writing extreme values that Excel can't handle (necessary to support export of linear regression solutions).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Exporters/SymbolicSolutionExcelExporter.cs

    r9975 r9994  
    105105
    106106      modelWorksheet.Cells[row, 1].Value = "Estimation Limits Lower";
    107       modelWorksheet.Cells[row, 2].Value = solution.Model.LowerEstimationLimit;
     107      modelWorksheet.Cells[row, 2].Value = Math.Max(solution.Model.LowerEstimationLimit, -9.99999999999999E+307); // minimal value supported by excel
    108108      modelWorksheet.Names.Add("EstimationLimitLower", modelWorksheet.Cells[row, 2]);
    109       modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000";
     109      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000E+00";
    110110      row++;
    111111
    112112      modelWorksheet.Cells[row, 1].Value = "Estimation Limits Upper";
    113       modelWorksheet.Cells[row, 2].Value = solution.Model.UpperEstimationLimit;
     113      modelWorksheet.Cells[row, 2].Value = Math.Min(solution.Model.UpperEstimationLimit, 9.99999999999999E+307);  // maximal value supported by excel
    114114      modelWorksheet.Names.Add("EstimationLimitUpper", modelWorksheet.Cells[row, 2]);
    115       modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000";
     115      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000E+00";
    116116      row += 2;
    117117
     
    163163      modelWorksheet.Cells[row, 2].Formula = string.Format("AVERAGE({0})", excelTrainingMSE);
    164164      modelWorksheet.Names.Add("TrainingMSE", modelWorksheet.Cells[row, 2]);
    165       modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000";
     165      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000E+00";
    166166      row++;
    167167
     
    169169      modelWorksheet.Cells[row, 2].Formula = string.Format("AVERAGE({0})", excelTestMSE);
    170170      modelWorksheet.Names.Add("TestMSE", modelWorksheet.Cells[row, 2]);
    171       modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000";
     171      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000E+00";
    172172      row++;
    173173
    174174      modelWorksheet.Cells[row, 1].Value = "Mean absolute error (training)";
    175175      modelWorksheet.Cells[row, 2].Formula = string.Format("AVERAGE({0})", excelTrainingAbsoluteError);
    176       modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000";
     176      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000E+00";
    177177      row++;
    178178
    179179      modelWorksheet.Cells[row, 1].Value = "Mean absolute error (test)";
    180180      modelWorksheet.Cells[row, 2].Formula = string.Format("AVERAGE({0})", excelTestAbsoluteError);
    181       modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000";
     181      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000E+00";
    182182      row++;
    183183
    184184      modelWorksheet.Cells[row, 1].Value = "Mean error (training)";
    185185      modelWorksheet.Cells[row, 2].Formula = string.Format("AVERAGE({0})", excelTrainingMeanError);
    186       modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000";
     186      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000E+00";
    187187      row++;
    188188
    189189      modelWorksheet.Cells[row, 1].Value = "Mean error (test)";
    190190      modelWorksheet.Cells[row, 2].Formula = string.Format("AVERAGE({0})", excelTestMeanError);
    191       modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000";
     191      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000E+00";
    192192      row++;
    193193
     
    204204      modelWorksheet.Cells[row, 1].Value = "Normalized Mean Squared error (training)";
    205205      modelWorksheet.Cells[row, 2].Formula = string.Format("TrainingMSE / VAR({0})", excelTrainingTarget);
    206       modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000";
     206      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000E+00";
    207207      row++;
    208208
    209209      modelWorksheet.Cells[row, 1].Value = "Normalized Mean Squared error  (test)";
    210210      modelWorksheet.Cells[row, 2].Formula = string.Format("TestMSE / VAR({0})", excelTestTarget);
    211       modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000";
     211      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000E+00";
    212212
    213213      modelWorksheet.Cells["A1:B" + row].AutoFitColumns();
Note: See TracChangeset for help on using the changeset viewer.