Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/19/11 15:45:34 (14 years ago)
Author:
mkommend
Message:

#1532: Corrected bug in scaling of trees.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationModel.cs

    r6233 r6234  
    145145      } else {
    146146        var mainBranch = startNode.GetSubtree(0);
    147         var product = MakeProduct(mainBranch, beta);
    148147        startNode.RemoveSubtree(0);
    149         startNode.AddSubtree(product);
    150 
    151         var scaledMainBranch = MakeSum(product, alpha);
    152         startNode.RemoveSubtree(0);
     148        var scaledMainBranch = MakeSum(MakeProduct(mainBranch, beta), alpha);
    153149        startNode.AddSubtree(scaledMainBranch);
    154150      }
     
    159155        return treeNode;
    160156      } else {
    161         var addition = treeNode.Grammar.Symbols.OfType<Addition>().FirstOrDefault();
    162         if (addition == null) addition = new Addition();
     157        var addition = new Addition();
    163158        var node = addition.CreateTreeNode();
    164159        var alphaConst = MakeConstant(alpha);
     
    173168        return treeNode;
    174169      } else {
    175         var multipliciation = treeNode.Grammar.Symbols.OfType<Multiplication>().FirstOrDefault();
    176         if (multipliciation == null) multipliciation = new Multiplication();
     170        var multipliciation = new Multiplication();
    177171        var node = multipliciation.CreateTreeNode();
    178172        var betaConst = MakeConstant(beta);
Note: See TracChangeset for help on using the changeset viewer.