Changeset 17543


Ignore:
Timestamp:
05/18/20 13:14:56 (3 weeks ago)
Author:
mkommend
Message:

#2521: Merged trunk changes into branch (+ corrected type in unit test).

Location:
branches/2521_ProblemRefactoring
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring

  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Views

  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionResidualAnalysisView.cs

    r17457 r17543  
    8888      var ds = problemData.Dataset;
    8989      var runs = new RunCollection();
    90       // determine relevant variables (at least two different values)
    91       var doubleVars = ds.DoubleVariables.Where(vn => ds.GetDoubleValues(vn).Distinct().Skip(1).Any()).ToArray();
    92       var stringVars = ds.StringVariables.Where(vn => ds.GetStringValues(vn).Distinct().Skip(1).Any()).ToArray();
    93       var dateTimeVars = ds.DateTimeVariables.Where(vn => ds.GetDateTimeValues(vn).Distinct().Skip(1).Any()).ToArray();
     90
     91      var doubleVars = ds.DoubleVariables.ToArray();
     92      var stringVars = ds.StringVariables.ToArray();
     93      var dateTimeVars = ds.DateTimeVariables.ToArray();
    9494
    9595      var predictedValues = Content.EstimatedValues.ToArray();
     96      var targetValues = ds.GetReadOnlyDoubleValues(problemData.TargetVariable);
     97
    9698      foreach (var i in problemData.AllIndices) {
    9799        var run = CreateRunForIdx(i, problemData, doubleVars, stringVars, dateTimeVars);
    98         var targetValue = ds.GetDoubleValue(problemData.TargetVariable, i);
    99         AddErrors(run, predictedValues[i], targetValue);
     100        AddErrors(run, predictedValues[i], targetValues[i]);
    100101
    101102        if (problemData.IsTrainingSample(i) && problemData.IsTestSample(i)) {
     
    125126    }
    126127
    127     private void AddErrors(IRun run, double pred, double target) {
     128    private static void AddErrors(IRun run, double pred, double target) {
    128129      var residual = target - pred;
    129130      var relError = residual / target;
     
    136137    }
    137138
    138     private IRun CreateRunForIdx(int i, IRegressionProblemData problemData, IEnumerable<string> doubleVars, IEnumerable<string> stringVars, IEnumerable<string> dateTimeVars) {
     139    private static IRun CreateRunForIdx(int i, IRegressionProblemData problemData, IEnumerable<string> doubleVars, IEnumerable<string> stringVars, IEnumerable<string> dateTimeVars) {
    139140      var ds = problemData.Dataset;
    140141      var run = new Run();
  • branches/2521_ProblemRefactoring/HeuristicLab.Tests/HeuristicLab-3.3/DeepCloneableCloningTest.cs

    r17526 r17543  
    8383      bool success = true;
    8484      foreach (Type deepCloneableType in ApplicationManager.Manager.GetTypes(typeof(IDeepCloneable))) {
    85         // skip types that explicitely choose not to deep-clone every member
     85        // skip types that explicitly choose not to deep-clone every member
    8686        if (excludedTypes.Contains(deepCloneableType)) continue;
    8787        // test only types contained in HL plugin assemblies
Note: See TracChangeset for help on using the changeset viewer.