Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/17/15 18:35:05 (7 years ago)
Author:
gkronber
Message:

#2450 derived ILossFunction from IItem to allow execution on hive without privileged flag (made an "after deserialization"-hook necessary to convert the parameter type)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/SquaredErrorLoss.cs

    r12700 r12873  
    2424using System.Collections.Generic;
    2525using System.Linq;
     26using HeuristicLab.Common;
     27using HeuristicLab.Core;
     28using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2629
    2730namespace HeuristicLab.Algorithms.DataAnalysis {
    28   public class SquaredErrorLoss : ILossFunction {
     31  [StorableClass]
     32  [Item("Squared error loss", "")]
     33  public class SquaredErrorLoss : Item, ILossFunction {
     34    public SquaredErrorLoss() { }
     35
    2936    public double GetLoss(IEnumerable<double> target, IEnumerable<double> pred) {
    3037      var targetEnum = target.GetEnumerator();
     
    7077    }
    7178
    72     public override string ToString() {
    73       return "Squared error loss";
     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);
    7484    }
     85    #endregion
    7586  }
    7687}
Note: See TracChangeset for help on using the changeset viewer.