Free cookie consent management tool by TermsFeed Policy Generator

Changeset 17466


Ignore:
Timestamp:
03/03/20 08:32:10 (4 years ago)
Author:
pfleck
Message:

#3040 Added separate mean symbol instead of reusing the average symbol.

Location:
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentVectorExpressionGrammar.cs

    r17465 r17466  
    8686      var factorVariable = new FactorVariable();
    8787
     88      var mean = new Mean();
     89      var sd = new StandardDeviation();
    8890      var sum = new Sum();
    89       var mean = new Average { Name = "Mean" };
    90       var sd = new StandardDeviation();
    9191      #endregion
    9292
     
    120120      var powerSymbols = new GroupSymbol(PowerFunctionsName, new List<ISymbol> { square, sqrt, cube, cubeRoot, power, root });
    121121      var terminalSymbols = new GroupSymbol(TerminalsName, new List<ISymbol> { constant, variable, binFactorVariable, factorVariable });
    122       var aggregationSymbols = new GroupSymbol(VectorAggregationName, new List<ISymbol> { sum, mean, sd });
     122      var aggregationSymbols = new GroupSymbol(VectorAggregationName, new List<ISymbol> { mean, sd, sum });
    123123      var scalarSymbols = new GroupSymbol(ScalarSymbolsName, new List<ISymbol>() { arithmeticSymbols, trigonometricSymbols, exponentialAndLogarithmicSymbols, powerSymbols, terminalSymbols, aggregationSymbols });
    124124
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj

    r17463 r17466  
    231231    <Compile Include="Symbols\And.cs" />
    232232    <Compile Include="Symbols\AutoregressiveVariable.cs" />
     233    <Compile Include="Symbols\Mean.cs" />
    233234    <Compile Include="Symbols\StandardDeviation.cs" />
    234235    <Compile Include="Symbols\Sum.cs" />
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs

    r17463 r17466  
    7878    CubeRoot = 51,
    7979    Tanh = 52,
    80     Sum = 53,
    81     Sd = 54
    82   };
     80    Mean = 53,
     81    StandardDeviation = 54,
     82    Sum = 55
     83  }
    8384  public static class OpCodes {
    8485    // constants for API compatibility only
     
    135136    public const byte CubeRoot = (byte)OpCode.CubeRoot;
    136137    public const byte Tanh = (byte)OpCode.Tanh;
     138    public const byte Mean = (byte)OpCode.Mean;
     139    public const byte StandardDeviation = (byte)OpCode.StandardDeviation;
    137140    public const byte Sum = (byte)OpCode.Sum;
    138     public const byte StandardDeviation = (byte)OpCode.Sd;
     141
    139142
    140143    private static Dictionary<Type, byte> symbolToOpcode = new Dictionary<Type, byte>() {
     
    192195      { typeof(Cube), OpCodes.Cube },
    193196      { typeof(CubeRoot), OpCodes.CubeRoot },
    194       { typeof(Sum), OpCodes.Sum },
    195       { typeof(StandardDeviation), OpCodes.StandardDeviation }
     197      { typeof(Mean), OpCodes.Mean },
     198      { typeof(StandardDeviation), OpCodes.StandardDeviation },
     199      { typeof(Sum), OpCodes.Sum }
     200
    196201    };
    197202
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeVectorInterpreter.cs

    r17465 r17466  
    334334              v => v.Sum());
    335335          }
    336         case OpCodes.Average: {
     336        case OpCodes.Mean: {
    337337            var cur = Evaluate(dataset, ref row, state);
    338338            return AggregateApply(cur,
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Mean.cs

    r17455 r17466  
    2424using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2525using HEAL.Attic;
     26
    2627namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    27   [StorableType("459E521B-A921-4A0F-B63D-B298DA2CDD11")]
    28   [Item("Average", "Symbol that represents the average (arithmetic mean) function.")]
    29   public sealed class Average : Symbol {
     28  [StorableType("2AE24E16-849E-4D54-A35B-7FE64BEF8ECB")]
     29  [Item("Mean", "Symbol that represents the mean function.")]
     30  public sealed class Mean : Symbol {
    3031    private const int minimumArity = 1;
    31     private const int maximumArity = byte.MaxValue;
     32    private const int maximumArity = 1;
    3233
    3334    public override int MinimumArity {
     
    3940
    4041    [StorableConstructor]
    41     private Average(StorableConstructorFlag _) : base(_) { }
    42     private Average(Average original, Cloner cloner) : base(original, cloner) { }
     42    private Mean(StorableConstructorFlag _) : base(_) { }
     43    private Mean(Mean original, Cloner cloner) : base(original, cloner) { }
    4344    public override IDeepCloneable Clone(Cloner cloner) {
    44       return new Average(this, cloner);
     45      return new Mean(this, cloner);
    4546    }
    46     public Average() : base("Average", "Symbol that represents the average (arithmetic mean) function.") { }
     47    public Mean() : base("Mean", "Symbol that represents the mean function.") { }
    4748  }
    4849}
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/StandardDeviation.cs

    r17463 r17466  
    2929  public sealed class StandardDeviation : Symbol {
    3030    private const int minimumArity = 1;
    31     private const int maximumArity = byte.MaxValue;
     31    private const int maximumArity = 1;
    3232
    3333    public override int MinimumArity {
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Sum.cs

    r17460 r17466  
    2727namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    2828  [StorableType("C6C245BF-C44A-4207-A268-55641483F27F")]
    29   [Item("Sum", "Symbol that represents the Sum function.")]
     29  [Item("Sum", "Symbol that represents the sum function.")]
    3030  public sealed class Sum : Symbol {
    3131    private const int minimumArity = 1;
    32     private const int maximumArity = byte.MaxValue;
     32    private const int maximumArity = 1;
    3333
    3434    public override int MinimumArity {
Note: See TracChangeset for help on using the changeset viewer.