Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6238


Ignore:
Timestamp:
05/20/11 15:07:45 (12 years ago)
Author:
gkronber
Message:

#1450 adapted views for regression solution to work for ensembles of regression solutions as well.

Location:
trunk/sources
Files:
1 added
6 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj

    r6184 r6238  
    158158      <DependentUpon>ClusteringSolutionView.cs</DependentUpon>
    159159    </Compile>
    160     <Compile Include="Interfaces\IRegressionEnsembleSolutionEvaluationView.cs" />
    161     <Compile Include="RegressionEnsembleSolutionView.cs">
    162       <SubType>UserControl</SubType>
    163     </Compile>
    164     <Compile Include="RegressionEnsembleSolutionView.Designer.cs">
    165       <DependentUpon>RegressionEnsembleSolutionView.cs</DependentUpon>
    166     </Compile>
    167160    <Compile Include="DiscriminantFunctionClassificationSolutionView.cs">
    168161      <SubType>UserControl</SubType>
     
    193186    <Compile Include="RegressionSolutionView.Designer.cs">
    194187      <DependentUpon>RegressionSolutionView.cs</DependentUpon>
    195     </Compile>
    196     <Compile Include="Regression\RegressionEnsembleSolutionLineChartView.cs">
    197       <SubType>UserControl</SubType>
    198     </Compile>
    199     <Compile Include="Regression\RegressionEnsembleSolutionLineChartView.Designer.cs">
    200       <DependentUpon>RegressionEnsembleSolutionLineChartView.cs</DependentUpon>
    201     </Compile>
    202     <Compile Include="Regression\RegressionEnsembleSolutionScatterPlotView.cs">
    203       <SubType>UserControl</SubType>
    204     </Compile>
    205     <Compile Include="Regression\RegressionEnsembleSolutionScatterPlotView.Designer.cs">
    206       <DependentUpon>RegressionEnsembleSolutionScatterPlotView.cs</DependentUpon>
    207188    </Compile>
    208189    <Compile Include="Regression\RegressionSolutionEstimatedValuesView.cs">
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionEstimatedValuesView.cs

    r6058 r6238  
    3232  [Content(typeof(IRegressionSolution))]
    3333  public partial class RegressionSolutionEstimatedValuesView : ItemView, IRegressionSolutionEvaluationView {
    34     private const string TARGETVARIABLE_SERIES_NAME = "TargetVariable";
    35     private const string ESTIMATEDVALUES_SERIES_NAME = "EstimatedValues";
     34    private const string TARGETVARIABLE_SERIES_NAME = "Target Variable";
     35    private const string ESTIMATEDVALUES_TRAINING_SERIES_NAME = "Estimated Values (training)";
     36    private const string ESTIMATEDVALUES_TEST_SERIES_NAME = "Estimated Values (test)";
    3637
    3738    public new IRegressionSolution Content {
     
    8586        DoubleMatrix matrix = null;
    8687        if (Content != null) {
    87           double[,] values = new double[Content.ProblemData.Dataset.Rows, 4];
     88          double[,] values = new double[Content.ProblemData.Dataset.Rows, 5];
     89          // initialize to double.NaN
     90          for (int row = 0; row < Content.ProblemData.Dataset.Rows; row++)
     91            for (int column = 0; column < 5; column++)
     92              values[row, column] = double.NaN;
    8893
    8994          double[] target = Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable);
    90           double[] estimated = Content.EstimatedValues.ToArray();
     95          var estimated_training = Content.EstimatedTrainingValues.GetEnumerator();
     96          var estimated_test = Content.EstimatedTestValues.GetEnumerator();
     97
     98          foreach (var row in Content.ProblemData.TrainingIndizes) {
     99            estimated_training.MoveNext();
     100            values[row, 1] = estimated_training.Current;
     101          }
     102
     103          foreach (var row in Content.ProblemData.TestIndizes) {
     104            estimated_test.MoveNext();
     105            values[row, 2] = estimated_test.Current;
     106          }
     107
    91108          for (int row = 0; row < target.Length; row++) {
    92109            values[row, 0] = target[row];
    93             values[row, 1] = estimated[row];
    94             values[row, 2] = Math.Abs(estimated[row] - target[row]);
    95             values[row, 3] = Math.Abs(values[row, 2] / target[row]);
     110            double est = values[row, 1];
     111            if (!double.IsNaN(est)) {
     112              values[row, 3] = Math.Abs(est - target[row]);
     113              values[row, 4] = Math.Abs(values[row, 3] / target[row]);
     114            }
    96115          }
    97116
    98117          matrix = new DoubleMatrix(values);
    99           matrix.ColumnNames = new string[] { TARGETVARIABLE_SERIES_NAME, ESTIMATEDVALUES_SERIES_NAME, "Absolute Error", "Relative Error" };
     118          matrix.ColumnNames = new string[] { TARGETVARIABLE_SERIES_NAME, ESTIMATEDVALUES_TRAINING_SERIES_NAME, ESTIMATEDVALUES_TEST_SERIES_NAME, "Absolute Error (training)", "Relative Error (training)" };
    100119        }
    101120        matrixView.Content = matrix;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionLineChartView.cs

    r5975 r6238  
    3232  [Content(typeof(IRegressionSolution))]
    3333  public partial class RegressionSolutionLineChartView : ItemView, IRegressionSolutionEvaluationView {
    34     private const string TARGETVARIABLE_SERIES_NAME = "TargetVariable";
    35     private const string ESTIMATEDVALUES_SERIES_NAME = "EstimatedValues";
     34    private const string TARGETVARIABLE_SERIES_NAME = "Target Variable";
     35    private const string ESTIMATEDVALUES_TRAINING_SERIES_NAME = "Estimated Values (training)";
     36    private const string ESTIMATEDVALUES_TEST_SERIES_NAME = "Estimated Values (test)";
    3637
    3738    public new IRegressionSolution Content {
     
    4748      this.chart.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
    4849      this.chart.ChartAreas[0].AxisX.ScaleView.Zoomable = true;
     50      this.chart.ChartAreas[0].AxisX.IsStartedFromZero = true;
    4951      this.chart.ChartAreas[0].CursorX.Interval = 1;
    5052
     
    5759      this.chart.Series.Clear();
    5860      if (Content != null) {
     61        this.chart.ChartAreas[0].AxisX.Minimum = 0;
     62        this.chart.ChartAreas[0].AxisX.Maximum = Content.ProblemData.Dataset.Rows - 1;
     63
    5964        this.chart.Series.Add(TARGETVARIABLE_SERIES_NAME);
    6065        this.chart.Series[TARGETVARIABLE_SERIES_NAME].LegendText = Content.ProblemData.TargetVariable;
    6166        this.chart.Series[TARGETVARIABLE_SERIES_NAME].ChartType = SeriesChartType.FastLine;
    62         this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.DataBindY(Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable));
     67        this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.DataBindXY(Enumerable.Range(0, Content.ProblemData.Dataset.Rows).ToArray(),
     68          Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable));
     69
     70        this.chart.Series.Add(ESTIMATEDVALUES_TRAINING_SERIES_NAME);
     71        this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].LegendText = ESTIMATEDVALUES_TRAINING_SERIES_NAME;
     72        this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].ChartType = SeriesChartType.FastLine;
     73        this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].Points.DataBindXY(Content.ProblemData.TrainingIndizes.ToArray(),
     74          Content.EstimatedTrainingValues.ToArray());
     75        this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].Tag = Content;
     76
     77        this.chart.Series.Add(ESTIMATEDVALUES_TEST_SERIES_NAME);
     78        this.chart.Series[ESTIMATEDVALUES_TEST_SERIES_NAME].LegendText = ESTIMATEDVALUES_TEST_SERIES_NAME;
     79        this.chart.Series[ESTIMATEDVALUES_TEST_SERIES_NAME].ChartType = SeriesChartType.FastLine;
     80        this.chart.Series[ESTIMATEDVALUES_TEST_SERIES_NAME].Points.DataBindXY(Content.ProblemData.TestIndizes.ToArray(),
     81          Content.EstimatedTestValues.ToArray());
     82        this.chart.Series[ESTIMATEDVALUES_TEST_SERIES_NAME].Tag = Content;
     83        UpdateCursorInterval();
    6384        this.UpdateStripLines();
    64 
    65         this.chart.Series.Add(ESTIMATEDVALUES_SERIES_NAME);
    66         this.chart.Series[ESTIMATEDVALUES_SERIES_NAME].LegendText = Content.ItemName;
    67         this.chart.Series[ESTIMATEDVALUES_SERIES_NAME].ChartType = SeriesChartType.FastLine;
    68         this.chart.Series[ESTIMATEDVALUES_SERIES_NAME].Points.DataBindY(Content.EstimatedValues.ToArray());
    69         this.chart.Series[ESTIMATEDVALUES_SERIES_NAME].Tag = Content;
    70         UpdateCursorInterval();
    7185      }
    7286    }
    7387
    7488    private void UpdateCursorInterval() {
    75       var estimatedValues = this.chart.Series[ESTIMATEDVALUES_SERIES_NAME].Points.Select(x => x.YValues[0]).DefaultIfEmpty(1.0);
     89      var estimatedValues = this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].Points.Select(x => x.YValues[0]).DefaultIfEmpty(1.0);
    7690      var targetValues = this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.Select(x => x.YValues[0]).DefaultIfEmpty(1.0);
    7791      double estimatedValuesRange = estimatedValues.Max() - estimatedValues.Min();
     
    112126      else {
    113127        if (this.chart.Series.Count > 0) {
    114           Series s = this.chart.Series.SingleOrDefault(x => x.Tag == Content);
     128          Series s = this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME];
    115129          if (s != null) {
    116             s.Points.DataBindY(Content.EstimatedValues.ToArray());
    117             s.LegendText = Content.ItemName;
    118             this.UpdateStripLines();
    119             UpdateCursorInterval();
     130            s.Points.DataBindXY(Content.ProblemData.TrainingIndizes.ToArray(), Content.EstimatedTrainingValues.ToArray());
     131            s.LegendText = ESTIMATEDVALUES_TRAINING_SERIES_NAME;
    120132          }
     133          s = this.chart.Series[ESTIMATEDVALUES_TEST_SERIES_NAME];
     134          if (s != null) {
     135            s.Points.DataBindXY(Content.ProblemData.TestIndizes.ToArray(), Content.EstimatedTestValues.ToArray());
     136            s.LegendText = ESTIMATEDVALUES_TEST_SERIES_NAME;
     137          }
     138          this.UpdateStripLines();
     139          UpdateCursorInterval();
    121140        }
    122141      }
     
    136155    private void UpdateStripLines() {
    137156      this.chart.ChartAreas[0].AxisX.StripLines.Clear();
    138       this.CreateAndAddStripLine("Training", Color.FromArgb(20, Color.Green),
    139         Content.ProblemData.TrainingPartition.Start,
    140         Content.ProblemData.TrainingPartition.End);
    141       this.CreateAndAddStripLine("Test", Color.FromArgb(20, Color.Red),
    142         Content.ProblemData.TestPartition.Start,
    143         Content.ProblemData.TestPartition.End);
    144     }
    145 
    146     private void CreateAndAddStripLine(string title, Color c, int start, int end) {
     157
     158      int[] attr = new int[Content.ProblemData.Dataset.Rows + 1]; // add a virtual last row that is again empty to simplify loop further down
     159      foreach (var row in Content.ProblemData.TrainingIndizes) {
     160        attr[row] += 1;
     161      }
     162      foreach (var row in Content.ProblemData.TestIndizes) {
     163        attr[row] += 2;
     164      }
     165      int start = 0;
     166      int curAttr = attr[start];
     167      for (int row = 0; row < attr.Length; row++) {
     168        if (attr[row] != curAttr) {
     169          switch (curAttr) {
     170            case 0: break;
     171            case 1:
     172              this.CreateAndAddStripLine("Training", start, row, Color.FromArgb(40, Color.Green), Color.Transparent);
     173              break;
     174            case 2:
     175              this.CreateAndAddStripLine("Test", start, row, Color.FromArgb(40, Color.Red), Color.Transparent);
     176              break;
     177            case 3:
     178              this.CreateAndAddStripLine("Training and Test", start, row, Color.FromArgb(40, Color.Green), Color.FromArgb(40, Color.Red), ChartHatchStyle.WideUpwardDiagonal);
     179              break;
     180            default:
     181              // should not happen
     182              break;
     183          }
     184          curAttr = attr[row];
     185          start = row;
     186        }
     187      }
     188    }
     189
     190    private void CreateAndAddStripLine(string title, int start, int end, Color color, Color secondColor, ChartHatchStyle hatchStyle = ChartHatchStyle.None) {
    147191      StripLine stripLine = new StripLine();
    148       stripLine.BackColor = c;
     192      stripLine.BackColor = color;
     193      stripLine.BackSecondaryColor = secondColor;
     194      stripLine.BackHatchStyle = hatchStyle;
    149195      stripLine.Text = title;
    150196      stripLine.Font = new Font("Times New Roman", 12, FontStyle.Bold);
    151       stripLine.StripWidth = end - start;
     197      stripLine.StripWidth = end - start - 1; // strip range is [start .. end] inclusive, but we evaluate [start..end[ (end is exclusive)
    152198      stripLine.IntervalOffset = start;
    153199      this.chart.ChartAreas[0].AxisX.StripLines.Add(stripLine);
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionScatterPlotView.cs

    r5975 r6238  
    139139           dataset.GetEnumeratedVariableValues(targetVariableName, Content.ProblemData.TestIndizes).ToArray(), "");
    140140
    141         double max = Math.Max(Content.EstimatedValues.Max(), dataset.GetVariableValues(targetVariableName).Max());
    142         double min = Math.Min(Content.EstimatedValues.Min(), dataset.GetVariableValues(targetVariableName).Min());
     141        double max = Content.EstimatedTrainingValues.Concat(Content.EstimatedTestValues.Concat(Content.EstimatedValues.Concat(dataset.GetVariableValues(targetVariableName)))).Max();
     142        double min = Content.EstimatedTrainingValues.Concat(Content.EstimatedTestValues.Concat(Content.EstimatedValues.Concat(dataset.GetVariableValues(targetVariableName)))).Min();
    143143
    144144        max = max + 0.2 * Math.Abs(max);
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj

    r6184 r6238  
    109109  <ItemGroup>
    110110    <Compile Include="DoubleLimit.cs" />
    111     <Compile Include="Implementation\Classification\ClassificationEnsembleModel.cs">
    112       <SubType>Code</SubType>
    113     </Compile>
    114111    <Compile Include="Implementation\Classification\ClassificationProblemData.cs" />
    115112    <Compile Include="Implementation\Classification\ClassificationProblem.cs" />
     
    118115    <Compile Include="Implementation\Clustering\ClusteringProblemData.cs" />
    119116    <Compile Include="Implementation\Clustering\ClusteringSolution.cs" />
     117    <Compile Include="Implementation\Regression\RegressionEnsembleProblemData.cs" />
    120118    <Compile Include="Implementation\Regression\RegressionEnsembleModel.cs">
    121119      <SubType>Code</SubType>
    122120    </Compile>
    123121    <Compile Include="Implementation\Regression\RegressionEnsembleSolution.cs" />
    124     <Compile Include="Interfaces\Classification\IClassificationEnsembleModel.cs">
    125       <SubType>Code</SubType>
    126     </Compile>
    127     <Compile Include="Interfaces\Classification\IClassificationEnsembleSolution.cs" />
    128122    <Compile Include="Interfaces\Classification\IDiscriminantFunctionThresholdCalculator.cs" />
    129123    <Compile Include="Interfaces\Regression\IRegressionEnsembleModel.cs">
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs

    r6236 r6238  
    7171    }
    7272
    73     public IEnumerable<int> TrainingIndizes {
     73    public virtual IEnumerable<int> TrainingIndizes {
    7474      get {
    7575        return Enumerable.Range(TrainingPartition.Start, TrainingPartition.End - TrainingPartition.Start)
     
    7777      }
    7878    }
    79     public IEnumerable<int> TestIndizes {
     79    public virtual IEnumerable<int> TestIndizes {
    8080      get {
    8181        return Enumerable.Range(TestPartition.Start, TestPartition.End - TestPartition.Start)
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs

    r6184 r6238  
    5151    }
    5252    public RegressionEnsembleSolution(IEnumerable<IRegressionModel> models, IRegressionProblemData problemData)
    53       : base(new RegressionEnsembleModel(models), problemData) {
     53      : base(new RegressionEnsembleModel(models), new RegressionEnsembleProblemData(problemData)) {
    5454      trainingPartitions = new Dictionary<IRegressionModel, IntRange>();
    5555      testPartitions = new Dictionary<IRegressionModel, IntRange>();
     
    6262
    6363    public RegressionEnsembleSolution(IEnumerable<IRegressionModel> models, IRegressionProblemData problemData, IEnumerable<IntRange> trainingPartitions, IEnumerable<IntRange> testPartitions)
    64       : base(new RegressionEnsembleModel(models), problemData) {
     64      : base(new RegressionEnsembleModel(models), new RegressionEnsembleProblemData(problemData)) {
    6565      this.trainingPartitions = new Dictionary<IRegressionModel, IntRange>();
    6666      this.testPartitions = new Dictionary<IRegressionModel, IntRange>();
     
    7575        throw new ArgumentException();
    7676      }
    77 
    7877      RecalculateResults();
    79     }
    80 
    81     private void RecalculateResults() {
    82       double[] estimatedTrainingValues = EstimatedTrainingValues.ToArray(); // cache values
    83       var trainingIndizes = Enumerable.Range(ProblemData.TrainingPartition.Start,
    84         ProblemData.TrainingPartition.End - ProblemData.TrainingPartition.Start);
    85       IEnumerable<double> originalTrainingValues = ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.TargetVariable, trainingIndizes);
    86       double[] estimatedTestValues = EstimatedTestValues.ToArray(); // cache values
    87       IEnumerable<double> originalTestValues = ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.TargetVariable, ProblemData.TestIndizes);
    88 
    89       OnlineCalculatorError errorState;
    90       double trainingMSE = OnlineMeanSquaredErrorCalculator.Calculate(estimatedTrainingValues, originalTrainingValues, out errorState);
    91       TrainingMeanSquaredError = errorState == OnlineCalculatorError.None ? trainingMSE : double.NaN;
    92       double testMSE = OnlineMeanSquaredErrorCalculator.Calculate(estimatedTestValues, originalTestValues, out errorState);
    93       TestMeanSquaredError = errorState == OnlineCalculatorError.None ? testMSE : double.NaN;
    94 
    95       double trainingR2 = OnlinePearsonsRSquaredCalculator.Calculate(estimatedTrainingValues, originalTrainingValues, out errorState);
    96       TrainingRSquared = errorState == OnlineCalculatorError.None ? trainingR2 : double.NaN;
    97       double testR2 = OnlinePearsonsRSquaredCalculator.Calculate(estimatedTestValues, originalTestValues, out errorState);
    98       TestRSquared = errorState == OnlineCalculatorError.None ? testR2 : double.NaN;
    99 
    100       double trainingRelError = OnlineMeanAbsolutePercentageErrorCalculator.Calculate(estimatedTrainingValues, originalTrainingValues, out errorState);
    101       TrainingRelativeError = errorState == OnlineCalculatorError.None ? trainingRelError : double.NaN;
    102       double testRelError = OnlineMeanAbsolutePercentageErrorCalculator.Calculate(estimatedTestValues, originalTestValues, out errorState);
    103       TestRelativeError = errorState == OnlineCalculatorError.None ? testRelError : double.NaN;
    104 
    105       double trainingNMSE = OnlineNormalizedMeanSquaredErrorCalculator.Calculate(estimatedTrainingValues, originalTrainingValues, out errorState);
    106       TrainingNormalizedMeanSquaredError = errorState == OnlineCalculatorError.None ? trainingNMSE : double.NaN;
    107       double testNMSE = OnlineNormalizedMeanSquaredErrorCalculator.Calculate(estimatedTestValues, originalTestValues, out errorState);
    108       TestNormalizedMeanSquaredError = errorState == OnlineCalculatorError.None ? testNMSE : double.NaN;
    10978    }
    11079
     
    11584    public override IEnumerable<double> EstimatedTrainingValues {
    11685      get {
    117         var rows = Enumerable.Range(ProblemData.TrainingPartition.Start, ProblemData.TrainingPartition.End - ProblemData.TrainingPartition.Start);
     86        var rows = ProblemData.TrainingIndizes;
    11887        var estimatedValuesEnumerators = (from model in Model.Models
    11988                                          select new { Model = model, EstimatedValuesEnumerator = model.GetEstimatedValues(ProblemData.Dataset, rows).GetEnumerator() })
    12089                                         .ToList();
    12190        var rowsEnumerator = rows.GetEnumerator();
     91        // aggregate to make sure that MoveNext is called for all enumerators
    12292        while (rowsEnumerator.MoveNext() & estimatedValuesEnumerators.Select(en => en.EstimatedValuesEnumerator.MoveNext()).Aggregate(true, (acc, b) => acc & b)) {
    12393          int currentRow = rowsEnumerator.Current;
     
    134104    public override IEnumerable<double> EstimatedTestValues {
    135105      get {
     106        var rows = ProblemData.TestIndizes;
    136107        var estimatedValuesEnumerators = (from model in Model.Models
    137                                           select new { Model = model, EstimatedValuesEnumerator = model.GetEstimatedValues(ProblemData.Dataset, ProblemData.TestIndizes).GetEnumerator() })
     108                                          select new { Model = model, EstimatedValuesEnumerator = model.GetEstimatedValues(ProblemData.Dataset, rows).GetEnumerator() })
    138109                                         .ToList();
    139110        var rowsEnumerator = ProblemData.TestIndizes.GetEnumerator();
     111        // aggregate to make sure that MoveNext is called for all enumerators
    140112        while (rowsEnumerator.MoveNext() & estimatedValuesEnumerators.Select(en => en.EstimatedValuesEnumerator.MoveNext()).Aggregate(true, (acc, b) => acc & b)) {
    141113          int currentRow = rowsEnumerator.Current;
     
    168140
    169141    private double AggregateEstimatedValues(IEnumerable<double> estimatedValues) {
    170       return estimatedValues.Average();
     142      return estimatedValues.DefaultIfEmpty(double.NaN).Average();
    171143    }
    172144
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs

    r5809 r6238  
    3333  [StorableClass]
    3434  [Item("RegressionProblemData", "Represents an item containing all data defining a regression problem.")]
    35   public sealed class RegressionProblemData : DataAnalysisProblemData, IRegressionProblemData {
     35  public class RegressionProblemData : DataAnalysisProblemData, IRegressionProblemData {
    3636    private const string TargetVariableParameterName = "TargetVariable";
    3737
     
    8585
    8686    [StorableConstructor]
    87     private RegressionProblemData(bool deserializing) : base(deserializing) { }
     87    protected RegressionProblemData(bool deserializing) : base(deserializing) { }
    8888    [StorableHook(HookType.AfterDeserialization)]
    8989    private void AfterDeserialization() {
     
    9292
    9393
    94     private RegressionProblemData(RegressionProblemData original, Cloner cloner)
     94    protected RegressionProblemData(RegressionProblemData original, Cloner cloner)
    9595      : base(original, cloner) {
    9696      RegisterParameterEvents();
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolution.cs

    r6184 r6238  
    5555    public double TrainingMeanSquaredError {
    5656      get { return ((DoubleValue)this[TrainingMeanSquaredErrorResultName].Value).Value; }
    57       protected set { ((DoubleValue)this[TrainingMeanSquaredErrorResultName].Value).Value = value; }
     57      private set { ((DoubleValue)this[TrainingMeanSquaredErrorResultName].Value).Value = value; }
    5858    }
    5959
    6060    public double TestMeanSquaredError {
    6161      get { return ((DoubleValue)this[TestMeanSquaredErrorResultName].Value).Value; }
    62       protected set { ((DoubleValue)this[TestMeanSquaredErrorResultName].Value).Value = value; }
     62      private set { ((DoubleValue)this[TestMeanSquaredErrorResultName].Value).Value = value; }
    6363    }
    6464
    6565    public double TrainingRSquared {
    6666      get { return ((DoubleValue)this[TrainingSquaredCorrelationResultName].Value).Value; }
    67       protected set { ((DoubleValue)this[TrainingSquaredCorrelationResultName].Value).Value = value; }
     67      private set { ((DoubleValue)this[TrainingSquaredCorrelationResultName].Value).Value = value; }
    6868    }
    6969
    7070    public double TestRSquared {
    7171      get { return ((DoubleValue)this[TestSquaredCorrelationResultName].Value).Value; }
    72       protected set { ((DoubleValue)this[TestSquaredCorrelationResultName].Value).Value = value; }
     72      private set { ((DoubleValue)this[TestSquaredCorrelationResultName].Value).Value = value; }
    7373    }
    7474
    7575    public double TrainingRelativeError {
    7676      get { return ((DoubleValue)this[TrainingRelativeErrorResultName].Value).Value; }
    77       protected set { ((DoubleValue)this[TrainingRelativeErrorResultName].Value).Value = value; }
     77      private set { ((DoubleValue)this[TrainingRelativeErrorResultName].Value).Value = value; }
    7878    }
    7979
    8080    public double TestRelativeError {
    8181      get { return ((DoubleValue)this[TestRelativeErrorResultName].Value).Value; }
    82       protected set { ((DoubleValue)this[TestRelativeErrorResultName].Value).Value = value; }
     82      private set { ((DoubleValue)this[TestRelativeErrorResultName].Value).Value = value; }
    8383    }
    8484
    8585    public double TrainingNormalizedMeanSquaredError {
    8686      get { return ((DoubleValue)this[TrainingNormalizedMeanSquaredErrorResultName].Value).Value; }
    87       protected set { ((DoubleValue)this[TrainingNormalizedMeanSquaredErrorResultName].Value).Value = value; }
     87      private set { ((DoubleValue)this[TrainingNormalizedMeanSquaredErrorResultName].Value).Value = value; }
    8888    }
    8989
    9090    public double TestNormalizedMeanSquaredError {
    9191      get { return ((DoubleValue)this[TestNormalizedMeanSquaredErrorResultName].Value).Value; }
    92       protected set { ((DoubleValue)this[TestNormalizedMeanSquaredErrorResultName].Value).Value = value; }
     92      private set { ((DoubleValue)this[TestNormalizedMeanSquaredErrorResultName].Value).Value = value; }
    9393    }
    9494
     
    126126    }
    127127
    128     private void RecalculateResults() {
     128    protected void RecalculateResults() {
    129129      double[] estimatedTrainingValues = EstimatedTrainingValues.ToArray(); // cache values
    130130      IEnumerable<double> originalTrainingValues = ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes);
Note: See TracChangeset for help on using the changeset viewer.