Index: branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionErrorCharacteristicsCurveView.cs
===================================================================
--- branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionErrorCharacteristicsCurveView.cs	(revision 14232)
+++ branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionErrorCharacteristicsCurveView.cs	(revision 14238)
@@ -22,4 +22,5 @@
 using System;
 using System.Collections.Generic;
+using System.Diagnostics.Contracts;
 using System.Linq;
 using HeuristicLab.Algorithms.DataAnalysis;
@@ -46,19 +47,43 @@
       if (!problemData.TrainingIndices.Any()) return null; // don't create an LR model if the problem does not have a training set (e.g. loaded into an existing model)
 
-      //clear checked inputVariables
-      foreach (var inputVariable in problemData.InputVariables.CheckedItems) {
-        problemData.InputVariables.SetItemCheckedState(inputVariable.Value, false);
-      }
+      var usedDoubleVariables =
+        Content.Model.SymbolicExpressionTree.IterateNodesPostfix()
+        .OfType<VariableTreeNode>()
+        .Select(node => node.VariableName)
+      .Concat(
+        Content.Model.SymbolicExpressionTree.IterateNodesPostfix()
+        .OfType<VariableConditionTreeNode>()
+        .Select(node => node.VariableName)
+        )
+      .Distinct();
 
-      //check inputVariables used in the symbolic regression model
-      var usedVariables =
-        Content.Model.SymbolicExpressionTree.IterateNodesPostfix().OfType<VariableTreeNode>().Select(
-          node => node.VariableName).Distinct();
-      foreach (var variable in usedVariables) {
-        problemData.InputVariables.SetItemCheckedState(
-          problemData.InputVariables.First(x => x.Value == variable), true);
-      }
+      var usedFactorVariables =
+        Content.Model.SymbolicExpressionTree.IterateNodesPostfix()
+        .OfType<FactorVariableTreeNode>()
+        .Select(node => Tuple.Create(node.VariableName, node.VariableValue))
+        .Distinct();
 
-      var solution = LinearRegression.CreateLinearRegressionSolution(problemData, out rmse, out cvRmsError);
+      // create a new problem and dataset
+      var variableNames =
+        usedDoubleVariables
+        .Concat(usedFactorVariables.Select(t => t.Item1 + "=" + t.Item2))
+        .Concat(new string[] { problemData.TargetVariable })
+        .ToArray();
+      var variableValues =
+        usedDoubleVariables.Select(name => problemData.Dataset.GetDoubleValues(name).ToList())
+        .Concat(
+        // create binary variable
+          usedFactorVariables.Select(t => problemData.Dataset.GetReadOnlyStringValues(t.Item1).Select(val => val == t.Item2 ? 1.0 : 0.0).ToList())
+        )
+        .Concat(new[] { problemData.Dataset.GetDoubleValues(problemData.TargetVariable).ToList() });
+
+      var newDs = new Dataset(variableNames, variableValues);
+      var newProblemData = new RegressionProblemData(newDs, variableNames.Take(variableNames.Length - 1), variableNames.Last());
+      newProblemData.TrainingPartition.Start = problemData.TrainingPartition.Start;
+      newProblemData.TrainingPartition.End = problemData.TrainingPartition.End;
+      newProblemData.TestPartition.Start = problemData.TestPartition.Start;
+      newProblemData.TestPartition.End = problemData.TestPartition.End;
+
+      var solution = LinearRegression.CreateLinearRegressionSolution(newProblemData, out rmse, out cvRmsError);
       solution.Name = "Baseline (linear subset)";
       return solution;
@@ -68,4 +93,8 @@
     protected override IEnumerable<IRegressionSolution> CreateBaselineSolutions() {
       foreach (var sol in base.CreateBaselineSolutions()) yield return sol;
+
+      // does not support lagged variables
+      if (Content.Model.SymbolicExpressionTree.IterateNodesPrefix().OfType<LaggedVariableTreeNode>().Any()) yield break;
+
       yield return CreateLinearRegressionSolution();
     }
