Index: branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingData.cs
===================================================================
--- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingData.cs	(revision 10191)
+++ branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingData.cs	(revision 10192)
@@ -39,4 +39,5 @@
 
     private double trainingToTestRatio;
+    private StatisticInfo statisticInfo;
 
     private PreprocessingData(PreprocessingData original, Cloner cloner)
@@ -75,4 +76,6 @@
       Columns = problemData.Dataset.Columns;
       Rows = problemData.Dataset.Rows;
+
+      statisticInfo = new StatisticInfo(this);
     }
 
@@ -104,5 +107,5 @@
 
     public IEnumerable<T> GetValues<T>(string variableName) {
-      return (IEnumerable<T>)variableValues[variableName];
+        return (IEnumerable<T>)variableValues[variableName];
     }
 
@@ -175,7 +178,66 @@
         return GetValues<string>(variableName).Select((s, i) => new { i, s }).Where(t => string.IsNullOrEmpty(t.s)).Select(t => t.i);
       } else if (IsType<DateTime>(variableName)) {
-        return GetValues<DateTime>(variableName).Select((s, i) => new { i, s }).Where(t => t.s.Equals(DateTime.MinValue)).Select(t => t.i);
+          return GetValues<DateTime>(variableName).Select((s, i) => new { i, s }).Where(t => t.s.Equals(DateTime.MinValue)).Select(t => t.i);
       } else {
         throw new ArgumentException("column with variableName: " + variableName + " contains a non supported type.");
+      }
+    }
+
+    public void ReplaceIndicesByValue<T>(string variableName, IEnumerable<int> indices, T value)
+    {
+        foreach (int index in indices)
+        {
+            SetCell<T>(variableName, index, value);
+        }
+    }
+
+    public void ReplaceIndicesByAverageValue(string variableName, IEnumerable<int> indices) {
+        double average = statisticInfo.GetAverage(variableName);
+        ReplaceIndicesByValue<double>(variableName, indices, average);
+    }
+
+    public void ReplaceIndicesByAverageValue(string variableName, IEnumerable<int> indices) {
+        double median = statisticInfo.GetMedian(variableName);
+        ReplaceIndicesByValue<double>(variableName, indices, median);
+    }
+
+    public void ReplaceIndicesByRandomValue(string variableName, IEnumerable<int> indices) {
+        Random r = new Random();
+
+        double max = statisticInfo.GetMax<double>(variableName);
+        double min = statisticInfo.GetMin<double>(variableName);
+        double randMultiplier = (max - min);
+        foreach (int index in indices)
+        {
+            double rand = r.NextDouble() * randMultiplier + min;
+            SetCell<double>(variableName, index, rand);
+        } 
+    }
+
+    public void ReplaceIndicesByLinearInterpolationOfNeighbours(string variableName, IEnumerable<int> indices) {
+        int countValues = GetValues<double>(variableName).Count();
+        foreach (int index in indices)
+        {
+            // dont replace first or last values
+            if (index > 0 && index < countValues) {
+               double prev = GetCell<double>(variableName, index - 1);
+               double next = GetCell<double>(variableName, index + 1);
+
+               double interpolated = (prev + next) / 2;
+
+               SetCell<double>(variableName, index, interpolated);
+            }
+        } 
+    }
+
+    public void ReplaceIndicesByMostCommonValue(string variableName, IEnumerable<int> indices) {   
+      if (IsType<double>(variableName)) {
+        ReplaceIndicesByValue<double>(variableName, indices,statisticInfo.GetMostCommonValue<double>(variableName));
+      } else if (IsType<string>(variableName)) {
+        ReplaceIndicesByValue<string>(variableName, indices, statisticInfo.GetMostCommonValue<string>(variableName));
+      } else if (IsType<DateTime>(variableName)) {
+        ReplaceIndicesByValue<DateTime>(variableName, indices, statisticInfo.GetMostCommonValue<DateTime>(variableName));
+      } else {
+        throw new ArgumentException("column with index: " + variableName + " contains a non supported type.");
       }
     }
