Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/17/12 13:48:11 (13 years ago)
Author:
sforsten
Message:

#1830:

  • set the size of the cache in the constructor of RegressionSolution
  • don't convert the IEnumerable in CalculateResults to arrays anymore
Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolution.cs

    r7259 r7735  
    4444    protected RegressionSolution(IRegressionModel model, IRegressionProblemData problemData)
    4545      : base(model, problemData) {
    46       evaluationCache = new Dictionary<int, double>();
     46      evaluationCache = new Dictionary<int, double>(problemData.Dataset.Rows);
    4747    }
    4848
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionBase.cs

    r7272 r7735  
    2121
    2222using System.Collections.Generic;
    23 using System.Linq;
    2423using HeuristicLab.Common;
    2524using HeuristicLab.Data;
     
    166165
    167166    protected void CalculateResults() {
    168       double[] estimatedTrainingValues = EstimatedTrainingValues.ToArray(); // cache values
    169       double[] originalTrainingValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).ToArray();
    170       double[] estimatedTestValues = EstimatedTestValues.ToArray(); // cache values
    171       double[] originalTestValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndizes).ToArray();
     167      IEnumerable<double> estimatedTrainingValues = EstimatedTrainingValues; // cache values
     168      IEnumerable<double> originalTrainingValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes);
     169      IEnumerable<double> estimatedTestValues = EstimatedTestValues; // cache values
     170      IEnumerable<double> originalTestValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndizes);
    172171
    173172      OnlineCalculatorError errorState;
Note: See TracChangeset for help on using the changeset viewer.