Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/10/17 12:56:36 (6 years ago)
Author:
bwerth
Message:

#2847 worked on M5Regression

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/M5Regression/Spliting/OrderImpurityCalculator.cs

    r15430 r15470  
    2727namespace HeuristicLab.Algorithms.DataAnalysis {
    2828  /// <summary>
    29   /// Helper class for incremental impurity calculation.
     29  /// Helper class for incremental split calculation.
    3030  /// Used while moving a potential Split along the ordered training Instances
    3131  /// </summary>
    32   internal class OrderImpurityCalculator : IImpurityCalculator {
     32  internal class OrderImpurityCalculator {
     33    internal enum IncrementType {
     34      Left,
     35      Right,
     36      None
     37    }
     38
    3339    #region Properties
    3440    private double SqSumLeft { get; set; }
     
    99105      VarRight = NoRight <= 0 ? 0 : Math.Abs(NoRight * SqSumRight - SumRight * SumRight) / (NoRight * NoRight);
    100106
    101       if (Order <= 0) throw new ArgumentException("Impurity order must be larger than 0");
     107      if (Order <= 0) throw new ArgumentException("Split order must be larger than 0");
    102108      if (Order.IsAlmost(1)) {
    103109        y = VarTotal;
     
    111117      }
    112118      var t = NoRight + NoLeft;
    113       if (NoLeft <= 0.0 || NoRight <= 0.0) Impurity = double.MinValue; //Impurity = 0;
    114       else Impurity = y - NoLeft / t * yl - NoRight / t * yr; //  Impurity = y - NoLeft / NoRight * yl - NoRight / NoLeft * yr
     119      if (NoLeft <= 0.0 || NoRight <= 0.0) Impurity = double.MinValue; //Split = 0;
     120      else Impurity = y - NoLeft / t * yl - NoRight / t * yr; //  Split = y - NoLeft / NoRight * yl - NoRight / NoLeft * yr
    115121    }
    116122    #endregion
Note: See TracChangeset for help on using the changeset viewer.