Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/30/11 17:31:53 (14 years ago)
Author:
abeham
Message:

#1465

  • updated branch from trunk
Location:
branches/histogram
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/histogram

  • branches/histogram/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationModel.cs

    r5942 r6340  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
    2324using System.Linq;
    2425using HeuristicLab.Common;
    2526using HeuristicLab.Core;
    26 using HeuristicLab.Data;
    2727using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    28 using HeuristicLab.Operators;
    29 using HeuristicLab.Parameters;
    3028using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    31 using HeuristicLab.Optimization;
    32 using System;
    3329
    3430namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
     
    150146        var mainBranch = startNode.GetSubtree(0);
    151147        startNode.RemoveSubtree(0);
    152         var scaledMainBranch = MakeSum(MakeProduct(beta, mainBranch), alpha);
     148        var scaledMainBranch = MakeSum(MakeProduct(mainBranch, beta), alpha);
    153149        startNode.AddSubtree(scaledMainBranch);
    154150      }
     
    159155        return treeNode;
    160156      } else {
    161         var node = (new Addition()).CreateTreeNode();
     157        var addition = new Addition();
     158        var node = addition.CreateTreeNode();
    162159        var alphaConst = MakeConstant(alpha);
    163160        node.AddSubtree(treeNode);
     
    167164    }
    168165
    169     private static ISymbolicExpressionTreeNode MakeProduct(double beta, ISymbolicExpressionTreeNode treeNode) {
     166    private static ISymbolicExpressionTreeNode MakeProduct(ISymbolicExpressionTreeNode treeNode, double beta) {
    170167      if (beta.IsAlmost(1.0)) {
    171168        return treeNode;
    172169      } else {
    173         var node = (new Multiplication()).CreateTreeNode();
     170        var multipliciation = new Multiplication();
     171        var node = multipliciation.CreateTreeNode();
    174172        var betaConst = MakeConstant(beta);
    175173        node.AddSubtree(treeNode);
Note: See TracChangeset for help on using the changeset viewer.