Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/23/14 14:10:06 (11 years ago)
Author:
tsteinre
Message:

LinearTransformation: Renamed Multiplier and Addend

Location:
branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Transformations/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Transformations/3.3/LinearTransformation.cs

    r10775 r10777  
    3434  [Item("LinearTransformation", "Represents a linear transformation with multiplication and addition.")]
    3535  public class LinearTransformation : Transformation<double> {
    36     protected const string MultiplicandParameterName = "Multiplicand";
    37     protected const string SummandParameterName = "Summand";
     36    protected const string MultiplierParameterName = "Multiplier";
     37    protected const string AddendParameterName = "Addend";
    3838
    3939    #region Parameters
    40     public IValueParameter<DoubleValue> MultiplicandParameter {
    41       get { return (IValueParameter<DoubleValue>)Parameters[MultiplicandParameterName]; }
     40    public IValueParameter<DoubleValue> MultiplierParameter {
     41      get { return (IValueParameter<DoubleValue>)Parameters[MultiplierParameterName]; }
    4242    }
    43     public IValueParameter<DoubleValue> SummandParameter {
    44       get { return (IValueParameter<DoubleValue>)Parameters[SummandParameterName]; }
     43    public IValueParameter<DoubleValue> AddendParameter {
     44      get { return (IValueParameter<DoubleValue>)Parameters[AddendParameterName]; }
    4545    }
    4646    #endregion
    4747
    4848    #region properties
    49     public double Multiplicand {
    50       get { return MultiplicandParameter.Value.Value; }
     49    public double Multiplier {
     50      get { return MultiplierParameter.Value.Value; }
    5151      protected set {
    52         MultiplicandParameter.Value.Value = value;
     52        MultiplierParameter.Value.Value = value;
    5353      }
    5454    }
    5555
    56     public double Summand {
    57       get { return SummandParameter.Value.Value; }
     56    public double Addend {
     57      get { return AddendParameter.Value.Value; }
    5858      protected set {
    59         SummandParameter.Value.Value = value;
     59        AddendParameter.Value.Value = value;
    6060      }
    6161    }
     
    7171    public LinearTransformation(IEnumerable<string> allowedColumns)
    7272      : base(allowedColumns) {
    73       Parameters.Add(new ValueParameter<DoubleValue>(MultiplicandParameterName, "Multiplicand for linear transformation", new DoubleValue(1.0)));
    74       Parameters.Add(new ValueParameter<DoubleValue>(SummandParameterName, "Summand for linear transformation", new DoubleValue(0.0)));
     73      Parameters.Add(new ValueParameter<DoubleValue>(MultiplierParameterName, "Multiplier for linear transformation", new DoubleValue(1.0)));
     74      Parameters.Add(new ValueParameter<DoubleValue>(AddendParameterName, "Addend for linear transformation", new DoubleValue(0.0)));
    7575    }
    7676
     
    8080
    8181    public override IEnumerable<double> Apply(IEnumerable<double> data) {
    82       return data.Select(e => e * Multiplicand + Summand);
     82      return data.Select(e => e * Multiplier + Addend);
    8383    }
    8484
     
    8888      errorMsg = null;
    8989
    90       if (Multiplicand == 0.0) {
    91         sb.Append(String.Format("Multiplicand is 0, all {0} entries will be set to {1}. Reversal will not be possble", data.Count(), Summand));
     90      if (Multiplier == 0.0) {
     91        sb.Append(String.Format("Multiplicand is 0, all {0} entries will be set to {1}. Reversal will not be possble", data.Count(), Addend));
    9292        errorMsg = sb.ToString();
    9393        success = false;
  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Transformations/3.3/ShiftDataToRangeTransformation.cs

    r10775 r10777  
    3434    public ShiftDataToRangeTransformation(IEnumerable<string> allowedColumns)
    3535      : base(allowedColumns) {
    36       MultiplicandParameter.Hidden = true;
    37       SummandParameter.Hidden = true;
     36      MultiplierParameter.Hidden = true;
     37      AddendParameter.Hidden = true;
    3838      Parameters.Add(new ValueParameter<DoubleRange>(RangeParameterName, "Range for the target window of the linear transformation", new DoubleRange(0.0, 1.0)));
    3939    }
     
    6060      double targetRangeWidth = Range.End - Range.Start;
    6161
    62       Multiplicand = targetRangeWidth / originalRangeWidth;
    63       Summand = Range.Start - originalRangeStart * Multiplicand;
     62      Multiplier = targetRangeWidth / originalRangeWidth;
     63      Addend = Range.Start - originalRangeStart * Multiplier;
    6464    }
    6565  }
Note: See TracChangeset for help on using the changeset viewer.