Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/17/15 18:33:31 (9 years ago)
Author:
gkronber
Message:

#2434 reverse merge of r12871 (changes should be applied directly to trunk)

Location:
branches/crossvalidation-2434/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/crossvalidation-2434/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/AbsoluteErrorLoss.cs

    r12871 r12872  
    2323using System;
    2424using System.Collections.Generic;
     25using System.Diagnostics;
     26using System.Linq;
    2527using HeuristicLab.Common;
    26 using HeuristicLab.Core;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2828
    2929namespace HeuristicLab.Algorithms.DataAnalysis {
    3030  // loss function for the weighted absolute error
    31   [StorableClass]
    32   [Item("Absolute error loss", "")]
    33   public class AbsoluteErrorLoss : Item, ILossFunction {
    34     public AbsoluteErrorLoss() { }
    35 
     31  public class AbsoluteErrorLoss : ILossFunction {
    3632    public double GetLoss(IEnumerable<double> target, IEnumerable<double> pred) {
    3733      var targetEnum = target.GetEnumerator();
     
    8177    }
    8278
    83     #region item implementation
    84     private AbsoluteErrorLoss(AbsoluteErrorLoss original, Cloner cloner) : base(original, cloner) { }
    85 
    86     public override IDeepCloneable Clone(Cloner cloner) {
    87       return new AbsoluteErrorLoss(this, cloner);
     79    public override string ToString() {
     80      return "Absolute error loss";
    8881    }
    89     #endregion
    9082  }
    9183}
  • branches/crossvalidation-2434/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/ILossFunction.cs

    r12871 r12872  
    2222
    2323using System.Collections.Generic;
    24 using HeuristicLab.Core;
    2524
    2625namespace HeuristicLab.Algorithms.DataAnalysis {
     
    2827  // target represents the target vector  (original targets from the problem data, never changed)
    2928  // pred   represents the current vector of predictions (a weighted combination of models learned so far, this vector is updated after each step)
    30   public interface ILossFunction : IItem {
     29  public interface ILossFunction {
    3130    // returns the loss of the current prediction vector
    3231    double GetLoss(IEnumerable<double> target, IEnumerable<double> pred);
  • branches/crossvalidation-2434/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/LogisticRegressionLoss.cs

    r12871 r12872  
    2626using System.Linq;
    2727using HeuristicLab.Common;
    28 using HeuristicLab.Core;
    29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3028
    3129namespace HeuristicLab.Algorithms.DataAnalysis {
    3230  // Greedy Function Approximation: A Gradient Boosting Machine (page 9)
    33   [StorableClass]
    34   [Item("Logistic regression loss", "")]
    35   public class LogisticRegressionLoss : Item, ILossFunction {
    36     public LogisticRegressionLoss() { }
    37 
     31  public class LogisticRegressionLoss : ILossFunction {
    3832    public double GetLoss(IEnumerable<double> target, IEnumerable<double> pred) {
    3933      var targetEnum = target.GetEnumerator();
     
    8983    }
    9084
    91     #region item implementation
    92     private LogisticRegressionLoss(LogisticRegressionLoss original, Cloner cloner) : base(original, cloner) { }
    93 
    94     public override IDeepCloneable Clone(Cloner cloner) {
    95       return new LogisticRegressionLoss(this, cloner);
     85    public override string ToString() {
     86      return "Logistic regression loss";
    9687    }
    97     #endregion
    98 
    9988  }
    10089}
  • branches/crossvalidation-2434/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/RelativeErrorLoss.cs

    r12871 r12872  
    2626using System.Linq;
    2727using HeuristicLab.Common;
    28 using HeuristicLab.Core;
    29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3028
    3129namespace HeuristicLab.Algorithms.DataAnalysis {
    3230  // relative error loss is a special case of weighted absolute error loss with weights = (1/target)
    33   [StorableClass]
    34   [Item("Relative error loss", "")]
    35   public class RelativeErrorLoss : Item, ILossFunction {
    36     public RelativeErrorLoss() { }
    37 
     31  public class RelativeErrorLoss : ILossFunction {
    3832    public double GetLoss(IEnumerable<double> target, IEnumerable<double> pred) {
    3933      var targetEnum = target.GetEnumerator();
     
    111105    }
    112106
    113     #region item implementation
    114     private RelativeErrorLoss(RelativeErrorLoss original, Cloner cloner) : base(original, cloner) { }
    115 
    116     public override IDeepCloneable Clone(Cloner cloner) {
    117       return new RelativeErrorLoss(this, cloner);
     107    public override string ToString() {
     108      return "Relative error loss";
    118109    }
    119     #endregion
    120110  }
    121111}
  • branches/crossvalidation-2434/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/SquaredErrorLoss.cs

    r12871 r12872  
    2424using System.Collections.Generic;
    2525using System.Linq;
    26 using HeuristicLab.Common;
    27 using HeuristicLab.Core;
    28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2926
    3027namespace HeuristicLab.Algorithms.DataAnalysis {
    31   [StorableClass]
    32   [Item("Squared error loss", "")]
    33   public class SquaredErrorLoss : Item, ILossFunction {
    34     public SquaredErrorLoss() { }
    35 
     28  public class SquaredErrorLoss : ILossFunction {
    3629    public double GetLoss(IEnumerable<double> target, IEnumerable<double> pred) {
    3730      var targetEnum = target.GetEnumerator();
     
    7770    }
    7871
    79     #region item implementation
    80     private SquaredErrorLoss(SquaredErrorLoss original, Cloner cloner) : base(original, cloner) { }
    81 
    82     public override IDeepCloneable Clone(Cloner cloner) {
    83       return new SquaredErrorLoss(this, cloner);
     72    public override string ToString() {
     73      return "Squared error loss";
    8474    }
    85     #endregion
    8675  }
    8776}
Note: See TracChangeset for help on using the changeset viewer.