Index: branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/M5Regression/Splitting/M5Spliter.cs
===================================================================
--- branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/M5Regression/Splitting/M5Spliter.cs	(revision 16849)
+++ 	(revision )
@@ -1,106 +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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Problems.DataAnalysis;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableClass]
-  [Item("M5Spliter", "A split selector that uses the ratio between Variances^1/Order to determine good splits")]
-  public class M5Spliter : ParameterizedNamedItem, ISpliter {
-    public const string OrderParameterName = "Order";
-    public IFixedValueParameter<DoubleValue> OrderParameter {
-      get { return (IFixedValueParameter<DoubleValue>)Parameters[OrderParameterName]; }
-    }
-    public double Order {
-      get { return OrderParameter.Value.Value; }
-    }
-
-    #region Constructors & Cloning
-    [StorableConstructor]
-    private M5Spliter(bool deserializing) { }
-    private M5Spliter(M5Spliter original, Cloner cloner) : base(original, cloner) { }
-    public M5Spliter() {
-      Parameters.Add(new FixedValueParameter<DoubleValue>(OrderParameterName, "The exponent in the split calculation sum (x_i - x_avg)^Order.", new DoubleValue(4)));
-    }
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new M5Spliter(this, cloner);
-    }
-    #endregion
-
-    #region ISplitType
-    public bool Split(IRegressionProblemData splitData, int minLeafSize, out string splitAttr, out double splitValue) {
-      var bestPos = 0;
-      var bestImpurity = double.MinValue;
-      var bestSplitValue = 0.0;
-      var bestSplitAttr = string.Empty;
-      splitAttr = bestSplitAttr;
-      splitValue = bestSplitValue;
-      if (splitData.Dataset.Rows < minLeafSize) return false;
-      //find best Attribute for the Spliter
-      foreach (var attr in splitData.AllowedInputVariables) {
-        int pos;
-        double impurity, sValue;
-        var sortedData = splitData.Dataset.GetDoubleValues(attr).Zip(splitData.Dataset.GetDoubleValues(splitData.TargetVariable), Tuple.Create).OrderBy(x => x.Item1).ToArray();
-        AttributeSplit(sortedData.Select(x => x.Item1).ToArray(), sortedData.Select(x => x.Item2).ToArray(), minLeafSize, out pos, out impurity, out sValue);
-        if (!(bestImpurity < impurity)) continue;
-        bestImpurity = impurity;
-        bestPos = pos;
-        bestSplitValue = sValue;
-        bestSplitAttr = attr;
-      }
-
-      splitAttr = bestSplitAttr;
-      splitValue = bestSplitValue;
-      //if no suitable split exists => leafNode
-      return bestPos >= minLeafSize && bestPos <= splitData.Dataset.Rows - minLeafSize;
-    }
-
-    private void AttributeSplit(IReadOnlyList<double> attValues, IReadOnlyList<double> targetValues, int minLeafSize, out int position, out double maxImpurity, out double splitValue) {
-      position = 0;
-      maxImpurity = -1E20;
-      splitValue = 0.0;
-      var length = targetValues.Count;
-      var imp = new OrderImpurityCalculator(minLeafSize, targetValues, Order);
-      if (imp.Impurity > maxImpurity && !attValues[minLeafSize - 1].IsAlmost(attValues[minLeafSize])) {
-        maxImpurity = imp.Impurity;
-        splitValue = (attValues[minLeafSize - 1] + attValues[minLeafSize]) / 2;
-        position = minLeafSize;
-      }
-      for (var i = minLeafSize; i < length - minLeafSize; 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 + 1;
-      }
-    }
-    #endregion
-  }
-}
Index: branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/M5Regression/Splitting/OptimumSearchingSpliter.cs
===================================================================
--- branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/M5Regression/Splitting/OptimumSearchingSpliter.cs	(revision 16849)
+++ 	(revision )
@@ -1,151 +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 HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Problems.DataAnalysis;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableClass]
-  [Item("OptimumSearchingSpliter", "A split selector that favours higher resolution splits near percieved optima.\n Decribed in \"Model-Based Genetic Algorithms for Algorithm Configuration\" by Carlos Ansotegui et al ")]
-  public class OptimumSearchingSpliter : ParameterizedNamedItem, ISpliter {
-    public const string SearchStrengthParameterName = "Search Strength";
-    public const string MaximizationParamterName = "Maximization";
-    public const string OrderParameterName = "Order";
-    public IFixedValueParameter<DoubleValue> OrderParameter {
-      get { return (IFixedValueParameter<DoubleValue>)Parameters[OrderParameterName]; }
-    }
-    public IFixedValueParameter<PercentValue> SearchStrengthParameter {
-      get { return (IFixedValueParameter<PercentValue>)Parameters[SearchStrengthParameterName]; }
-    }
-    public IFixedValueParameter<BoolValue> MaximizationParameter {
-      get { return (IFixedValueParameter<BoolValue>)Parameters[MaximizationParamterName]; }
-    }
-    public double Order {
-      get { return OrderParameter.Value.Value; }
-    }
-    public double SearchStrength {
-      get { return SearchStrengthParameter.Value.Value; }
-    }
-    public bool Maximization {
-      get { return MaximizationParameter.Value.Value; }
-    }
-
-    #region Constructors & Cloning
-    [StorableConstructor]
-    private OptimumSearchingSpliter(bool deserializing) { }
-    private OptimumSearchingSpliter(OptimumSearchingSpliter original, Cloner cloner) : base(original, cloner) { }
-    public OptimumSearchingSpliter() {
-      Parameters.Add(new FixedValueParameter<DoubleValue>(OrderParameterName, "The exponent in the split calculation sum (x_i - x_avg)^Order.", new DoubleValue(2)));
-      Parameters.Add(new FixedValueParameter<PercentValue>(SearchStrengthParameterName, "How strong the spliting process should be skewed towards/away from the percieved optimum", new PercentValue(0.10)));
-      Parameters.Add(new FixedValueParameter<BoolValue>(MaximizationParamterName, "Whether the splitting procedure should asume a minimization or maximization procedure."));
-    }
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new OptimumSearchingSpliter(this, cloner);
-    }
-    #endregion
-
-    #region ISplitType
-    public bool Split(IRegressionProblemData splitData, int minLeafSize, out string splitAttr, out double splitValue) {
-      var bestImpurity = double.MinValue;
-      var bestSplitValue = 0.0;
-      var bestSplitAttr = string.Empty;
-      var bestSize = 0;
-      splitAttr = bestSplitAttr;
-      splitValue = bestSplitValue;
-
-      var targets = splitData.TargetVariableValues.ToArray();
-      var vh = targets.Quantile(Maximization ? 1 - SearchStrength : SearchStrength);
-      var lower = new HashSet<int>(targets.Select((x, i) => new {x, i}).Where(e => e.x < vh).Select(e => e.i));
-
-      if (splitData.Dataset.Rows < minLeafSize) return false;
-
-      foreach (var attr in splitData.AllowedInputVariables) {
-        int pos;
-        double impurity, sValue;
-        AttributeSplit(splitData, lower, attr, vh, minLeafSize, out pos, out impurity, out sValue);
-        if (!(bestImpurity < impurity)) continue;
-        bestImpurity = impurity;
-        bestSplitValue = sValue;
-        bestSplitAttr = attr;
-        bestSize = pos;
-      }
-
-      splitAttr = bestSplitAttr;
-      splitValue = bestSplitValue;
-
-      //if no suitable split exists => leafNode
-      return bestSize >= minLeafSize && bestSize <= splitData.Dataset.Rows - minLeafSize;
-    }
-
-    private void AttributeSplit(IRegressionProblemData splitData, ICollection<int> t, string attribute, double vh, int minLeafSize, out int leftSize, out double maxImpurity, out double splitValue) {
-      leftSize = 0;
-      maxImpurity = -1E20;
-      splitValue = 0.0;
-      var length = splitData.Dataset.Rows;
-
-      double lls = 0, rls = 0, lts = 0, rts = 0;
-      int ltn = 0, rtn = t.Count;
-
-      var points = splitData.Dataset.GetDoubleValues(attribute).Select((x, i) => new {x, i}).OrderBy(e => e.x).ToArray();
-      for (var i = 0; i < length - minLeafSize; i++) {
-        var point = points[i];
-        var con = Contibution(splitData, vh, point.i);
-        //move contribution to and from respcetive sums
-        if (t.Contains(i)) {
-          lls += con;
-          rls -= con;
-        }
-        else {
-          ltn++;
-          rtn--;
-          lts += con;
-          rts -= con;
-        }
-
-        //splits can not be made between to equal points
-        if (point.x.IsAlmost(points[i + 1].x)) continue;
-
-        //calculate impurity / score
-        var al = (ltn + lts) / (1 + lls);
-        var ar = (rtn + rts) / (1 + rls);
-        var impurity = ltn > rtn ? al : ltn < rtn ? ar : Math.Min(al, ar);
-
-        if (i < minLeafSize || impurity < maxImpurity) continue;
-        maxImpurity = impurity;
-        splitValue = (point.x + points[i + 1].x) / 2;
-        leftSize = i + 1;
-      }
-    }
-
-    private double Contibution(IRegressionProblemData splitData, double vh, int i) {
-      var v = splitData.Dataset.GetDoubleValue(splitData.TargetVariable, i) - vh;
-      return Math.Pow(v, Order);
-    }
-    #endregion
-  }
-}
