Index: branches/2906_Transformations/HeuristicLab.DataPreprocessing/3.4/ProblemDataCreator.cs
===================================================================
--- branches/2906_Transformations/HeuristicLab.DataPreprocessing/3.4/ProblemDataCreator.cs	(revision 15880)
+++ branches/2906_Transformations/HeuristicLab.DataPreprocessing/3.4/ProblemDataCreator.cs	(revision 15884)
@@ -23,5 +23,4 @@
 using System.Collections.Generic;
 using System.Linq;
-using HeuristicLab.Common;
 using HeuristicLab.Problems.DataAnalysis;
 
@@ -46,5 +45,4 @@
 
       IDataAnalysisProblemData problemData;
-
       if (oldProblemData is TimeSeriesPrognosisProblemData) {
         problemData = CreateTimeSeriesPrognosisData((TimeSeriesPrognosisProblemData)oldProblemData);
@@ -59,12 +57,6 @@
       }
 
-      SetTrainingAndTestPartition(problemData);
-      SetAllowedInputVariables(problemData, oldProblemData.AllowedInputVariables);
-      // set the input variables to the correct checked state
-      //var inputVariables = oldProblemData.InputVariables.ToDictionary(x => x.Value, x => x);
-      //foreach (var variable in problemData.InputVariables) {
-      //  bool isChecked = inputVariables.ContainsKey(variable.Value) && oldProblemData.InputVariables.ItemChecked(inputVariables[variable.Value]);
-      //  problemData.InputVariables.SetItemCheckedState(variable, isChecked);
-      //}
+      SetTrainingAndTestPartition(problemData, context.Data);
+      SetAllowedInputVariables(problemData, oldProblemData);
 
       return problemData;
@@ -75,6 +67,5 @@
       if (!context.Data.VariableNames.Contains(targetVariable))
         targetVariable = context.Data.VariableNames.First();
-      var inputVariables = GetDoubleInputVariables(targetVariable);
-      var newProblemData = new TimeSeriesPrognosisProblemData(ExportedDataset, inputVariables, targetVariable, CreateDataAnalysisTransformation()) {
+      var newProblemData = new TimeSeriesPrognosisProblemData(ExportedDataset, Enumerable.Empty<string>(), targetVariable, CreateDataAnalysisTransformation()) {
         TrainingHorizon = oldProblemData.TrainingHorizon,
         TestHorizon = oldProblemData.TestHorizon
@@ -84,10 +75,8 @@
 
     private IDataAnalysisProblemData CreateRegressionData(RegressionProblemData oldProblemData) {
-      // TODO: transformations (additional inputs, target changed)
-      var targetVariable = RegressionTransformationModel.GetTransformedTragetVariable(oldProblemData.TargetVariable, CreateDataAnalysisTransformation());
+      var targetVariable = DataAnalysisTransformation.GetLastTransitiveVariable(oldProblemData.TargetVariable, CreateDataAnalysisTransformation());
       if (!context.Data.VariableNames.Contains(targetVariable))
         targetVariable = context.Data.VariableNames.First();
-      var inputVariables = GetDoubleInputVariables(targetVariable);
-      var newProblemData = new RegressionProblemData(ExportedDataset, inputVariables, targetVariable, CreateDataAnalysisTransformation());
+      var newProblemData = new RegressionProblemData(ExportedDataset, Enumerable.Empty<string>(), targetVariable, CreateDataAnalysisTransformation());
       return newProblemData;
     }
@@ -97,6 +86,5 @@
       if (!context.Data.VariableNames.Contains(targetVariable))
         targetVariable = context.Data.VariableNames.First();
-      var inputVariables = GetDoubleInputVariables(targetVariable);
-      var newProblemData = new ClassificationProblemData(ExportedDataset, inputVariables, targetVariable, CreateDataAnalysisTransformation()) {
+      var newProblemData = new ClassificationProblemData(ExportedDataset, Enumerable.Empty<string>(), targetVariable, CreateDataAnalysisTransformation()) {
         PositiveClass = oldProblemData.PositiveClass
       };
@@ -105,10 +93,8 @@
 
     private IDataAnalysisProblemData CreateClusteringData(ClusteringProblemData oldProblemData) {
-      return new ClusteringProblemData(ExportedDataset, GetDoubleInputVariables(String.Empty), CreateDataAnalysisTransformation());
+      return new ClusteringProblemData(ExportedDataset, Enumerable.Empty<string>(), CreateDataAnalysisTransformation());
     }
 
-    private void SetTrainingAndTestPartition(IDataAnalysisProblemData problemData) {
-      var ppData = context.Data;
-
+    private static void SetTrainingAndTestPartition(IDataAnalysisProblemData problemData, IPreprocessingData ppData) {
       problemData.TrainingPartition.Start = ppData.TrainingPartition.Start;
       problemData.TrainingPartition.End = ppData.TrainingPartition.End;
@@ -117,28 +103,18 @@
     }
 
-    void SetAllowedInputVariables(IDataAnalysisProblemData problemData, IEnumerable<string> oldInputVariables) {
-      var inputs = DataAnalysisTransformationModel.ExtendInputVariables(oldInputVariables, problemData.Transformations);
-
+    private static void SetAllowedInputVariables(IDataAnalysisProblemData problemData, IDataAnalysisProblemData oldProblemData) {
+      // original inputs + extended(transitive) inputs
+      var inputs = DataAnalysisTransformation.ExtendVariables(oldProblemData.AllowedInputVariables, problemData.Transformations).ToList();
       foreach (var input in problemData.InputVariables) {
         problemData.InputVariables.SetItemCheckedState(input, inputs.Contains(input.Value));
       }
-    }
 
-    private IEnumerable<string> GetDoubleInputVariables(string targetVariable) {
-      var variableNames = new List<string>();
-      for (int i = 0; i < context.Data.Columns; ++i) {
-        var variableName = context.Data.GetVariableName(i);
-        if (context.Data.VariableHasType<double>(i)
-          && variableName != targetVariable
-          && IsNotConstantInputVariable(context.Data.GetValues<double>(i))) {
-
-          variableNames.Add(variableName);
-        }
+      // new variables that were not created via transformations
+      var originalAndVirtualVariables = DataAnalysisTransformation.ExtendVariables(oldProblemData.Dataset.VariableNames, problemData.Transformations);
+      var newVariables = problemData.Dataset.VariableNames.Except(originalAndVirtualVariables).ToList();
+      foreach (var input in problemData.InputVariables) {
+        if (newVariables.Contains(input.Value))
+          problemData.InputVariables.SetItemCheckedState(input, true);
       }
-      return variableNames;
-    }
-
-    private bool IsNotConstantInputVariable(IList<double> list) {
-      return context.Data.TrainingPartition.End - context.Data.TrainingPartition.Start > 1 || list.Range() > 0;
     }
 
