Index: /trunk/HeuristicLab 3.3.sln
===================================================================
--- /trunk/HeuristicLab 3.3.sln	(revision 17079)
+++ /trunk/HeuristicLab 3.3.sln	(revision 17080)
@@ -468,6 +468,4 @@
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.ExactOptimization.Views-3.3", "HeuristicLab.ExactOptimization.Views\3.3\HeuristicLab.ExactOptimization.Views-3.3.csproj", "{D1D69043-17E6-4B8C-BF41-0799C7E56032}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Algorithms.DataAnalysis.M5-3.4", "HeuristicLab.Algorithms.DataAnalysis.M5\3.4\HeuristicLab.Algorithms.DataAnalysis.M5-3.4.csproj", "{CCC5D1F9-0551-4BF3-8898-E4C44B52E5A6}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Algorithms.DataAnalysis.DecisionTrees-3.4", "HeuristicLab.Algorithms.DataAnalysis.DecisionTrees\3.4\HeuristicLab.Algorithms.DataAnalysis.DecisionTrees-3.4.csproj", "{541A53F3-E6A7-402F-91BB-D76041CDD9FD}"
@@ -2283,16 +2281,4 @@
 		{D1D69043-17E6-4B8C-BF41-0799C7E56032}.Release|x86.ActiveCfg = Release|x86
 		{D1D69043-17E6-4B8C-BF41-0799C7E56032}.Release|x86.Build.0 = Release|x86
-		{CCC5D1F9-0551-4BF3-8898-E4C44B52E5A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{CCC5D1F9-0551-4BF3-8898-E4C44B52E5A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{CCC5D1F9-0551-4BF3-8898-E4C44B52E5A6}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{CCC5D1F9-0551-4BF3-8898-E4C44B52E5A6}.Debug|x64.Build.0 = Debug|Any CPU
-		{CCC5D1F9-0551-4BF3-8898-E4C44B52E5A6}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{CCC5D1F9-0551-4BF3-8898-E4C44B52E5A6}.Debug|x86.Build.0 = Debug|Any CPU
-		{CCC5D1F9-0551-4BF3-8898-E4C44B52E5A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{CCC5D1F9-0551-4BF3-8898-E4C44B52E5A6}.Release|Any CPU.Build.0 = Release|Any CPU
-		{CCC5D1F9-0551-4BF3-8898-E4C44B52E5A6}.Release|x64.ActiveCfg = Release|Any CPU
-		{CCC5D1F9-0551-4BF3-8898-E4C44B52E5A6}.Release|x64.Build.0 = Release|Any CPU
-		{CCC5D1F9-0551-4BF3-8898-E4C44B52E5A6}.Release|x86.ActiveCfg = Release|Any CPU
-		{CCC5D1F9-0551-4BF3-8898-E4C44B52E5A6}.Release|x86.Build.0 = Release|Any CPU
 		{541A53F3-E6A7-402F-91BB-D76041CDD9FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{541A53F3-E6A7-402F-91BB-D76041CDD9FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
Index: /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/DecisionTreeRegression.cs
===================================================================
--- /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/DecisionTreeRegression.cs	(revision 17079)
+++ /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/DecisionTreeRegression.cs	(revision 17080)
@@ -38,6 +38,6 @@
   [StorableType("FC8D8E5A-D16D-41BB-91CF-B2B35D17ADD7")]
   [Creatable(CreatableAttribute.Categories.DataAnalysisRegression, Priority = 95)]
-  [Item("M5RegressionTree", "A M5 regression tree / rule set")]
-  public sealed class M5Regression : FixedDataAnalysisAlgorithm<IRegressionProblem> {
+  [Item("Decision tree regression", "A regression tree / rule set learner")]
+  public sealed class DecisionTreeRegression : FixedDataAnalysisAlgorithm<IRegressionProblem> {
     public override bool SupportsPause {
       get { return true; }
@@ -135,9 +135,9 @@
     #region Constructors and Cloning
     [StorableConstructor]
-    private M5Regression(StorableConstructorFlag _) : base(_) { }
-    private M5Regression(M5Regression original, Cloner cloner) : base(original, cloner) {
+    private DecisionTreeRegression(StorableConstructorFlag _) : base(_) { }
+    private DecisionTreeRegression(DecisionTreeRegression original, Cloner cloner) : base(original, cloner) {
       stateScope = cloner.Clone(stateScope);
     }
-    public M5Regression() {
+    public DecisionTreeRegression() {
       var modelSet = new ItemSet<ILeafModel>(ApplicationManager.Manager.GetInstances<ILeafModel>());
       var pruningSet = new ItemSet<IPruning>(ApplicationManager.Manager.GetInstances<IPruning>());
@@ -145,5 +145,5 @@
       Parameters.Add(new FixedValueParameter<BoolValue>(GenerateRulesParameterName, "Whether a set of rules or a decision tree shall be created (default=false)", new BoolValue(false)));
       Parameters.Add(new FixedValueParameter<PercentValue>(HoldoutSizeParameterName, "How much of the training set shall be reserved for pruning (default=20%).", new PercentValue(0.2)));
-      Parameters.Add(new ConstrainedValueParameter<ISplitter>(SplitterParameterName, "The type of split function used to create node splits (default='M5Splitter').", splitterSet, splitterSet.OfType<M5Splitter>().First()));
+      Parameters.Add(new ConstrainedValueParameter<ISplitter>(SplitterParameterName, "The type of split function used to create node splits (default='Splitter').", splitterSet, splitterSet.OfType<M5Splitter>().First()));
       Parameters.Add(new FixedValueParameter<IntValue>(MinimalNodeSizeParameterName, "The minimal number of samples in a leaf node (default=1).", new IntValue(1)));
       Parameters.Add(new ConstrainedValueParameter<ILeafModel>(LeafModelParameterName, "The type of model used for the nodes (default='LinearLeaf').", modelSet, modelSet.OfType<LinearLeaf>().First()));
@@ -155,5 +155,5 @@
     }
     public override IDeepCloneable Clone(Cloner cloner) {
-      return new M5Regression(this, cloner);
+      return new DecisionTreeRegression(this, cloner);
     }
     #endregion
@@ -204,8 +204,8 @@
       var doubleVars = new HashSet<string>(problemData.Dataset.DoubleVariables);
       var vars = problemData.AllowedInputVariables.Concat(new[] {problemData.TargetVariable}).ToArray();
-      if (vars.Any(v => !doubleVars.Contains(v))) throw new NotSupportedException("M5 regression supports only double valued input or output features.");
+      if (vars.Any(v => !doubleVars.Contains(v))) throw new NotSupportedException("Decision tree regression supports only double valued input or output features.");
       var doubles = vars.Select(v => problemData.Dataset.GetDoubleValues(v, problemData.TrainingIndices).ToArray()).ToArray();
       if (doubles.Any(v => v.Any(x => double.IsNaN(x) || double.IsInfinity(x))))
-        throw new NotSupportedException("M5 regression does not support NaN or infinity values in the input dataset.");
+        throw new NotSupportedException("Decision tree regression does not support NaN or infinity values in the input dataset.");
       var trainingData = new Dataset(vars, doubles);
       var pd = new RegressionProblemData(trainingData, problemData.AllowedInputVariables, problemData.TargetVariable);
@@ -283,5 +283,5 @@
       var ruleSet = solution.Model as RegressionRuleSetModel;
       if (ruleSet != null) {
-        results.Add(RegressionTreeAnalyzer.CreateRulesResult(ruleSet, problemData, "M5Rules", true));
+        results.Add(RegressionTreeAnalyzer.CreateRulesResult(ruleSet, problemData, "Rules", true));
         frequencies = RegressionTreeAnalyzer.GetRuleVariableFrequences(ruleSet);
         results.Add(RegressionTreeAnalyzer.CreateCoverageDiagram(ruleSet, problemData));
Index: /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees-3.4.csproj
===================================================================
--- /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees-3.4.csproj	(revision 17079)
+++ /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees-3.4.csproj	(revision 17080)
@@ -68,6 +68,6 @@
   <ItemGroup>
     <Compile Include="DecisionTreeRegression.cs" />
+    <Compile Include="Interfaces\IDecisionTreeModel.cs" />
     <Compile Include="Interfaces\ILeafModel.cs" />
-    <Compile Include="Interfaces\IM5Model.cs" />
     <Compile Include="Interfaces\IPruning.cs" />
     <Compile Include="Interfaces\ISplitter.cs" />
@@ -79,8 +79,8 @@
     <Compile Include="LeafTypes\ConstantLeaf.cs" />
     <Compile Include="LeafTypes\GaussianProcessLeaf.cs" />
+    <Compile Include="LeafTypes\Leaf.cs" />
     <Compile Include="LeafTypes\LeafBase.cs" />
     <Compile Include="LeafTypes\LinearLeaf.cs" />
-    <Compile Include="LeafTypes\M5Leaf.cs" />
-    <Compile Include="LeafTypes\M5regLeaf.cs" />
+    <Compile Include="LeafTypes\RegularizedLeaf.cs" />
     <Compile Include="MetaModels\RegressionNodeModel.cs" />
     <Compile Include="MetaModels\RegressionNodeTreeModel.cs" />
@@ -93,7 +93,7 @@
     <Compile Include="Splitting\CorrelationImpurityCalculator.cs" />
     <Compile Include="Splitting\CorrelationSplitter.cs" />
-    <Compile Include="Splitting\M5Splitter.cs" />
     <Compile Include="Splitting\NeumaierSum.cs" />
     <Compile Include="Splitting\OrderImpurityCalculator.cs" />
+    <Compile Include="Splitting\Splitter.cs" />
     <Compile Include="Splitting\SplitterBase.cs" />
     <Compile Include="Splitting\UnivariateOnlineLR.cs" />
Index: /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/Interfaces/IDecisionTreeModel.cs
===================================================================
--- /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/Interfaces/IDecisionTreeModel.cs	(revision 17080)
+++ /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/Interfaces/IDecisionTreeModel.cs	(revision 17080)
@@ -0,0 +1,35 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using System.Threading;
+using HeuristicLab.Core;
+using HeuristicLab.Optimization;
+using HeuristicLab.Problems.DataAnalysis;
+using HEAL.Attic;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableType("A5399E6A-6A4D-4616-A1CD-CE12FE670F12")]
+  public interface IM5Model : IRegressionModel {
+    void Build(IReadOnlyList<int> trainingRows, IReadOnlyList<int> pruningRows, IScope stateScope, ResultCollection results, CancellationToken cancellationToken);
+    void Update(IReadOnlyList<int> rows, IScope stateScope, CancellationToken cancellationToken);
+  }
+}
Index: unk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/Interfaces/IM5Model.cs
===================================================================
--- /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/Interfaces/IM5Model.cs	(revision 17079)
+++ 	(revision )
@@ -1,35 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System.Collections.Generic;
-using System.Threading;
-using HeuristicLab.Core;
-using HeuristicLab.Optimization;
-using HeuristicLab.Problems.DataAnalysis;
-using HEAL.Attic;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableType("A5399E6A-6A4D-4616-A1CD-CE12FE670F12")]
-  public interface IM5Model : IRegressionModel {
-    void Build(IReadOnlyList<int> trainingRows, IReadOnlyList<int> pruningRows, IScope stateScope, ResultCollection results, CancellationToken cancellationToken);
-    void Update(IReadOnlyList<int> rows, IScope stateScope, CancellationToken cancellationToken);
-  }
-}
Index: /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/LeafTypes/Leaf.cs
===================================================================
--- /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/LeafTypes/Leaf.cs	(revision 17080)
+++ /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/LeafTypes/Leaf.cs	(revision 17080)
@@ -0,0 +1,198 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2017 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Problems.DataAnalysis;
+using HEAL.Attic;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableType("58517042-5318-4087-B098-AC75F0208BA0")]
+  [Item("M5Leaf", "A leaf type that uses regularized linear models with feature selection as leaf models.")]
+  public sealed class M5Leaf : LeafBase {
+    #region Constructors & Cloning
+    [StorableConstructor]
+    private M5Leaf(StorableConstructorFlag _) : base(_) { }
+    private M5Leaf(M5Leaf original, Cloner cloner) : base(original, cloner) { }
+    public M5Leaf() { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new M5Leaf(this, cloner);
+    }
+    #endregion
+
+    #region IModelType
+    public override bool ProvidesConfidence {
+      get { return false; }
+    }
+    public override IRegressionModel Build(IRegressionProblemData pd, IRandom random, CancellationToken cancellationToken, out int numberOfParameters) {
+      if (pd.Dataset.Rows == 0) throw new ArgumentException("The number of training instances is too small to create an M5 leaf model");
+
+      if (pd.Dataset.Rows == 1)
+        return new ConstantLeaf().Build(pd, random, cancellationToken, out numberOfParameters);
+
+      var means = pd.AllowedInputVariables.ToDictionary(n => n, n => pd.Dataset.GetDoubleValues(n, pd.TrainingIndices).Average());
+      var variances = pd.AllowedInputVariables.ToDictionary(n => n, n => pd.Dataset.GetDoubleValues(n, pd.TrainingIndices).Variance());
+      var used = pd.AllowedInputVariables.Where(v => !variances[v].IsAlmost(0.0)).ToList();
+
+      var targetMean = pd.TargetVariableTrainingValues.Average();
+      var targetVariance = pd.TargetVariableTrainingValues.Variance();
+
+      var model = FindBestModel(variances, means, targetMean, targetVariance, pd, used);
+      numberOfParameters = 1 + model.Coefficients.Count;
+      return model;
+    }
+    public override int MinLeafSize(IRegressionProblemData pd) {
+      return 1;
+    }
+    #endregion
+
+    private static PreconstructedLinearModel FindBestModel(Dictionary<string, double> variances, Dictionary<string, double> means, double yMean, double yVariance, IRegressionProblemData pd, IList<string> variables) {
+      Dictionary<string, double> coeffs;
+      double intercept;
+      do {
+        coeffs = DoRegression(pd, variables, variances, means, yMean, 1.0e-8, out intercept);
+        variables = DeselectColinear(variances, coeffs, yVariance, pd, variables);
+      }
+      while (coeffs.Count != variables.Count);
+      var numAtts = variables.Count;
+      var numInst = pd.TrainingIndices.Count();
+      var fullMse = CalculateSE(coeffs, intercept, pd, variables);
+      var akaike = 1.0 * (numInst - numAtts) + 2 * numAtts;
+
+      var improved = true;
+      var currentNumAttributes = numAtts;
+
+      while (improved && currentNumAttributes > 1) {
+        improved = false;
+        currentNumAttributes--;
+        // Find attribute with smallest SC (variance-scaled coefficient)
+        var candidate = variables.ToDictionary(v => v, v => Math.Abs(coeffs[v] * Math.Sqrt(variances[v] / yVariance)))
+          .OrderBy(x => x.Value).Select(x => x.Key).First();
+
+        var currVariables = variables.Where(v => !v.Equals(candidate)).ToList();
+        var currentIntercept = 0.0;
+        var currentCoeffs = DoRegression(pd, currVariables, variances, means, yMean, 1.0e-8, out currentIntercept);
+        var currentMse = CalculateSE(currentCoeffs, currentIntercept, pd, currVariables);
+        var currentAkaike = currentMse / fullMse * (numInst - numAtts) + 2 * currentNumAttributes;
+
+        if (!(currentAkaike < akaike)) continue;
+        improved = true;
+        akaike = currentAkaike;
+        coeffs = currentCoeffs;
+        intercept = currentIntercept;
+        variables = currVariables;
+      }
+
+      var pd2 = new RegressionProblemData(pd.Dataset, variables, pd.TargetVariable);
+      pd2.TestPartition.End = pd.TestPartition.End;
+      pd2.TestPartition.Start = pd.TestPartition.Start;
+      pd2.TrainingPartition.End = pd.TrainingPartition.End;
+      pd2.TrainingPartition.Start = pd.TrainingPartition.Start;
+
+      return new PreconstructedLinearModel(coeffs, intercept, pd.TargetVariable);
+    }
+
+    private static Dictionary<string, double> DoRegression(IRegressionProblemData pd, IList<string> variables, Dictionary<string, double> variances, Dictionary<string, double> means, double yMean, double ridge, out double intercept) {
+
+      var n = variables.Count;
+      var m = pd.TrainingIndices.Count();
+
+      var inTr = new double[n, m];
+      for (var i = 0; i < n; i++) {
+        var v = variables[i];
+        var vdata = pd.Dataset.GetDoubleValues(v, pd.TrainingIndices).ToArray();
+        var sd = Math.Sqrt(variances[v]);
+        var mean = means[v];
+        for (var j = 0; j < m; j++) {
+          inTr[i, j] = (vdata[j] - mean) / sd;
+        }
+      }
+
+      var y = new double[m, 1];
+      var ydata = pd.TargetVariableTrainingValues.ToArray();
+      for (var i = 0; i < m; i++)
+        y[i, 0] = ydata[i]; //no scaling for targets;
+
+
+      var aTy = new double[n, 1];
+      alglib.rmatrixgemm(n, 1, m, 1, inTr, 0, 0, 0, y, 0, 0, 0, 0, ref aTy, 0, 0); //aTy = inTr * y;
+      var aTa = new double[n, n];
+      alglib.rmatrixgemm(n, n, m, 1, inTr, 0, 0, 0, inTr, 0, 0, 1, 0, ref aTa, 0, 0); //aTa = inTr * t(inTr) +aTa //
+
+      var aTaDecomp = new double[n, n];
+      bool success;
+      var tries = 0;
+      double[] coefficients = null;
+      do {
+        for (var i = 0; i < n; i++) aTa[i, i] += ridge; // add ridge to diagonal to enforce singularity
+        try {
+          //solve "aTa * coefficients = aTy" for coefficients;
+          Array.Copy(aTa, 0, aTaDecomp, 0, aTa.Length);
+          alglib.spdmatrixcholesky(ref aTaDecomp, n, true);
+          int info;
+          alglib.densesolverreport report;
+          alglib.spdmatrixcholeskysolve(aTaDecomp, n, true, ydata, out info, out report, out coefficients);
+
+          if (info != 1) throw new Exception();
+          success = true;
+        }
+        catch (Exception) {
+          for (var i = 0; i < n; i++) aTa[i, i] -= ridge;
+          ridge *= 10; // increase ridge;
+          success = false;
+        }
+        finally {
+          tries++;
+        }
+      }
+      while (!success && tries < 100);
+      if (coefficients == null || coefficients.Length != n) throw new ArgumentException("No linear model could be built");
+
+      intercept = yMean;
+      var res = new Dictionary<string, double>();
+      for (var i = 0; i < n; i++) {
+        var v = variables[i];
+        res.Add(v, coefficients[i] /= Math.Sqrt(variances[v]));
+        intercept -= coefficients[i] * means[v];
+      }
+
+      return res;
+    }
+
+    private static IList<string> DeselectColinear(Dictionary<string, double> variances, Dictionary<string, double> coeffs, double yVariance, IRegressionProblemData pd, IList<string> variables) {
+      var candidates = variables.ToDictionary(v => v, v => Math.Abs(coeffs[v] * Math.Sqrt(variances[v] / yVariance))).Where(x => x.Value > 1.5).OrderBy(x => -x.Value).ToList();
+      if (candidates.Count == 0) return variables;
+      var c = candidates.First().Key;
+      return variables.Where(v => !v.Equals(c)).ToList();
+    }
+
+    private static double CalculateSE(Dictionary<string, double> coefficients, double intercept, IRegressionProblemData pd, IList<string> variables) {
+      return pd.TrainingIndices.Select(i => RegressionPrediction(i, pd, variables, coefficients, intercept) - pd.Dataset.GetDoubleValue(pd.TargetVariable, i)).Select(error => error * error).Sum();
+    }
+    private static double RegressionPrediction(int i, IRegressionProblemData pd, IList<string> variables, Dictionary<string, double> coefficients, double intercept) {
+      return intercept + variables.Sum(v => pd.Dataset.GetDoubleValue(v, i) * coefficients[v]);
+    }
+  }
+}
Index: /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/LeafTypes/LeafBase.cs
===================================================================
--- /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/LeafTypes/LeafBase.cs	(revision 17079)
+++ /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/LeafTypes/LeafBase.cs	(revision 17080)
@@ -72,5 +72,5 @@
 
     public void Build(RegressionNodeTreeModel tree, IReadOnlyList<int> trainingRows, IScope stateScope, CancellationToken cancellationToken) {
-      var parameters = (RegressionTreeParameters)stateScope.Variables[M5Regression.RegressionTreeParameterVariableName].Value;
+      var parameters = (RegressionTreeParameters)stateScope.Variables[DecisionTreeRegression.RegressionTreeParameterVariableName].Value;
       var state = (LeafBuildingState)stateScope.Variables[LeafBuildingStateVariableName].Value;
 
Index: /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/LeafTypes/LinearLeaf.cs
===================================================================
--- /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/LeafTypes/LinearLeaf.cs	(revision 17079)
+++ /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/LeafTypes/LinearLeaf.cs	(revision 17080)
@@ -30,5 +30,5 @@
 namespace HeuristicLab.Algorithms.DataAnalysis {
   [StorableType("347CA25D-FB37-4C4F-9B61-9D79288B2B28")]
-  [Item("LinearLeaf", "A leaf type that uses linear models as leaf models. This is the standard for M5' regression")]
+  [Item("LinearLeaf", "A leaf type that uses linear models as leaf models. This is the standard for decision tree regression")]
   public class LinearLeaf : LeafBase {
     #region Constructors & Cloning
Index: unk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/LeafTypes/M5Leaf.cs
===================================================================
--- /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/LeafTypes/M5Leaf.cs	(revision 17079)
+++ 	(revision )
@@ -1,198 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2017 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Problems.DataAnalysis;
-using HEAL.Attic;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableType("58517042-5318-4087-B098-AC75F0208BA0")]
-  [Item("M5Leaf", "A leaf type that uses regularized linear models with feature selection as leaf models.")]
-  public sealed class M5Leaf : LeafBase {
-    #region Constructors & Cloning
-    [StorableConstructor]
-    private M5Leaf(StorableConstructorFlag _) : base(_) { }
-    private M5Leaf(M5Leaf original, Cloner cloner) : base(original, cloner) { }
-    public M5Leaf() { }
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new M5Leaf(this, cloner);
-    }
-    #endregion
-
-    #region IModelType
-    public override bool ProvidesConfidence {
-      get { return false; }
-    }
-    public override IRegressionModel Build(IRegressionProblemData pd, IRandom random, CancellationToken cancellationToken, out int numberOfParameters) {
-      if (pd.Dataset.Rows == 0) throw new ArgumentException("The number of training instances is too small to create an M5 leaf model");
-
-      if (pd.Dataset.Rows == 1)
-        return new ConstantLeaf().Build(pd, random, cancellationToken, out numberOfParameters);
-
-      var means = pd.AllowedInputVariables.ToDictionary(n => n, n => pd.Dataset.GetDoubleValues(n, pd.TrainingIndices).Average());
-      var variances = pd.AllowedInputVariables.ToDictionary(n => n, n => pd.Dataset.GetDoubleValues(n, pd.TrainingIndices).Variance());
-      var used = pd.AllowedInputVariables.Where(v => !variances[v].IsAlmost(0.0)).ToList();
-
-      var targetMean = pd.TargetVariableTrainingValues.Average();
-      var targetVariance = pd.TargetVariableTrainingValues.Variance();
-
-      var model = FindBestModel(variances, means, targetMean, targetVariance, pd, used);
-      numberOfParameters = 1 + model.Coefficients.Count;
-      return model;
-    }
-    public override int MinLeafSize(IRegressionProblemData pd) {
-      return 1;
-    }
-    #endregion
-
-    private static PreconstructedLinearModel FindBestModel(Dictionary<string, double> variances, Dictionary<string, double> means, double yMean, double yVariance, IRegressionProblemData pd, IList<string> variables) {
-      Dictionary<string, double> coeffs;
-      double intercept;
-      do {
-        coeffs = DoRegression(pd, variables, variances, means, yMean, 1.0e-8, out intercept);
-        variables = DeselectColinear(variances, coeffs, yVariance, pd, variables);
-      }
-      while (coeffs.Count != variables.Count);
-      var numAtts = variables.Count;
-      var numInst = pd.TrainingIndices.Count();
-      var fullMse = CalculateSE(coeffs, intercept, pd, variables);
-      var akaike = 1.0 * (numInst - numAtts) + 2 * numAtts;
-
-      var improved = true;
-      var currentNumAttributes = numAtts;
-
-      while (improved && currentNumAttributes > 1) {
-        improved = false;
-        currentNumAttributes--;
-        // Find attribute with smallest SC (variance-scaled coefficient)
-        var candidate = variables.ToDictionary(v => v, v => Math.Abs(coeffs[v] * Math.Sqrt(variances[v] / yVariance)))
-          .OrderBy(x => x.Value).Select(x => x.Key).First();
-
-        var currVariables = variables.Where(v => !v.Equals(candidate)).ToList();
-        var currentIntercept = 0.0;
-        var currentCoeffs = DoRegression(pd, currVariables, variances, means, yMean, 1.0e-8, out currentIntercept);
-        var currentMse = CalculateSE(currentCoeffs, currentIntercept, pd, currVariables);
-        var currentAkaike = currentMse / fullMse * (numInst - numAtts) + 2 * currentNumAttributes;
-
-        if (!(currentAkaike < akaike)) continue;
-        improved = true;
-        akaike = currentAkaike;
-        coeffs = currentCoeffs;
-        intercept = currentIntercept;
-        variables = currVariables;
-      }
-
-      var pd2 = new RegressionProblemData(pd.Dataset, variables, pd.TargetVariable);
-      pd2.TestPartition.End = pd.TestPartition.End;
-      pd2.TestPartition.Start = pd.TestPartition.Start;
-      pd2.TrainingPartition.End = pd.TrainingPartition.End;
-      pd2.TrainingPartition.Start = pd.TrainingPartition.Start;
-
-      return new PreconstructedLinearModel(coeffs, intercept, pd.TargetVariable);
-    }
-
-    private static Dictionary<string, double> DoRegression(IRegressionProblemData pd, IList<string> variables, Dictionary<string, double> variances, Dictionary<string, double> means, double yMean, double ridge, out double intercept) {
-
-      var n = variables.Count;
-      var m = pd.TrainingIndices.Count();
-
-      var inTr = new double[n, m];
-      for (var i = 0; i < n; i++) {
-        var v = variables[i];
-        var vdata = pd.Dataset.GetDoubleValues(v, pd.TrainingIndices).ToArray();
-        var sd = Math.Sqrt(variances[v]);
-        var mean = means[v];
-        for (var j = 0; j < m; j++) {
-          inTr[i, j] = (vdata[j] - mean) / sd;
-        }
-      }
-
-      var y = new double[m, 1];
-      var ydata = pd.TargetVariableTrainingValues.ToArray();
-      for (var i = 0; i < m; i++)
-        y[i, 0] = ydata[i]; //no scaling for targets;
-
-
-      var aTy = new double[n, 1];
-      alglib.rmatrixgemm(n, 1, m, 1, inTr, 0, 0, 0, y, 0, 0, 0, 0, ref aTy, 0, 0); //aTy = inTr * y;
-      var aTa = new double[n, n];
-      alglib.rmatrixgemm(n, n, m, 1, inTr, 0, 0, 0, inTr, 0, 0, 1, 0, ref aTa, 0, 0); //aTa = inTr * t(inTr) +aTa //
-
-      var aTaDecomp = new double[n, n];
-      bool success;
-      var tries = 0;
-      double[] coefficients = null;
-      do {
-        for (var i = 0; i < n; i++) aTa[i, i] += ridge; // add ridge to diagonal to enforce singularity
-        try {
-          //solve "aTa * coefficients = aTy" for coefficients;
-          Array.Copy(aTa, 0, aTaDecomp, 0, aTa.Length);
-          alglib.spdmatrixcholesky(ref aTaDecomp, n, true);
-          int info;
-          alglib.densesolverreport report;
-          alglib.spdmatrixcholeskysolve(aTaDecomp, n, true, ydata, out info, out report, out coefficients);
-
-          if (info != 1) throw new Exception();
-          success = true;
-        }
-        catch (Exception) {
-          for (var i = 0; i < n; i++) aTa[i, i] -= ridge;
-          ridge *= 10; // increase ridge;
-          success = false;
-        }
-        finally {
-          tries++;
-        }
-      }
-      while (!success && tries < 100);
-      if (coefficients == null || coefficients.Length != n) throw new ArgumentException("No linear model could be built");
-
-      intercept = yMean;
-      var res = new Dictionary<string, double>();
-      for (var i = 0; i < n; i++) {
-        var v = variables[i];
-        res.Add(v, coefficients[i] /= Math.Sqrt(variances[v]));
-        intercept -= coefficients[i] * means[v];
-      }
-
-      return res;
-    }
-
-    private static IList<string> DeselectColinear(Dictionary<string, double> variances, Dictionary<string, double> coeffs, double yVariance, IRegressionProblemData pd, IList<string> variables) {
-      var candidates = variables.ToDictionary(v => v, v => Math.Abs(coeffs[v] * Math.Sqrt(variances[v] / yVariance))).Where(x => x.Value > 1.5).OrderBy(x => -x.Value).ToList();
-      if (candidates.Count == 0) return variables;
-      var c = candidates.First().Key;
-      return variables.Where(v => !v.Equals(c)).ToList();
-    }
-
-    private static double CalculateSE(Dictionary<string, double> coefficients, double intercept, IRegressionProblemData pd, IList<string> variables) {
-      return pd.TrainingIndices.Select(i => RegressionPrediction(i, pd, variables, coefficients, intercept) - pd.Dataset.GetDoubleValue(pd.TargetVariable, i)).Select(error => error * error).Sum();
-    }
-    private static double RegressionPrediction(int i, IRegressionProblemData pd, IList<string> variables, Dictionary<string, double> coefficients, double intercept) {
-      return intercept + variables.Sum(v => pd.Dataset.GetDoubleValue(v, i) * coefficients[v]);
-    }
-  }
-}
Index: unk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/LeafTypes/M5regLeaf.cs
===================================================================
--- /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/LeafTypes/M5regLeaf.cs	(revision 17079)
+++ 	(revision )
@@ -1,64 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2017 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Linq;
-using System.Threading;
-using HeuristicLab.Algorithms.DataAnalysis.Glmnet;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Problems.DataAnalysis;
-using HEAL.Attic;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableType("0AED959D-78C3-4927-BDCF-473D0AEE32AA")]
-  [Item("M5regLeaf", "A leaf type that uses regularized linear models as leaf models.")]
-  public sealed class M5regLeaf : LeafBase {
-    #region Constructors & Cloning
-    [StorableConstructor]
-    private M5regLeaf(StorableConstructorFlag _) : base(_) { }
-    private M5regLeaf(M5regLeaf original, Cloner cloner) : base(original, cloner) { }
-    public M5regLeaf() { }
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new M5regLeaf(this, cloner);
-    }
-    #endregion
-
-    #region IModelType
-    public override bool ProvidesConfidence {
-      get { return false; }
-    }
-
-    public override IRegressionModel Build(IRegressionProblemData pd, IRandom random, CancellationToken cancellationToken, out int numberOfParameters) {
-      if (pd.Dataset.Rows < MinLeafSize(pd)) throw new ArgumentException("The number of training instances is too small to create a linear model");
-      numberOfParameters = pd.AllowedInputVariables.Count() + 1;
-
-      double x1, x2;
-      var coeffs = ElasticNetLinearRegression.CalculateModelCoefficients(pd, 1, 0.2, out x1, out x2);
-      numberOfParameters = coeffs.Length;
-      return ElasticNetLinearRegression.CreateSymbolicSolution(coeffs, pd).Model;
-    }
-    public override int MinLeafSize(IRegressionProblemData pd) {
-      return pd.AllowedInputVariables.Count() + 2;
-    }
-    #endregion
-  }
-}
Index: /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/LeafTypes/RegularizedLeaf.cs
===================================================================
--- /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/LeafTypes/RegularizedLeaf.cs	(revision 17080)
+++ /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/LeafTypes/RegularizedLeaf.cs	(revision 17080)
@@ -0,0 +1,64 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2017 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Linq;
+using System.Threading;
+using HeuristicLab.Algorithms.DataAnalysis.Glmnet;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Problems.DataAnalysis;
+using HEAL.Attic;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableType("0AED959D-78C3-4927-BDCF-473D0AEE32AA")]
+  [Item("M5regLeaf", "A leaf type that uses regularized linear models as leaf models.")]
+  public sealed class M5regLeaf : LeafBase {
+    #region Constructors & Cloning
+    [StorableConstructor]
+    private M5regLeaf(StorableConstructorFlag _) : base(_) { }
+    private M5regLeaf(M5regLeaf original, Cloner cloner) : base(original, cloner) { }
+    public M5regLeaf() { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new M5regLeaf(this, cloner);
+    }
+    #endregion
+
+    #region IModelType
+    public override bool ProvidesConfidence {
+      get { return false; }
+    }
+
+    public override IRegressionModel Build(IRegressionProblemData pd, IRandom random, CancellationToken cancellationToken, out int numberOfParameters) {
+      if (pd.Dataset.Rows < MinLeafSize(pd)) throw new ArgumentException("The number of training instances is too small to create a linear model");
+      numberOfParameters = pd.AllowedInputVariables.Count() + 1;
+
+      double x1, x2;
+      var coeffs = ElasticNetLinearRegression.CalculateModelCoefficients(pd, 1, 0.2, out x1, out x2);
+      numberOfParameters = coeffs.Length;
+      return ElasticNetLinearRegression.CreateSymbolicSolution(coeffs, pd).Model;
+    }
+    public override int MinLeafSize(IRegressionProblemData pd) {
+      return pd.AllowedInputVariables.Count() + 2;
+    }
+    #endregion
+  }
+}
Index: /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/MetaModels/RegressionNodeTreeModel.cs
===================================================================
--- /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/MetaModels/RegressionNodeTreeModel.cs	(revision 17079)
+++ /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/MetaModels/RegressionNodeTreeModel.cs	(revision 17080)
@@ -71,5 +71,5 @@
     #region IM5Model
     public void Build(IReadOnlyList<int> trainingRows, IReadOnlyList<int> pruningRows, IScope statescope, ResultCollection results, CancellationToken cancellationToken) {
-      var regressionTreeParams = (RegressionTreeParameters)statescope.Variables[M5Regression.RegressionTreeParameterVariableName].Value;
+      var regressionTreeParams = (RegressionTreeParameters)statescope.Variables[DecisionTreeRegression.RegressionTreeParameterVariableName].Value;
       //start with one node
       if (Root == null)
@@ -87,10 +87,10 @@
 
     public void Update(IReadOnlyList<int> rows, IScope statescope, CancellationToken cancellationToken) {
-      var regressionTreeParams = (RegressionTreeParameters)statescope.Variables[M5Regression.RegressionTreeParameterVariableName].Value;
+      var regressionTreeParams = (RegressionTreeParameters)statescope.Variables[DecisionTreeRegression.RegressionTreeParameterVariableName].Value;
       regressionTreeParams.LeafModel.Build(this, rows, statescope, cancellationToken);
     }
 
     public static void Initialize(IScope stateScope) {
-      var param = (RegressionTreeParameters)stateScope.Variables[M5Regression.RegressionTreeParameterVariableName].Value;
+      var param = (RegressionTreeParameters)stateScope.Variables[DecisionTreeRegression.RegressionTreeParameterVariableName].Value;
       stateScope.Variables.Add(new Variable(RootVariableName, RegressionNodeModel.CreateNode(param.TargetVariable, param)));
     }
@@ -98,5 +98,5 @@
 
     public void BuildModel(IReadOnlyList<int> trainingRows, IReadOnlyList<int> pruningRows, IScope statescope, ResultCollection results, CancellationToken cancellationToken) {
-      var regressionTreeParams = (RegressionTreeParameters)statescope.Variables[M5Regression.RegressionTreeParameterVariableName].Value;
+      var regressionTreeParams = (RegressionTreeParameters)statescope.Variables[DecisionTreeRegression.RegressionTreeParameterVariableName].Value;
       //start with one node
       Root = RegressionNodeModel.CreateNode(regressionTreeParams.TargetVariable, regressionTreeParams);
Index: /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/MetaModels/RegressionRuleModel.cs
===================================================================
--- /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/MetaModels/RegressionRuleModel.cs	(revision 17079)
+++ /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/MetaModels/RegressionRuleModel.cs	(revision 17080)
@@ -83,5 +83,5 @@
 
     public void Build(IReadOnlyList<int> trainingRows, IReadOnlyList<int> pruningRows, IScope statescope, ResultCollection results, CancellationToken cancellationToken) {
-      var regressionTreeParams = (RegressionTreeParameters)statescope.Variables[M5Regression.RegressionTreeParameterVariableName].Value;
+      var regressionTreeParams = (RegressionTreeParameters)statescope.Variables[DecisionTreeRegression.RegressionTreeParameterVariableName].Value;
       variables = regressionTreeParams.AllowedInputVariables.ToList();
 
@@ -109,5 +109,5 @@
 
     public void Update(IReadOnlyList<int> rows, IScope statescope, CancellationToken cancellationToken) {
-      var regressionTreeParams = (RegressionTreeParameters)statescope.Variables[M5Regression.RegressionTreeParameterVariableName].Value;
+      var regressionTreeParams = (RegressionTreeParameters)statescope.Variables[DecisionTreeRegression.RegressionTreeParameterVariableName].Value;
       int np;
       RuleModel = regressionTreeParams.LeafModel.BuildModel(rows, regressionTreeParams, cancellationToken, out np);
Index: /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/MetaModels/RegressionRuleSetModel.cs
===================================================================
--- /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/MetaModels/RegressionRuleSetModel.cs	(revision 17079)
+++ /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/MetaModels/RegressionRuleSetModel.cs	(revision 17080)
@@ -77,5 +77,5 @@
     #region IM5Model
     public void Build(IReadOnlyList<int> trainingRows, IReadOnlyList<int> pruningRows, IScope stateScope, ResultCollection results, CancellationToken cancellationToken) {
-      var regressionTreeParams = (RegressionTreeParameters)stateScope.Variables[M5Regression.RegressionTreeParameterVariableName].Value;
+      var regressionTreeParams = (RegressionTreeParameters)stateScope.Variables[DecisionTreeRegression.RegressionTreeParameterVariableName].Value;
       var ruleSetState = (RuleSetState)stateScope.Variables[RuleSetStateVariableName].Value;
 
Index: /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/Pruning/ComplexityPruning.cs
===================================================================
--- /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/Pruning/ComplexityPruning.cs	(revision 17079)
+++ /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/Pruning/ComplexityPruning.cs	(revision 17080)
@@ -86,5 +86,5 @@
 
     public void Prune(RegressionNodeTreeModel treeModel, IReadOnlyList<int> trainingRows, IReadOnlyList<int> pruningRows, IScope statescope, CancellationToken cancellationToken) {
-      var regressionTreeParams = (RegressionTreeParameters)statescope.Variables[M5Regression.RegressionTreeParameterVariableName].Value;
+      var regressionTreeParams = (RegressionTreeParameters)statescope.Variables[DecisionTreeRegression.RegressionTreeParameterVariableName].Value;
       var state = (PruningState)statescope.Variables[PruningStateVariableName].Value;
 
Index: unk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/Splitting/M5Splitter.cs
===================================================================
--- /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/Splitting/M5Splitter.cs	(revision 17079)
+++ 	(revision )
@@ -1,80 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2017 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Parameters;
-using HEAL.Attic;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableType("502B1429-7A28-45C1-A60A-93E72CB3AF4A")]
-  [Item("M5Splitter", "A split selector that uses the ratio between Variances^(1/Order) to determine good splits.")]
-  public sealed class M5Splitter : SplitterBase {
-    public const string OrderParameterName = "Order";
-    public IFixedValueParameter<DoubleValue> OrderParameter {
-      get { return (IFixedValueParameter<DoubleValue>)Parameters[OrderParameterName]; }
-    }
-    public double Order {
-      get { return OrderParameter.Value.Value; }
-      set { OrderParameter.Value.Value = value; }
-    }
-
-    #region Constructors & Cloning
-    [StorableConstructor]
-    private M5Splitter(StorableConstructorFlag _) { }
-    private M5Splitter(M5Splitter original, Cloner cloner) : base(original, cloner) { }
-    public M5Splitter() {
-      Parameters.Add(new FixedValueParameter<DoubleValue>(OrderParameterName, "The exponent in the split calculation sum (x_i - x_avg)^Order (default=5).", new DoubleValue(5)));
-    }
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new M5Splitter(this, cloner);
-    }
-    #endregion
-
-    protected override void AttributeSplit(IReadOnlyList<double> attValues, IReadOnlyList<double> targetValues, int minLeafSize, out int position, out double maxImpurity, out double splitValue) {
-      position = 0;
-      maxImpurity = double.NegativeInfinity;
-      splitValue = 0.0;
-      var length = targetValues.Count;
-
-      // weka code
-      var low = 0;
-      var high = length - 1;
-      if (high - low + 1 < 4) return;
-      var len = Math.Max(minLeafSize - 1, high - low + 1 < 5 ? 1 : (high - low + 1) / 5);
-      position = low;
-      var part = low + len - 1;
-      var imp = new OrderImpurityCalculator(part + 1, targetValues, Order);
-
-      for (var i = low + len; i < high - len; i++) {
-        imp.Increment(targetValues[i], OrderImpurityCalculator.IncrementType.Left);
-        if (attValues[i].IsAlmost(attValues[i + 1])) continue; //splits can not be made between to equal points
-        if (imp.Impurity < maxImpurity) continue;
-        maxImpurity = imp.Impurity;
-        splitValue = (attValues[i] + attValues[i + 1]) / 2;
-        position = i;
-      }
-    }
-  }
-}
Index: /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/Splitting/Splitter.cs
===================================================================
--- /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/Splitting/Splitter.cs	(revision 17080)
+++ /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/Splitting/Splitter.cs	(revision 17080)
@@ -0,0 +1,80 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2017 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HEAL.Attic;
+
+namespace HeuristicLab.Algorithms.DataAnalysis {
+  [StorableType("502B1429-7A28-45C1-A60A-93E72CB3AF4A")]
+  [Item("Splitter", "A split selector that uses the ratio between Variances^(1/Order) to determine good splits.")]
+  public sealed class M5Splitter : SplitterBase {
+    public const string OrderParameterName = "Order";
+    public IFixedValueParameter<DoubleValue> OrderParameter {
+      get { return (IFixedValueParameter<DoubleValue>)Parameters[OrderParameterName]; }
+    }
+    public double Order {
+      get { return OrderParameter.Value.Value; }
+      set { OrderParameter.Value.Value = value; }
+    }
+
+    #region Constructors & Cloning
+    [StorableConstructor]
+    private M5Splitter(StorableConstructorFlag _) { }
+    private M5Splitter(M5Splitter original, Cloner cloner) : base(original, cloner) { }
+    public M5Splitter() {
+      Parameters.Add(new FixedValueParameter<DoubleValue>(OrderParameterName, "The exponent in the split calculation sum (x_i - x_avg)^Order (default=5).", new DoubleValue(5)));
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new M5Splitter(this, cloner);
+    }
+    #endregion
+
+    protected override void AttributeSplit(IReadOnlyList<double> attValues, IReadOnlyList<double> targetValues, int minLeafSize, out int position, out double maxImpurity, out double splitValue) {
+      position = 0;
+      maxImpurity = double.NegativeInfinity;
+      splitValue = 0.0;
+      var length = targetValues.Count;
+
+      // weka code
+      var low = 0;
+      var high = length - 1;
+      if (high - low + 1 < 4) return;
+      var len = Math.Max(minLeafSize - 1, high - low + 1 < 5 ? 1 : (high - low + 1) / 5);
+      position = low;
+      var part = low + len - 1;
+      var imp = new OrderImpurityCalculator(part + 1, targetValues, Order);
+
+      for (var i = low + len; i < high - len; i++) {
+        imp.Increment(targetValues[i], OrderImpurityCalculator.IncrementType.Left);
+        if (attValues[i].IsAlmost(attValues[i + 1])) continue; //splits can not be made between to equal points
+        if (imp.Impurity < maxImpurity) continue;
+        maxImpurity = imp.Impurity;
+        splitValue = (attValues[i] + attValues[i + 1]) / 2;
+        position = i;
+      }
+    }
+  }
+}
Index: /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/Splitting/SplitterBase.cs
===================================================================
--- /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/Splitting/SplitterBase.cs	(revision 17079)
+++ /trunk/HeuristicLab.Algorithms.DataAnalysis.DecisionTrees/3.4/Splitting/SplitterBase.cs	(revision 17080)
@@ -48,5 +48,5 @@
 
     public void Split(RegressionNodeTreeModel tree, IReadOnlyList<int> trainingRows, IScope stateScope, CancellationToken cancellationToken) {
-      var regressionTreeParams = (RegressionTreeParameters)stateScope.Variables[M5Regression.RegressionTreeParameterVariableName].Value;
+      var regressionTreeParams = (RegressionTreeParameters)stateScope.Variables[DecisionTreeRegression.RegressionTreeParameterVariableName].Value;
       var splittingState = (SplittingState)stateScope.Variables[SplittingStateVariableName].Value;
       var variables = regressionTreeParams.AllowedInputVariables.ToArray();
