- Timestamp:
- 11/18/15 14:10:12 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.DataPreprocessing/3.4/ProblemDataCreator.cs
r12983 r13252 63 63 var inputVariables = oldProblemData.InputVariables.ToDictionary(x => x.Value, x => x); 64 64 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]); 66 66 problemData.InputVariables.SetItemCheckedState(variable, isChecked); 67 67 } … … 72 72 private IDataAnalysisProblemData CreateRegressionData(RegressionProblemData oldProblemData) { 73 73 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; 76 79 } 77 80 78 81 private IDataAnalysisProblemData CreateClassificationData(ClassificationProblemData oldProblemData) { 79 // target variable must be double and must exist in the new dataset80 82 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); 82 87 newProblemData.PositiveClass = oldProblemData.PositiveClass; 83 88 return newProblemData;
Note: See TracChangeset
for help on using the changeset viewer.