Index: branches/HiveStatistics/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs
===================================================================
--- branches/HiveStatistics/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs	(revision 11203)
+++ branches/HiveStatistics/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs	(revision 11205)
@@ -1,5 +1,5 @@
 #region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -23,4 +23,5 @@
 using System.Collections.Generic;
 using System.Linq;
+using System.Text;
 using HeuristicLab.Collections;
 using HeuristicLab.Common;
@@ -37,4 +38,5 @@
     protected const string TrainingPartitionParameterName = "TrainingPartition";
     protected const string TestPartitionParameterName = "TestPartition";
+    protected const string TransformationsParameterName = "Transformations";
 
     #region parameter properites
@@ -50,4 +52,7 @@
     public IFixedValueParameter<IntRange> TestPartitionParameter {
       get { return (IFixedValueParameter<IntRange>)Parameters[TestPartitionParameterName]; }
+    }
+    public IFixedValueParameter<ReadOnlyItemList<ITransformation>> TransformationsParameter {
+      get { return (IFixedValueParameter<ReadOnlyItemList<ITransformation>>)Parameters[TransformationsParameterName]; }
     }
     #endregion
@@ -88,4 +93,8 @@
     }
 
+    public IEnumerable<ITransformation> Transformations {
+      get { return TransformationsParameter.Value; }
+    }
+
     public virtual bool IsTrainingSample(int index) {
       return index >= 0 && index < Dataset.Rows &&
@@ -110,8 +119,12 @@
     [StorableHook(HookType.AfterDeserialization)]
     private void AfterDeserialization() {
+      if (!Parameters.ContainsKey(TransformationsParameterName)) {
+        Parameters.Add(new FixedValueParameter<ReadOnlyItemList<ITransformation>>(TransformationsParameterName, "", new ItemList<ITransformation>().AsReadOnly()));
+        TransformationsParameter.Hidden = true;
+      }
       RegisterEventHandlers();
     }
 
-    protected DataAnalysisProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables) {
+    protected DataAnalysisProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, IEnumerable<ITransformation> transformations = null) {
       if (dataset == null) throw new ArgumentNullException("The dataset must not be null.");
       if (allowedInputVariables == null) throw new ArgumentNullException("The allowedInputVariables must not be null.");
@@ -129,8 +142,13 @@
       int testPartitionEnd = dataset.Rows;
 
+      var transformationsList = new ItemList<ITransformation>(transformations ?? Enumerable.Empty<ITransformation>());
+
       Parameters.Add(new FixedValueParameter<Dataset>(DatasetParameterName, "", dataset));
       Parameters.Add(new FixedValueParameter<ReadOnlyCheckedItemList<StringValue>>(InputVariablesParameterName, "", inputVariables.AsReadOnly()));
       Parameters.Add(new FixedValueParameter<IntRange>(TrainingPartitionParameterName, "", new IntRange(trainingPartitionStart, trainingPartitionEnd)));
       Parameters.Add(new FixedValueParameter<IntRange>(TestPartitionParameterName, "", new IntRange(testPartitionStart, testPartitionEnd)));
+      Parameters.Add(new FixedValueParameter<ReadOnlyItemList<ITransformation>>(TransformationsParameterName, "", transformationsList.AsReadOnly()));
+
+      TransformationsParameter.Hidden = true;
 
       ((ValueParameter<Dataset>)DatasetParameter).ReactOnValueToStringChangedAndValueItemImageChanged = false;
@@ -143,4 +161,5 @@
       TrainingPartition.ValueChanged += new EventHandler(Parameter_ValueChanged);
       TestPartition.ValueChanged += new EventHandler(Parameter_ValueChanged);
+      TransformationsParameter.ValueChanged += new EventHandler(Parameter_ValueChanged);
     }
 
@@ -158,4 +177,43 @@
       if (listeners != null) listeners(this, EventArgs.Empty);
     }
+
+    protected virtual bool IsProblemDataCompatible(IDataAnalysisProblemData problemData, out string errorMessage) {
+      errorMessage = string.Empty;
+      if (problemData == null) throw new ArgumentNullException("problemData", "The provided problemData is null.");
+
+      //check allowed input variables
+      StringBuilder message = new StringBuilder();
+      var variables = new HashSet<string>(problemData.InputVariables.Select(x => x.Value));
+      foreach (var item in AllowedInputVariables) {
+        if (!variables.Contains(item))
+          message.AppendLine("Input variable '" + item + "' is not present in the new problem data.");
+      }
+
+      if (message.Length != 0) {
+        errorMessage = message.ToString();
+        return false;
+      }
+      return true;
+
+    }
+
+    public virtual void AdjustProblemDataProperties(IDataAnalysisProblemData problemData) {
+      DataAnalysisProblemData data = problemData as DataAnalysisProblemData;
+      if (data == null) throw new ArgumentException("The problem data is not a data analysis problem data. Instead a " + problemData.GetType().GetPrettyName() + " was provided.", "problemData");
+
+      string errorMessage;
+      if (!data.IsProblemDataCompatible(this, out errorMessage)) {
+        throw new InvalidOperationException(errorMessage);
+      }
+
+      foreach (var inputVariable in InputVariables) {
+        var variable = data.InputVariables.FirstOrDefault(i => i.Value == inputVariable.Value);
+        InputVariables.SetItemCheckedState(inputVariable, variable != null && data.InputVariables.ItemChecked(variable));
+      }
+
+      TrainingPartition.Start = TrainingPartition.End = 0;
+      TestPartition.Start = 0;
+      TestPartition.End = Dataset.Rows;
+    }
   }
 }
