Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Glmnet/3.4/ElasticNetLinearRegression.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Glmnet/3.4/ElasticNetLinearRegression.cs	(revision 15045)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Glmnet/3.4/ElasticNetLinearRegression.cs	(revision 15046)
@@ -88,13 +88,18 @@
     }
 
-    private void CreateSolution(double lambda) {
+  private void CreateSolution(double lambda) {
       double trainNMSE;
       double testNMSE;
-      var coeff = CreateElasticNetLinearRegressionSolution(Problem.ProblemData, Penality, lambda, out trainNMSE, out testNMSE);
+      var coeff = CalculateModelCoefficients(Problem.ProblemData, Penality, lambda, out trainNMSE, out testNMSE);
       Results.Add(new Result("NMSE (train)", new DoubleValue(trainNMSE)));
       Results.Add(new Result("NMSE (test)", new DoubleValue(testNMSE)));
 
-      var ds = Problem.ProblemData.Dataset;
-      var allVariables = Problem.ProblemData.AllowedInputVariables.ToArray();
+      var solution = CreateSymbolicSolution(coeff, Problem.ProblemData);
+      Results.Add(new Result(solution.Name, solution.Description, solution));
+    }
+
+    public static IRegressionSolution CreateSymbolicSolution(double[] coeff, IRegressionProblemData problemData) {
+      var ds = problemData.Dataset;
+      var allVariables = problemData.AllowedInputVariables.ToArray();
       var doubleVariables = allVariables.Where(ds.VariableHasType<double>);
       var factorVariableNames = allVariables.Where(ds.VariableHasType<string>);
@@ -130,5 +135,5 @@
       }
       var tree = LinearModelToTreeConverter.CreateTree(
-        remainingFactorVariablesAndValues, factorCoeff.ToArray(), 
+        remainingFactorVariablesAndValues, factorCoeff.ToArray(),
         remainingDoubleVariables.ToArray(), doubleVarCoeff.ToArray(),
         coeff.Last());
@@ -136,10 +141,10 @@
 
       SymbolicRegressionSolution solution = new SymbolicRegressionSolution(
-        new SymbolicRegressionModel(Problem.ProblemData.TargetVariable, tree, new SymbolicDataAnalysisExpressionTreeInterpreter()),
-        (IRegressionProblemData)Problem.ProblemData.Clone());
+        new SymbolicRegressionModel(problemData.TargetVariable, tree, new SymbolicDataAnalysisExpressionTreeInterpreter()),
+        (IRegressionProblemData)problemData.Clone());
       solution.Model.Name = "Elastic-net Linear Regression Model";
       solution.Name = "Elastic-net Linear Regression Solution";
 
-      Results.Add(new Result(solution.Name, solution.Description, solution));
+      return solution;
     }
 
@@ -242,5 +247,5 @@
     }
 
-    public static double[] CreateElasticNetLinearRegressionSolution(IRegressionProblemData problemData, double penalty, double lambda,
+    public static double[] CalculateModelCoefficients(IRegressionProblemData problemData, double penalty, double lambda,
             out double trainNMSE, out double testNMSE,
             double coeffLowerBound = double.NegativeInfinity, double coeffUpperBound = double.PositiveInfinity) {
@@ -248,10 +253,10 @@
       double[] testNMSEs;
       // run for exactly one lambda
-      var coeffs = CreateElasticNetLinearRegressionSolution(problemData, penalty, new double[] { lambda }, out trainNMSEs, out testNMSEs, coeffLowerBound, coeffUpperBound);
+      var coeffs = CalculateModelCoefficients(problemData, penalty, new double[] { lambda }, out trainNMSEs, out testNMSEs, coeffLowerBound, coeffUpperBound);
       trainNMSE = trainNMSEs[0];
       testNMSE = testNMSEs[0];
       return coeffs[0];
     }
-    public static double[][] CreateElasticNetLinearRegressionSolution(IRegressionProblemData problemData, double penalty, double[] lambda,
+    public static double[][] CalculateModelCoefficients(IRegressionProblemData problemData, double penalty, double[] lambda,
             out double[] trainNMSEs, out double[] testNMSEs,
             double coeffLowerBound = double.NegativeInfinity, double coeffUpperBound = double.PositiveInfinity,
