Index: trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/GBM/GradientBoostingRegressionAlgorithm.cs
===================================================================
--- trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/GBM/GradientBoostingRegressionAlgorithm.cs	(revision 15766)
+++ trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/GBM/GradientBoostingRegressionAlgorithm.cs	(revision 15769)
@@ -258,5 +258,5 @@
 
           modifiableDataset.RemoveVariable(targetVarName);
-          modifiableDataset.AddVariable(targetVarName, curY.Concat(curYTest));
+          modifiableDataset.AddVariable(targetVarName, curY.Concat(curYTest).ToList());
 
           SampleTrainingData(rand, modifiableDataset, rRows, problemData.Dataset, curY, problemData.TargetVariable, problemData.TrainingIndices); // all training indices from the original problem data are allowed 
Index: trunk/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs
===================================================================
--- trunk/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs	(revision 15766)
+++ trunk/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs	(revision 15769)
@@ -78,6 +78,12 @@
       this.variableValues = new Dictionary<string, IList>(this.variableNames.Count);
       for (int i = 0; i < this.variableNames.Count; i++) {
+        var variableName = this.variableNames[i];
         var values = variableValues.ElementAt(i);
-        this.variableValues.Add(this.variableNames[i], values);
+
+        if (!IsAllowedType(values)) {
+          throw new ArgumentException(string.Format("Unsupported type {0} for variable {1}.", GetElementType(values), variableName));
+        }
+
+        this.variableValues.Add(variableName, values);
       }
     }
@@ -125,4 +131,5 @@
       return new ModifiableDataset(variableNames, values);
     }
+
     /// <summary>
     /// Shuffle a dataset's rows
@@ -249,4 +256,26 @@
     }
 
+    protected Type GetVariableType(string variableName) {
+      IList list;
+      variableValues.TryGetValue(variableName, out list);
+      if (list == null)
+        throw new ArgumentException("The variable " + variableName + " does not exist in the dataset.");
+      return GetElementType(list);
+    }
+
+    protected Type GetElementType(IList list) {
+      var type = list.GetType();
+      return type.IsGenericType ? type.GetGenericArguments()[0] : type.GetElementType();
+    }
+
+    protected bool IsAllowedType(IList list) {
+      var type = GetElementType(list);
+      return IsAllowedType(type);
+    }
+
+    protected bool IsAllowedType(Type type) {
+      return type == typeof(double) || type == typeof(string) || type == typeof(DateTime);
+    }
+
     #region IStringConvertibleMatrix Members
     [Storable]
Index: trunk/HeuristicLab.Problems.DataAnalysis/3.4/ModifiableDataset.cs
===================================================================
--- trunk/HeuristicLab.Problems.DataAnalysis/3.4/ModifiableDataset.cs	(revision 15766)
+++ trunk/HeuristicLab.Problems.DataAnalysis/3.4/ModifiableDataset.cs	(revision 15769)
@@ -105,12 +105,17 @@
 
     // adds a new variable to the dataset
-    public void AddVariable<T>(string variableName, IEnumerable<T> values) {
+    public void AddVariable(string variableName, IList values) {
       if (variableValues.ContainsKey(variableName))
-        throw new ArgumentException("Variable " + variableName + " is already present in the dataset.");
-      int count = values.Count();
-      if (count != rows)
-        throw new ArgumentException("The number of values must exactly match the number of rows in the dataset.");
-      variableValues[variableName] = new List<T>(values);
+        throw new ArgumentException(string.Format("Variable {0} is already present in the dataset.", variableName));
+
+      if (values == null || values.Count == 0)
+        throw new ArgumentException("Cannot add variable with no values.");
+
+      if (!IsAllowedType(values))
+        throw new ArgumentException(string.Format("Unsupported type {0} for variable {1}.", GetElementType(values), variableName));
+
+      variableValues[variableName] = values;
       variableNames.Add(variableName);
+
       OnColumnsChanged();
       OnColumnNamesChanged();
@@ -120,5 +125,5 @@
     public void RemoveVariable(string variableName) {
       if (!variableValues.ContainsKey(variableName))
-        throw new ArgumentException("The variable " + variableName + " does not exist in the dataset.");
+        throw new ArgumentException(string.Format("The variable {0} does not exist in the dataset.", variableName));
       variableValues.Remove(variableName);
       variableNames.Remove(variableName);
@@ -128,5 +133,5 @@
     }
 
-    // slow, avoid to use this
+    // slow, avoid using this
     public void RemoveRow(int row) {
       foreach (var list in variableValues.Values)
@@ -151,12 +156,4 @@
     }
 
-    private Type GetVariableType(string variableName) {
-      IList list;
-      variableValues.TryGetValue(variableName, out list);
-      if (list == null)
-        throw new ArgumentException("The variable " + variableName + " does not exist in the dataset.");
-      return list.GetType().GetGenericArguments()[0];
-    }
-
     bool IStringConvertibleMatrix.SetValue(string value, int rowIndex, int columnIndex) {
       var variableName = variableNames[columnIndex];
