Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4054


Ignore:
Timestamp:
07/20/10 14:58:29 (14 years ago)
Author:
mkommend
Message:

improved Analyzers for SymoblicRegressionProblems (ticket #1074)

Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs

    r4034 r4054  
    236236      }
    237237
    238       int trainingStart = ProblemData.TrainingSamplesStart.Value;
    239       int trainingEnd = ProblemData.TrainingSamplesEnd.Value;
    240       int testStart = ProblemData.TestSamplesStart.Value;
    241       int testEnd = ProblemData.TestSamplesEnd.Value;
    242 
    243       SymbolicRegressionModelQualityAnalyzer.Analyze(scaledTrees, SymbolicExpressionTreeInterpreter,
    244         UpperEstimationLimit.Value, LowerEstimationLimit.Value,
    245         ProblemData, trainingStart, trainingEnd, testStart, testEnd, Results);
    246 
    247       #region validation best model
    248238      string targetVariable = ProblemData.TargetVariable.Value;
    249239      int validationStart = ValidiationSamplesStart.Value;
     
    268258      }
    269259
    270 
    271260      if (BestSolutionQualityParameter.ActualValue == null || BestSolutionQualityParameter.ActualValue.Value > bestValidationMse) {
    272261        var model = new SymbolicRegressionModel((ISymbolicExpressionTreeInterpreter)SymbolicExpressionTreeInterpreter.Clone(),
     
    293282      AddValue(validationValues, BestSolutionQualityParameter.ActualValue.Value, BestSolutionQualityParameterName, BestSolutionQualityParameterName);
    294283      AddValue(validationValues, bestValidationMse, CurrentBestValidationQualityParameterName, CurrentBestValidationQualityParameterName);
    295       #endregion
    296284      return base.Apply();
    297285    }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionModelQualityAnalyzer.cs

    r3996 r4054  
    9191    private const string RelativeErrorValuesParameterName = "Average relative error";
    9292
    93     private const string TrainingSamplesStartParameterName = "TrainingSamplesStart";
    94     private const string TrainingSamplesEndParameterName = "TrainingSamplesEnd";
    95     private const string TestSamplesStartParameterName = "TestSamplesStart";
    96     private const string TestSamplesEndParameterName = "TestSamplesEnd";
    9793    private const string UpperEstimationLimitParameterName = "UpperEstimationLimit";
    9894    private const string LowerEstimationLimitParameterName = "LowerEstimationLimit";
     
    107103    public IValueLookupParameter<DataAnalysisProblemData> ProblemDataParameter {
    108104      get { return (IValueLookupParameter<DataAnalysisProblemData>)Parameters[ProblemDataParameterName]; }
    109     }
    110     public IValueLookupParameter<IntValue> TrainingSamplesStartParameter {
    111       get { return (IValueLookupParameter<IntValue>)Parameters[TrainingSamplesStartParameterName]; }
    112     }
    113     public IValueLookupParameter<IntValue> TrainingSamplesEndParameter {
    114       get { return (IValueLookupParameter<IntValue>)Parameters[TrainingSamplesEndParameterName]; }
    115     }
    116     public IValueLookupParameter<IntValue> TestSamplesStartParameter {
    117       get { return (IValueLookupParameter<IntValue>)Parameters[TestSamplesStartParameterName]; }
    118     }
    119     public IValueLookupParameter<IntValue> TestSamplesEndParameter {
    120       get { return (IValueLookupParameter<IntValue>)Parameters[TestSamplesEndParameterName]; }
    121105    }
    122106    public IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter {
     
    144128      Parameters.Add(new ValueLookupParameter<ISymbolicExpressionTreeInterpreter>(SymbolicExpressionTreeInterpreterParameterName, "The interpreter that should be used to calculate the output values of the symbolic expression tree."));
    145129      Parameters.Add(new ValueLookupParameter<DataAnalysisProblemData>(ProblemDataParameterName, "The problem data containing the input varaibles for the symbolic regression problem."));
    146       Parameters.Add(new ValueLookupParameter<IntValue>(TrainingSamplesStartParameterName, "The first index of the training data set partition on which the model quality values should be calculated."));
    147       Parameters.Add(new ValueLookupParameter<IntValue>(TrainingSamplesEndParameterName, "The last index of the training data set partition on which the model quality values should be calculated."));
    148       Parameters.Add(new ValueLookupParameter<IntValue>(TestSamplesStartParameterName, "The first index of the test data set partition on which the model quality values should be calculated."));
    149       Parameters.Add(new ValueLookupParameter<IntValue>(TestSamplesEndParameterName, "The last index of the test data set partition on which the model quality values should be calculated."));
    150130      Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit that should be used as cut off value for the output values of symbolic expression trees."));
    151131      Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit that should be used as cut off value for the output values of symbolic expression trees."));
     
    162142      Analyze(SymbolicExpressionTreeParameter.ActualValue, SymbolicExpressionTreeInterpreterParameter.ActualValue,
    163143        UpperEstimationLimit.Value, LowerEstimationLimit.Value, ProblemDataParameter.ActualValue,
    164         TrainingSamplesStartParameter.ActualValue.Value, TrainingSamplesEndParameter.ActualValue.Value,
    165         TestSamplesStartParameter.ActualValue.Value, TestSamplesEndParameter.ActualValue.Value,
     144        ProblemDataParameter.ActualValue.TrainingSamplesStart.Value, ProblemDataParameter.ActualValue.TrainingSamplesEnd.Value,
     145        ProblemDataParameter.ActualValue.TestSamplesStart.Value, ProblemDataParameter.ActualValue.TestSamplesEnd.Value,
    166146        ResultsParameter.ActualValue);
    167147      return base.Apply();
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/ValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs

    r3926 r4054  
    186186      modelQualityAnalyzer.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameter.Name;
    187187      modelQualityAnalyzer.SymbolicExpressionTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name;
    188       modelQualityAnalyzer.TrainingSamplesStartParameter.ActualName = TrainingSamplesStartParameter.Name;
    189       modelQualityAnalyzer.TrainingSamplesEndParameter.ActualName = TrainingSamplesEndParameter.Name;
    190       modelQualityAnalyzer.TestSamplesStartParameter.ActualName = TestSamplesStartParameter.Name;
    191       modelQualityAnalyzer.TestSamplesEndParameter.ActualName = TestSamplesEndParameter.Name;
    192188
    193189      validationMseEvaluator.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameter.Name;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblem.cs

    r4036 r4054  
    221221    [StorableHook(HookType.AfterDeserialization)]
    222222    private void AfterDeserializationHook() {
    223       Initialize();
     223      RegisterParameterEvents();
     224      RegisterParameterValueEvents();
    224225    }
    225226
     
    344345      operators.Add(new FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer());
    345346      operators.Add(new MinAverageMaxSymbolicExpressionTreeSizeAnalyzer());
     347      operators.Add(new SymbolicRegressionModelQualityAnalyzer());
    346348      ParameterizeOperators();
    347349      ParameterizeAnalyzers();
     
    390392          bestValidationSolutionAnalyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
    391393        }
     394        var symbolicRegressionModelQualityAnalyzer = analyzer as SymbolicRegressionModelQualityAnalyzer;
     395        if (symbolicRegressionModelQualityAnalyzer != null) {
     396          symbolicRegressionModelQualityAnalyzer.ProblemDataParameter.ActualName = DataAnalysisProblemDataParameter.Name;
     397          symbolicRegressionModelQualityAnalyzer.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameter.Name;
     398          symbolicRegressionModelQualityAnalyzer.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameter.Name;
     399          symbolicRegressionModelQualityAnalyzer.SymbolicExpressionTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name;
     400          symbolicRegressionModelQualityAnalyzer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
     401        }
    392402        var varFreqAnalyzer = analyzer as SymbolicRegressionVariableFrequencyAnalyzer;
    393403        if (varFreqAnalyzer != null) {
Note: See TracChangeset for help on using the changeset viewer.