Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/18/14 19:23:10 (10 years ago)
Author:
bburlacu
Message:

#2246: Preserve selected variables when creating new problem data.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/ProblemDataCreator.cs

    r11171 r11382  
    2222using System;
    2323using System.Collections.Generic;
     24using System.Linq;
    2425using HeuristicLab.Common;
    2526using HeuristicLab.Problems.DataAnalysis;
     
    5859
    5960      SetTrainingAndTestPartition(problemData);
     61      // set the input variables to the correct checked state
     62      var inputVariables = problemData.InputVariables.ToDictionary(x => x.Value, x => x);
     63      foreach (var variable in oldProblemData.InputVariables) {
     64        bool @checked = oldProblemData.InputVariables.ItemChecked(variable);
     65        problemData.InputVariables.SetItemCheckedState(inputVariables[variable.Value], @checked);
     66      }
    6067
    6168      return problemData;
Note: See TracChangeset for help on using the changeset viewer.