Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/05/10 19:50:46 (15 years ago)
Author:
gkronber
Message:

Implemented analyzers for symbolic expression tree encoding, artificial ant problem and symbolic regression problem. #999 (Refactor algorithm analysis and tracing)

Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3
Files:
6 added
3 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/HeuristicLab.Problems.DataAnalysis.Regression-3.3.csproj

    r3532 r3651  
    8686    <Compile Include="HeuristicLabProblemsDataAnalysisRegressionPlugin.cs" />
    8787    <Compile Include="Properties\AssemblyInfo.cs" />
    88     <Compile Include="Symbolic\BestValidationSymbolicRegressionSolutionVisualizer.cs" />
     88    <Compile Include="Symbolic\Analyzers\PopulationSymbolicRegressionVariableFrequencyAnalyzer.cs" />
     89    <Compile Include="Symbolic\Analyzers\PopulationValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs" />
     90    <Compile Include="Symbolic\Analyzers\SymbolicRegressionSolutionLinearScaler.cs" />
     91    <Compile Include="Symbolic\Analyzers\ISymbolicRegressionSolutionPopulationAnalyzer.cs" />
     92    <Compile Include="Symbolic\Analyzers\PopulationBestSymbolicRegressionSolutionAnalyzer.cs" />
    8993    <Compile Include="Symbolic\SymbolicRegressionScaledMeanSquaredErrorEvaluator.cs" />
    9094    <Compile Include="Symbolic\SymbolicRegressionSolution.cs" />
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/HeuristicLabProblemsDataAnalysisRegressionPlugin.cs.frame

    r3384 r3651  
    2828  [Plugin("HeuristicLab.Problems.DataAnalysis.Regression","3.3.0.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Problems.DataAnalysis.Regression-3.3.dll", PluginFileType.Assembly)]
     30  [PluginDependency("HeuristicLab.Analysis", "3.3.0.0")]
    3031  [PluginDependency("HeuristicLab.Collections", "3.3.0.0")]
    3132  [PluginDependency("HeuristicLab.Common", "3.3")]
     
    3839  [PluginDependency("HeuristicLab.Parameters", "3.3.0.0")]
    3940  [PluginDependency("HeuristicLab.Persistence", "3.3.0.0")]
     41  [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.3.0.0")]
     42  [PluginDependency("HeuristicLab.Random", "3.3.0.0")] 
    4043  public class HeuristicLabProblemsDataAnalysisRegressionPlugin : PluginBase {
    4144  }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblem.cs

    r3616 r3651  
    3939using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
    4040using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces;
     41using HeuristicLab.Problems.DataAnalysis.Regression.Symbolic.Analyzers;
     42using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Analyzers;
    4143
    4244namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic {
     
    150152      get { return BestKnownQualityParameter.Value; }
    151153    }
    152     private List<ISymbolicExpressionTreeOperator> operators;
     154    private List<IOperator> operators;
    153155    public IEnumerable<IOperator> Operators {
    154       get { return operators.Cast<IOperator>(); }
     156      get { return operators; }
     157    }
     158    public IEnumerable<ISymbolicRegressionSolutionPopulationAnalyzer> Analyzers {
     159      get { return operators.OfType<ISymbolicRegressionSolutionPopulationAnalyzer>(); }
    155160    }
    156161    public DoubleValue PunishmentFactor {
     
    180185      var grammar = new ArithmeticExpressionGrammar();
    181186      var globalGrammar = new GlobalSymbolicExpressionGrammar(grammar);
    182       var visualizer = new BestValidationSymbolicRegressionSolutionVisualizer();
    183187      var interpreter = new SimpleArithmeticExpressionInterpreter();
    184188      Parameters.Add(new ValueParameter<BoolValue>("Maximization", "Set to false as the error of the regression model should be minimized.", (BoolValue)new BoolValue(false).AsReadOnly()));
     
    200204      ParameterizeSolutionCreator();
    201205      ParameterizeEvaluator();
    202       ParameterizeVisualizer();
    203206
    204207      UpdateGrammar();
     
    240243      // paritions could be changed
    241244      ParameterizeEvaluator();
    242       ParameterizeVisualizer();
     245      ParameterizeAnalyzers();
    243246      // input variables could have been changed
    244247      UpdateGrammar();
     
    260263    protected virtual void OnSolutionParameterNameChanged(EventArgs e) {
    261264      ParameterizeEvaluator();
    262       ParameterizeVisualizer();
     265      ParameterizeAnalyzers();
    263266      ParameterizeOperators();
    264267    }
     
    267270      Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
    268271      ParameterizeEvaluator();
    269       ParameterizeVisualizer();
     272      ParameterizeAnalyzers();
    270273      RaiseEvaluatorChanged(e);
    271274    }
    272275    protected virtual void OnQualityParameterNameChanged(EventArgs e) {
    273       ParameterizeVisualizer();
     276      ParameterizeAnalyzers();
    274277    }
    275278    #endregion
     
    345348
    346349    private void InitializeOperators() {
    347       operators = new List<ISymbolicExpressionTreeOperator>();
    348       operators.AddRange(ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeOperator>());
     350      operators = new List<IOperator>();
     351      operators.AddRange(ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeOperator>().OfType<IOperator>());
     352      operators.Add(new PopulationValidationBestScaledSymbolicRegressionSolutionAnalyzer());
     353      operators.Add(new PopulationMinAvgMaxTreeSizeAnalyzer());
     354      operators.Add(new PopulationSymbolicRegressionVariableFrequencyAnalyzer());
    349355      ParameterizeOperators();
     356      ParameterizeAnalyzers();
    350357    }
    351358
     
    365372    }
    366373
    367     private void ParameterizeVisualizer() {
    368       //var solutionVisualizer = Visualizer as BestValidationSymbolicRegressionSolutionVisualizer;
    369       //if (solutionVisualizer != null) {
    370       //  solutionVisualizer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
    371       //  solutionVisualizer.DataAnalysisProblemDataParameter.ActualName = DataAnalysisProblemDataParameter.Name;
    372       //  solutionVisualizer.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameter.Name;
    373       //  solutionVisualizer.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameter.Name;
    374       //  solutionVisualizer.QualityParameter.ActualName = Evaluator.QualityParameter.Name;
    375       //  solutionVisualizer.SymbolicExpressionTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name;
    376       //  solutionVisualizer.ValidationSamplesStartParameter.Value = ValidationSamplesStart;
    377       //  solutionVisualizer.ValidationSamplesEndParameter.Value = ValidationSamplesEnd;
    378       //}
     374    private void ParameterizeAnalyzers() {
     375      foreach (var analyzer in Analyzers) {
     376        analyzer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
     377        var bestValidationSolutionAnalyzer = analyzer as PopulationValidationBestScaledSymbolicRegressionSolutionAnalyzer;
     378        if (bestValidationSolutionAnalyzer != null) {
     379          bestValidationSolutionAnalyzer.ProblemDataParameter.ActualName = DataAnalysisProblemDataParameter.Name;
     380          bestValidationSolutionAnalyzer.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameter.Name;
     381          bestValidationSolutionAnalyzer.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameter.Name;
     382          bestValidationSolutionAnalyzer.SymbolicExpressionTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name;
     383          bestValidationSolutionAnalyzer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
     384          bestValidationSolutionAnalyzer.SamplesStartParameter.Value = ValidationSamplesStart;
     385          bestValidationSolutionAnalyzer.SamplesEndParameter.Value = ValidationSamplesEnd;
     386        }
     387        var varFreqAnalyzer = analyzer as PopulationSymbolicRegressionVariableFrequencyAnalyzer;
     388        if (varFreqAnalyzer != null) {
     389          varFreqAnalyzer.ProblemDataParameter.ActualName = DataAnalysisProblemDataParameter.Name;
     390        }
     391      }
     392      foreach (ISymbolicExpressionTreePopulationAnalyzer analyzer in Operators.OfType<ISymbolicExpressionTreePopulationAnalyzer>()) {
     393        analyzer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
     394      }
    379395    }
    380396
Note: See TracChangeset for help on using the changeset viewer.