Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/23/18 18:36:23 (7 years ago)
Author:
lkammere
Message:

#2886: Change complexity measure from number of nodes in tree to number of variable references.

Location:
branches/2886_SymRegGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration/Analysis
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2886_SymRegGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration/Analysis/RSquaredEvaluator.cs

    r15859 r15860  
    7777        problemData.TrainingIndices,
    7878        applyLinearScaling: false,
    79         maxIterations: 200,
     79        maxIterations: 50,
    8080        updateVariableWeights: true,
    8181        updateConstantsInTree: true);
     
    9696      //var estVals = model.GetEstimatedValues(problemData.Dataset, problemData.TrainingIndices);
    9797      //OnlineCalculatorError error;
    98       //r2 = OnlinePearsonsRCalculator.Calculate(target, estVals, out error);
     98      //double r2 = OnlinePearsonsRCalculator.Calculate(target, estVals, out error);
    9999      //if (error != OnlineCalculatorError.None) r2 = 0.0;
    100100
     
    102102      bool better = r2 > bestR2Result.Value;
    103103      bool equallyGood = r2.IsAlmost(bestR2Result.Value);
    104       bool shorter = algorithm.BestTrainingSentence != null && symbolString.Count() < algorithm.BestTrainingSentence.Count();
     104      bool shorter = false;
     105
     106      if (!better && equallyGood) {
     107        shorter = algorithm.BestTrainingSentence != null &&
     108          algorithm.Grammar.GetComplexity(algorithm.BestTrainingSentence) > algorithm.Grammar.GetComplexity(symbolString);
     109      }
    105110      if (better || (equallyGood && shorter)) {
    106111        bestR2Result.Value = r2;
  • branches/2886_SymRegGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration/Analysis/SentenceLogger.cs

    r15843 r15860  
    4545
    4646    private void GrammarEnumerationAlgorithmOnStarted(object sender, EventArgs eventArgs) {
    47       string datePostfix = $"_{DateTime.Now:yyyy-MM-dd_HH-mm}_TreeSize-{((GrammarEnumerationAlgorithm) sender).MaxTreeSize}.csv";
     47      string datePostfix = $"_{DateTime.Now:yyyy-MM-dd_HH-mm}_TreeSize-{((GrammarEnumerationAlgorithm) sender).MaxComplexity}.csv";
    4848      distinctSentencesFileName = workingDir + @"\distinctSentences" + datePostfix;
    4949      allSentencesFileName = workingDir + @"\allSentences" + datePostfix;
Note: See TracChangeset for help on using the changeset viewer.