Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/18/15 14:10:12 (8 years ago)
Author:
pfleck
Message:

#2486

  • Added the possibility to add rows or columns by middle-click on a row or column header.
  • Added a rename columns button which shows the new RenameColumnsDialog.
  • Fixed a bug where no input variables where checked after exporting to a DataAnalysisProblemData.
File:
1 edited

Legend:

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

    r12983 r13252  
    6363      var inputVariables = oldProblemData.InputVariables.ToDictionary(x => x.Value, x => x);
    6464      foreach (var variable in problemData.InputVariables) {
    65         bool isChecked = oldProblemData.InputVariables.Contains(variable) && oldProblemData.InputVariables.ItemChecked(inputVariables[variable.Value]);
     65        bool isChecked = inputVariables.ContainsKey(variable.Value) && oldProblemData.InputVariables.ItemChecked(inputVariables[variable.Value]);
    6666        problemData.InputVariables.SetItemCheckedState(variable, isChecked);
    6767      }
     
    7272    private IDataAnalysisProblemData CreateRegressionData(RegressionProblemData oldProblemData) {
    7373      var targetVariable = oldProblemData.TargetVariable;
    74       // target variable must be double and must exist in the new dataset
    75       return new RegressionProblemData(ExportedDataset, GetDoubleInputVariables(targetVariable), targetVariable, Transformations);
     74      if (!context.Data.VariableNames.Contains(targetVariable))
     75        targetVariable = context.Data.VariableNames.First();
     76      var inputVariables = GetDoubleInputVariables(targetVariable);
     77      var newProblemData = new RegressionProblemData(ExportedDataset, inputVariables, targetVariable, Transformations);
     78      return newProblemData;
    7679    }
    7780
    7881    private IDataAnalysisProblemData CreateClassificationData(ClassificationProblemData oldProblemData) {
    79       // target variable must be double and must exist in the new dataset
    8082      var targetVariable = oldProblemData.TargetVariable;
    81       var newProblemData = new ClassificationProblemData(ExportedDataset, GetDoubleInputVariables(targetVariable), targetVariable, Transformations);
     83      if (!context.Data.VariableNames.Contains(targetVariable))
     84        targetVariable = context.Data.VariableNames.First();
     85      var inputVariables = GetDoubleInputVariables(targetVariable);
     86      var newProblemData = new ClassificationProblemData(ExportedDataset, inputVariables, targetVariable, Transformations);
    8287      newProblemData.PositiveClass = oldProblemData.PositiveClass;
    8388      return newProblemData;
Note: See TracChangeset for help on using the changeset viewer.