Index: /branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithmStatic.cs
===================================================================
--- /branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithmStatic.cs	(revision 12695)
+++ /branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithmStatic.cs	(revision 12696)
@@ -55,5 +55,4 @@
       internal double[] pred;
       internal double[] predTest;
-      internal double[] w;
       internal double[] y;
       internal int[] activeIdx;
@@ -77,6 +76,4 @@
 
         y = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TrainingIndices).ToArray();
-        // weights are all 1 for now (HL doesn't support weights yet)
-        w = Enumerable.Repeat(1.0, nRows).ToArray();
 
         treeBuilder = new RegressionTreeBuilder(problemData, random);
@@ -85,6 +82,5 @@
 
         var zeros = Enumerable.Repeat(0.0, nRows);
-        var ones = Enumerable.Repeat(1.0, nRows);
-        double f0 = lossFunction.GetLineSearchFunc(y, zeros, ones)(activeIdx, 0, nRows - 1); // initial constant value (mean for squared errors)
+        double f0 = lossFunction.GetLineSearchFunc(y, zeros)(activeIdx, 0, nRows - 1); // initial constant value (mean for squared errors)
         pred = Enumerable.Repeat(f0, nRows).ToArray();
         predTest = Enumerable.Repeat(f0, problemData.TestIndices.Count()).ToArray();
@@ -107,11 +103,10 @@
       public double GetTrainLoss() {
         int nRows = y.Length;
-        return lossFunction.GetLoss(y, pred, w) / nRows;
+        return lossFunction.GetLoss(y, pred) / nRows;
       }
       public double GetTestLoss() {
         var yTest = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TestIndices);
-        var wTest = problemData.TestIndices.Select(_ => 1.0); // ones
         var nRows = problemData.TestIndices.Count();
-        return lossFunction.GetLoss(yTest, predTest, wTest) / nRows;
+        return lossFunction.GetLoss(yTest, predTest) / nRows;
       }
     }
@@ -160,5 +155,4 @@
       var yPred = gbmState.pred;
       var yPredTest = gbmState.predTest;
-      var w = gbmState.w;
       var treeBuilder = gbmState.treeBuilder;
       var y = gbmState.y;
@@ -168,9 +162,9 @@
       // copy output of gradient function to pre-allocated rim array (pseudo-residuals)
       int rimIdx = 0;
-      foreach (var g in lossFunction.GetLossGradient(y, yPred, w)) {
+      foreach (var g in lossFunction.GetLossGradient(y, yPred)) {
         pseudoRes[rimIdx++] = g;
       }
 
-      var tree = treeBuilder.CreateRegressionTreeForGradientBoosting(pseudoRes, maxSize, activeIdx, lossFunction.GetLineSearchFunc(y, yPred, w), r, m);
+      var tree = treeBuilder.CreateRegressionTreeForGradientBoosting(pseudoRes, maxSize, activeIdx, lossFunction.GetLineSearchFunc(y, yPred), r, m);
 
       int i = 0;
Index: /branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/AbsoluteErrorLoss.cs
===================================================================
--- /branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/AbsoluteErrorLoss.cs	(revision 12695)
+++ /branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/AbsoluteErrorLoss.cs	(revision 12696)
@@ -30,47 +30,41 @@
   // loss function for the weighted absolute error
   public class AbsoluteErrorLoss : ILossFunction {
-    public double GetLoss(IEnumerable<double> target, IEnumerable<double> pred, IEnumerable<double> weight) {
+    public double GetLoss(IEnumerable<double> target, IEnumerable<double> pred) {
       var targetEnum = target.GetEnumerator();
       var predEnum = pred.GetEnumerator();
-      var weightEnum = weight.GetEnumerator();
 
       double s = 0;
-      while (targetEnum.MoveNext() & predEnum.MoveNext() & weightEnum.MoveNext()) {
+      while (targetEnum.MoveNext() & predEnum.MoveNext()) {
         double res = targetEnum.Current - predEnum.Current;
-        s += weightEnum.Current * Math.Abs(res);  // w * |res|
+        s += Math.Abs(res);  // |res|
       }
-      if (targetEnum.MoveNext() | predEnum.MoveNext() | weightEnum.MoveNext())
-        throw new ArgumentException("target, pred and weight have differing lengths");
+      if (targetEnum.MoveNext() | predEnum.MoveNext())
+        throw new ArgumentException("target and pred have differing lengths");
 
       return s;
     }
 
-    public IEnumerable<double> GetLossGradient(IEnumerable<double> target, IEnumerable<double> pred, IEnumerable<double> weight) {
+    public IEnumerable<double> GetLossGradient(IEnumerable<double> target, IEnumerable<double> pred) {
       var targetEnum = target.GetEnumerator();
       var predEnum = pred.GetEnumerator();
-      var weightEnum = weight.GetEnumerator();
 
-      while (targetEnum.MoveNext() & predEnum.MoveNext() & weightEnum.MoveNext()) {
-        // dL(y, f(x)) / df(x) = weight * sign(res)
+      while (targetEnum.MoveNext() & predEnum.MoveNext()) {
+        // dL(y, f(x)) / df(x) = sign(res)
         var res = targetEnum.Current - predEnum.Current;
-        if (res > 0) yield return weightEnum.Current;
-        else if (res < 0) yield return -weightEnum.Current;
+        if (res > 0) yield return 1.0;
+        else if (res < 0) yield return -1.0;
         else yield return 0.0;
       }
-      if (targetEnum.MoveNext() | predEnum.MoveNext() | weightEnum.MoveNext())
-        throw new ArgumentException("target, pred and weight have differing lengths");
+      if (targetEnum.MoveNext() | predEnum.MoveNext())
+        throw new ArgumentException("target and pred have differing lengths");
     }
 
     // return median of residuals
-    public LineSearchFunc GetLineSearchFunc(IEnumerable<double> target, IEnumerable<double> pred, IEnumerable<double> weight) {
+    public LineSearchFunc GetLineSearchFunc(IEnumerable<double> target, IEnumerable<double> pred) {
       var targetArr = target.ToArray();
       var predArr = pred.ToArray();
-      var weightArr = weight.ToArray();
-      // the optimal constant value that should be added to the predictions is the median of the residuals
-      // weights are not supported yet (need to calculate a weighted median)
-      Debug.Assert(weightArr.All(w => w.IsAlmost(1.0)));
 
-      if (targetArr.Length != predArr.Length || predArr.Length != weightArr.Length)
-        throw new ArgumentException("target, pred and weight have differing lengths");
+      if (targetArr.Length != predArr.Length)
+        throw new ArgumentException("target and pred have differing lengths");
 
       // line search for abs error
Index: /branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/ILossFunction.cs
===================================================================
--- /branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/ILossFunction.cs	(revision 12695)
+++ /branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/ILossFunction.cs	(revision 12696)
@@ -30,14 +30,13 @@
   // target represents the target vector  (original targets from the problem data, never changed)
   // pred   represents the current vector of predictions (a weighted combination of models learned so far, this vector is updated after each step)
-  // weight represents a weight vector for rows (this is not supported yet -> all weights are 1)
   public interface ILossFunction {
-    // returns the weighted loss of the current prediction vector 
-    double GetLoss(IEnumerable<double> target, IEnumerable<double> pred, IEnumerable<double> weight);
+    // returns the loss of the current prediction vector 
+    double GetLoss(IEnumerable<double> target, IEnumerable<double> pred);
 
-    // returns an enumerable of the weighted loss gradient for each row
-    IEnumerable<double> GetLossGradient(IEnumerable<double> target, IEnumerable<double> pred, IEnumerable<double> weight);
+    // returns an enumerable of the loss gradient for each row
+    IEnumerable<double> GetLossGradient(IEnumerable<double> target, IEnumerable<double> pred);
 
     // returns a function that returns the optimal prediction value for a subset of rows from target and pred (see LineSearchFunc delegate above)
-    LineSearchFunc GetLineSearchFunc(IEnumerable<double> target, IEnumerable<double> pred, IEnumerable<double> weight);
+    LineSearchFunc GetLineSearchFunc(IEnumerable<double> target, IEnumerable<double> pred);
   }
 }
Index: /branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/LogisticRegressionLoss.cs
===================================================================
--- /branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/LogisticRegressionLoss.cs	(revision 12695)
+++ /branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/LogisticRegressionLoss.cs	(revision 12696)
@@ -30,48 +30,42 @@
   // Greedy Function Approximation: A Gradient Boosting Machine (page 9) 
   public class LogisticRegressionLoss : ILossFunction {
-    public double GetLoss(IEnumerable<double> target, IEnumerable<double> pred, IEnumerable<double> weight) {
+    public double GetLoss(IEnumerable<double> target, IEnumerable<double> pred) {
       var targetEnum = target.GetEnumerator();
       var predEnum = pred.GetEnumerator();
-      var weightEnum = weight.GetEnumerator();
 
       double s = 0;
-      while (targetEnum.MoveNext() & predEnum.MoveNext() & weightEnum.MoveNext()) {
+      while (targetEnum.MoveNext() & predEnum.MoveNext()) {
         Debug.Assert(targetEnum.Current.IsAlmost(0.0) || targetEnum.Current.IsAlmost(1.0), "labels must be 0 or 1 for logistic regression loss");
 
         var y = targetEnum.Current * 2 - 1; // y in {-1,1}
-        s += weightEnum.Current * Math.Log(1 + Math.Exp(-2 * y * predEnum.Current));
+        s += Math.Log(1 + Math.Exp(-2 * y * predEnum.Current));
       }
-      if (targetEnum.MoveNext() | predEnum.MoveNext() | weightEnum.MoveNext())
-        throw new ArgumentException("target, pred and weight have different lengths");
+      if (targetEnum.MoveNext() | predEnum.MoveNext())
+        throw new ArgumentException("target and pred have different lengths");
 
       return s;
     }
 
-    public IEnumerable<double> GetLossGradient(IEnumerable<double> target, IEnumerable<double> pred, IEnumerable<double> weight) {
+    public IEnumerable<double> GetLossGradient(IEnumerable<double> target, IEnumerable<double> pred) {
       var targetEnum = target.GetEnumerator();
       var predEnum = pred.GetEnumerator();
-      var weightEnum = weight.GetEnumerator();
 
-      while (targetEnum.MoveNext() & predEnum.MoveNext() & weightEnum.MoveNext()) {
+      while (targetEnum.MoveNext() & predEnum.MoveNext()) {
         Debug.Assert(targetEnum.Current.IsAlmost(0.0) || targetEnum.Current.IsAlmost(1.0), "labels must be 0 or 1 for logistic regression loss");
         var y = targetEnum.Current * 2 - 1; // y in {-1,1}
 
-        yield return weightEnum.Current * 2 * y / (1 + Math.Exp(2 * y * predEnum.Current));
+        yield return 2 * y / (1 + Math.Exp(2 * y * predEnum.Current));
 
       }
-      if (targetEnum.MoveNext() | predEnum.MoveNext() | weightEnum.MoveNext())
-        throw new ArgumentException("target, pred and weight have different lengths");
+      if (targetEnum.MoveNext() | predEnum.MoveNext())
+        throw new ArgumentException("target and pred have different lengths");
     }
 
-    public LineSearchFunc GetLineSearchFunc(IEnumerable<double> target, IEnumerable<double> pred, IEnumerable<double> weight) {
+    public LineSearchFunc GetLineSearchFunc(IEnumerable<double> target, IEnumerable<double> pred) {
       var targetArr = target.ToArray();
       var predArr = pred.ToArray();
-      var weightArr = weight.ToArray();
-      // weights are not supported yet
-      // when weights are supported we need to calculate a weighted median
-      Debug.Assert(weightArr.All(w => w.IsAlmost(1.0)));
 
-      if (targetArr.Length != predArr.Length || predArr.Length != weightArr.Length)
-        throw new ArgumentException("target, pred and weight have different lengths");
+      if (targetArr.Length != predArr.Length)
+        throw new ArgumentException("target and pred have different lengths");
 
       // "Simple Newton-Raphson step" of eqn. 23 
@@ -82,5 +76,5 @@
           var row = idx[i];
           var y = targetArr[row] * 2 - 1; // y in {-1,1}
-          var pseudoResponse = weightArr[row] * 2 * y / (1 + Math.Exp(2 * y * predArr[row]));
+          var pseudoResponse = 2 * y / (1 + Math.Exp(2 * y * predArr[row]));
 
           sumY += pseudoResponse;
Index: /branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/RelativeErrorLoss.cs
===================================================================
--- /branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/RelativeErrorLoss.cs	(revision 12695)
+++ /branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/RelativeErrorLoss.cs	(revision 12696)
@@ -30,44 +30,40 @@
   // relative error loss is a special case of weighted absolute error loss with weights = (1/target)
   public class RelativeErrorLoss : ILossFunction {
-    public double GetLoss(IEnumerable<double> target, IEnumerable<double> pred, IEnumerable<double> weight) {
+    public double GetLoss(IEnumerable<double> target, IEnumerable<double> pred) {
       var targetEnum = target.GetEnumerator();
       var predEnum = pred.GetEnumerator();
-      var weightEnum = weight.GetEnumerator();
 
       double s = 0;
-      while (targetEnum.MoveNext() & predEnum.MoveNext() & weightEnum.MoveNext()) {
+      while (targetEnum.MoveNext() & predEnum.MoveNext()) {
         double res = targetEnum.Current - predEnum.Current;
-        s += weightEnum.Current * Math.Abs(res) * Math.Abs(1.0 / targetEnum.Current);
+        s += Math.Abs(res) * Math.Abs(1.0 / targetEnum.Current);
       }
-      if (targetEnum.MoveNext() | predEnum.MoveNext() | weightEnum.MoveNext())
-        throw new ArgumentException("target, pred and weight have different lengths");
+      if (targetEnum.MoveNext() | predEnum.MoveNext())
+        throw new ArgumentException("target and pred have different lengths");
 
       return s;
     }
 
-    public IEnumerable<double> GetLossGradient(IEnumerable<double> target, IEnumerable<double> pred, IEnumerable<double> weight) {
+    public IEnumerable<double> GetLossGradient(IEnumerable<double> target, IEnumerable<double> pred) {
       var targetEnum = target.GetEnumerator();
       var predEnum = pred.GetEnumerator();
-      var weightEnum = weight.GetEnumerator();
 
-      while (targetEnum.MoveNext() & predEnum.MoveNext() & weightEnum.MoveNext()) {
-        // weight * sign(res) * abs(1 / target)
+      while (targetEnum.MoveNext() & predEnum.MoveNext()) {
+        // sign(res) * abs(1 / target)
         var res = targetEnum.Current - predEnum.Current;
-        if (res > 0) yield return weightEnum.Current * 1.0 / Math.Abs(targetEnum.Current);
-        else if (res < 0) yield return -weightEnum.Current * 1.0 / Math.Abs(targetEnum.Current);
+        if (res > 0) yield return 1.0 / Math.Abs(targetEnum.Current);
+        else if (res < 0) yield return -1.0 / Math.Abs(targetEnum.Current);
         else yield return 0.0;
       }
-      if (targetEnum.MoveNext() | predEnum.MoveNext() | weightEnum.MoveNext())
-        throw new ArgumentException("target, pred and weight have different lengths");
+      if (targetEnum.MoveNext() | predEnum.MoveNext())
+        throw new ArgumentException("target and pred have different lengths");
     }
 
-    public LineSearchFunc GetLineSearchFunc(IEnumerable<double> target, IEnumerable<double> pred, IEnumerable<double> weight) {
+    public LineSearchFunc GetLineSearchFunc(IEnumerable<double> target, IEnumerable<double> pred) {
       var targetArr = target.ToArray();
       var predArr = pred.ToArray();
-      var weightArr = weight.ToArray();
-      Debug.Assert(weightArr.All(w => w.IsAlmost(1.0)));
 
-      if (targetArr.Length != predArr.Length || predArr.Length != weightArr.Length)
-        throw new ArgumentException("target, pred and weight have different lengths");
+      if (targetArr.Length != predArr.Length)
+        throw new ArgumentException("target and pred have different lengths");
 
       // line search for relative error
@@ -79,6 +75,6 @@
         else if (nRows == 2) {
           // weighted average of two residuals
-          var w0 = weightArr[idx[startIdx]] * Math.Abs(1.0 / targetArr[idx[startIdx]]);
-          var w1 = weightArr[idx[endIdx]] * Math.Abs(1.0 / targetArr[idx[endIdx]]);
+          var w0 = Math.Abs(1.0 / targetArr[idx[startIdx]]);
+          var w1 = Math.Abs(1.0 / targetArr[idx[endIdx]]);
           if (w0 > w1) {
             return targetArr[idx[startIdx]] - predArr[idx[startIdx]];
@@ -96,5 +92,5 @@
             int row = idx[i];
             var res = targetArr[row] - predArr[row];
-            var w = weightArr[row] * Math.Abs(1.0 / targetArr[row]);
+            var w = Math.Abs(1.0 / targetArr[row]);
             res_w[i - startIdx] = new KeyValuePair<double, double>(res, w);
             totalWeight += w;
Index: /branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/SquaredErrorLoss.cs
===================================================================
--- /branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/SquaredErrorLoss.cs	(revision 12695)
+++ /branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/SquaredErrorLoss.cs	(revision 12696)
@@ -27,38 +27,35 @@
 namespace HeuristicLab.Algorithms.DataAnalysis {
   public class SquaredErrorLoss : ILossFunction {
-    public double GetLoss(IEnumerable<double> target, IEnumerable<double> pred, IEnumerable<double> weight) {
+    public double GetLoss(IEnumerable<double> target, IEnumerable<double> pred) {
       var targetEnum = target.GetEnumerator();
       var predEnum = pred.GetEnumerator();
-      var weightEnum = weight.GetEnumerator();
 
       double s = 0;
-      while (targetEnum.MoveNext() & predEnum.MoveNext() & weightEnum.MoveNext()) {
+      while (targetEnum.MoveNext() & predEnum.MoveNext()) {
         double res = targetEnum.Current - predEnum.Current;
-        s += weightEnum.Current * res * res; // w * (res)^2
+        s += res * res; // (res)^2
       }
-      if (targetEnum.MoveNext() | predEnum.MoveNext() | weightEnum.MoveNext())
-        throw new ArgumentException("target, pred and weight have different lengths");
+      if (targetEnum.MoveNext() | predEnum.MoveNext())
+        throw new ArgumentException("target and pred have different lengths");
 
       return s;
     }
 
-    public IEnumerable<double> GetLossGradient(IEnumerable<double> target, IEnumerable<double> pred, IEnumerable<double> weight) {
+    public IEnumerable<double> GetLossGradient(IEnumerable<double> target, IEnumerable<double> pred) {
       var targetEnum = target.GetEnumerator();
       var predEnum = pred.GetEnumerator();
-      var weightEnum = weight.GetEnumerator();
 
-      while (targetEnum.MoveNext() & predEnum.MoveNext() & weightEnum.MoveNext()) {
-        yield return weightEnum.Current * 2.0 * (targetEnum.Current - predEnum.Current); // dL(y, f(x)) / df(x)  = w * 2 * res 
+      while (targetEnum.MoveNext() & predEnum.MoveNext()) {
+        yield return 2.0 * (targetEnum.Current - predEnum.Current); // dL(y, f(x)) / df(x)  = 2 * res 
       }
-      if (targetEnum.MoveNext() | predEnum.MoveNext() | weightEnum.MoveNext())
-        throw new ArgumentException("target, pred and weight have different lengths");
+      if (targetEnum.MoveNext() | predEnum.MoveNext())
+        throw new ArgumentException("target and pred have different lengths");
     }
 
-    public LineSearchFunc GetLineSearchFunc(IEnumerable<double> target, IEnumerable<double> pred, IEnumerable<double> weight) {
+    public LineSearchFunc GetLineSearchFunc(IEnumerable<double> target, IEnumerable<double> pred) {
       var targetArr = target.ToArray();
       var predArr = pred.ToArray();
-      var weightArr = weight.ToArray();
-      if (targetArr.Length != predArr.Length || predArr.Length != weightArr.Length)
-        throw new ArgumentException("target, pred and weight have different lengths");
+      if (targetArr.Length != predArr.Length)
+        throw new ArgumentException("target and pred have different lengths");
 
       // line search for squared error loss 
Index: /branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/RegressionTreeBuilder.cs
===================================================================
--- /branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/RegressionTreeBuilder.cs	(revision 12695)
+++ /branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/RegressionTreeBuilder.cs	(revision 12696)
@@ -128,7 +128,6 @@
       var seLoss = new SquaredErrorLoss();
       var zeros = Enumerable.Repeat(0.0, y.Length);
-      var ones = Enumerable.Repeat(1.0, y.Length);
-
-      var model = CreateRegressionTreeForGradientBoosting(y, maxSize, problemData.TrainingIndices.ToArray(), seLoss.GetLineSearchFunc(y, zeros, ones), r, m);
+
+      var model = CreateRegressionTreeForGradientBoosting(y, maxSize, problemData.TrainingIndices.ToArray(), seLoss.GetLineSearchFunc(y, zeros), r, m);
 
       return new GradientBoostedTreesModel(new[] { new ConstantRegressionModel(yAvg), model }, new[] { 1.0, 1.0 });
