Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/19/11 02:22:45 (14 years ago)
Author:
mkommend
Message:

#1418:

  • Worked on IntRange and DoubleRange
  • Updated evaluators, analyzers, problems and problem data to use IntRanges
  • Removed properties to access the value of LookupParameter
  • Corrected files.txt
Location:
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveMeanSquaredErrorTreeSizeEvaluator.cs

    r5747 r5759  
    2626using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    28 using System;
    2928
    3029namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
     
    4746    public override IOperation Apply() {
    4847      IEnumerable<int> rows = GenerateRowsToEvaluate();
    49       double[] qualities = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, LowerEstimationLimit.Value, UpperEstimationLimit.Value, ProblemData, rows);
     48      double[] qualities = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, ProblemDataParameter.ActualValue, rows);
    5049      QualitiesParameter.ActualValue = new DoubleArray(qualities);
    5150      return base.Apply();
     
    6564      UpperEstimationLimitParameter.ExecutionContext = context;
    6665
    67       double[] quality = Calculate(SymbolicDataAnalysisTreeInterpreter, tree, LowerEstimationLimit.Value, UpperEstimationLimit.Value, problemData, rows);
     66      double[] quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, problemData, rows);
    6867
    6968      SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null;
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectivePearsonRSquaredTreeSizeEvaluator.cs

    r5747 r5759  
    1 using System.Collections.Generic;
     1using System;
     2using System.Collections.Generic;
    23using HeuristicLab.Common;
    34using HeuristicLab.Core;
     
    56using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    67using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    7 using System;
    88
    99namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
     
    2626    public override IOperation Apply() {
    2727      IEnumerable<int> rows = GenerateRowsToEvaluate();
    28       double[] qualities = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, LowerEstimationLimit.Value, UpperEstimationLimit.Value, ProblemData, rows);
     28      double[] qualities = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, ProblemDataParameter.ActualValue, rows);
    2929      QualitiesParameter.ActualValue = new DoubleArray(qualities);
    3030      return base.Apply();
     
    4949      UpperEstimationLimitParameter.ExecutionContext = context;
    5050
    51       double[] quality = Calculate(SymbolicDataAnalysisTreeInterpreter, tree, LowerEstimationLimit.Value, UpperEstimationLimit.Value, problemData, rows);
     51      double[] quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, problemData, rows);
    5252
    5353      SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null;
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveProblem.cs

    r5733 r5759  
    7171      InitializeOperators();
    7272      UpdateEstimationLimits();
    73       UpdateDatasetPartitions();
    7473    }
    7574
     
    8180
    8281    private void UpdateEstimationLimits() {
    83       if (ProblemData.TrainingPartitionStart.Value < ProblemData.TrainingPartitionEnd.Value) {
    84         var targetValues = ProblemData.Dataset.GetVariableValues(ProblemData.TargetVariable, ProblemData.TrainingPartitionStart.Value, ProblemData.TrainingPartitionEnd.Value);
     82      if (ProblemData.TrainingPartition.Start < ProblemData.TrainingPartition.End) {
     83        var targetValues = ProblemData.Dataset.GetVariableValues(ProblemData.TargetVariable, ProblemData.TrainingPartition.Start, ProblemData.TrainingPartition.End);
    8584        var mean = targetValues.Average();
    8685        var range = targetValues.Max() - targetValues.Min();
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveValidationBestSolutionAnalyzer.cs

    r5736 r5759  
    2020#endregion
    2121
    22 using System.Collections.Generic;
    23 using System.Linq;
    2422using HeuristicLab.Common;
    2523using HeuristicLab.Core;
    2624using HeuristicLab.Data;
    2725using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    28 using HeuristicLab.Operators;
    29 using HeuristicLab.Optimization;
    3026using HeuristicLab.Parameters;
    3127using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    4743      get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; }
    4844    }
    49 
    5045    public IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter {
    5146      get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; }
     
    5752
    5853    #region properties
    59     public DoubleValue UpperEstimationLimit {
    60       get { return UpperEstimationLimitParameter.ActualValue; }
    61     }
    62     public DoubleValue LowerEstimationLimit {
    63       get { return LowerEstimationLimitParameter.ActualValue; }
    64     }
    6554    public BoolValue ApplyLinearScaling {
    6655      get { return ApplyLinearScalingParameter.Value; }
     
    8170
    8271    protected override ISymbolicClassificationSolution CreateSolution(ISymbolicExpressionTree bestTree, double[] bestQualities) {
    83       var model = new SymbolicDiscriminantFunctionClassificationModel(bestTree, SymbolicDataAnalysisTreeInterpreter, LowerEstimationLimit.Value, UpperEstimationLimit.Value);
    84       var solution = new SymbolicDiscriminantFunctionClassificationSolution(model, ProblemData);
     72      var model = new SymbolicDiscriminantFunctionClassificationModel(bestTree, SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value);
     73      var solution = new SymbolicDiscriminantFunctionClassificationSolution(model, ProblemDataParameter.ActualValue);
    8574      if (ApplyLinearScaling.Value) {
    8675        solution.ScaleModel();
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveBoundedMeanSquaredErrorEvaluator.cs

    r5747 r5759  
    4747    public override IOperation Apply() {
    4848      IEnumerable<int> rows = GenerateRowsToEvaluate();
    49       double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, LowerEstimationLimit.Value, UpperEstimationLimit.Value, ProblemData, rows);
     49      double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, ProblemDataParameter.ActualValue, rows);
    5050      QualityParameter.ActualValue = new DoubleValue(quality);
    5151      return base.Apply();
     
    8888
    8989    public override double Evaluate(IExecutionContext context, ISymbolicExpressionTree tree, IClassificationProblemData problemData, IEnumerable<int> rows) {
    90       return Calculate(SymbolicDataAnalysisTreeInterpreter, tree, LowerEstimationLimit.Value, UpperEstimationLimit.Value, problemData, rows);
     90      return Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, problemData, rows);
    9191    }
    9292  }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveMeanSquaredErrorEvaluator.cs

    r5747 r5759  
    2626using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    28 using System;
    2928
    3029namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
     
    4746    public override IOperation Apply() {
    4847      IEnumerable<int> rows = GenerateRowsToEvaluate();
    49       double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, LowerEstimationLimit.Value, UpperEstimationLimit.Value, ProblemData, rows);
     48      double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, ProblemDataParameter.ActualValue, rows);
    5049      QualityParameter.ActualValue = new DoubleValue(quality);
    5150      return base.Apply();
     
    6463      UpperEstimationLimitParameter.ExecutionContext = context;
    6564
    66       double mse = Calculate(SymbolicDataAnalysisTreeInterpreter, tree, LowerEstimationLimit.Value, UpperEstimationLimit.Value, problemData, rows);
     65      double mse = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, problemData, rows);
    6766
    6867      SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null;
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveOverfittingAnalyzer.cs

    r5747 r5759  
    2020#endregion
    2121
    22 using System.Collections.Generic;
    2322using System.Linq;
    2423using HeuristicLab.Analysis;
     
    2625using HeuristicLab.Core;
    2726using HeuristicLab.Data;
    28 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    29 using HeuristicLab.Operators;
    3027using HeuristicLab.Optimization;
    3128using HeuristicLab.Parameters;
    3229using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    33 using HeuristicLab.Problems.DataAnalysis.Symbolic;
    34 using System;
    3530
    3631namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
     
    8176      double[] trainingQuality = QualityParameter.ActualValue.Select(x => x.Value).ToArray();
    8277      // evaluate on validation partition
    83       int start = ValidationSamplesStart.Value;
    84       int end = ValidationSamplesEnd.Value;
     78      int start = ValidationPartitionParameter.ActualValue.Start;
     79      int end = ValidationPartitionParameter.ActualValue.End;
    8580      var rows = Enumerable.Range(start, end - start);
    86       IExecutionContext childContext = (IExecutionContext)ExecutionContext.CreateChildOperation(Evaluator);
     81      IExecutionContext childContext = (IExecutionContext)ExecutionContext.CreateChildOperation(EvaluatorParameter.ActualValue);
    8782      double[] validationQuality = (from tree in SymbolicExpressionTrees
    88                                     select Evaluator.Evaluate(childContext, tree, ProblemData, rows))
     83                                    select EvaluatorParameter.ActualValue.Evaluate(childContext, tree, ProblemDataParameter.ActualValue, rows))
    8984                                   .ToArray();
    9085      double r = alglib.spearmancorr2(trainingQuality, validationQuality);
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectivePearsonRSquaredEvaluator.cs

    r5747 r5759  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
    2324using HeuristicLab.Common;
     
    2627using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2728using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    28 using System;
    2929
    3030namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
     
    4747    public override IOperation Apply() {
    4848      IEnumerable<int> rows = GenerateRowsToEvaluate();
    49       double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, LowerEstimationLimit.Value, UpperEstimationLimit.Value, ProblemData, rows);
     49      double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, ProblemDataParameter.ActualValue, rows);
    5050      QualityParameter.ActualValue = new DoubleValue(quality);
    5151      return base.Apply();
     
    6969      UpperEstimationLimitParameter.ExecutionContext = context;
    7070
    71       double r2 = Calculate(SymbolicDataAnalysisTreeInterpreter, tree, LowerEstimationLimit.Value, UpperEstimationLimit.Value, problemData, rows);
     71      double r2 = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, problemData, rows);
    7272
    7373      SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null;
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveProblem.cs

    r5747 r5759  
    7070      InitializeOperators();
    7171      UpdateEstimationLimits();
    72       UpdateDatasetPartitions();
    7372    }
    7473
     
    8180
    8281    private void UpdateEstimationLimits() {
    83       if (ProblemData.TrainingPartitionStart.Value < ProblemData.TrainingPartitionEnd.Value) {
    84         var targetValues = ProblemData.Dataset.GetVariableValues(ProblemData.TargetVariable, ProblemData.TrainingPartitionStart.Value, ProblemData.TrainingPartitionEnd.Value);
     82      if (ProblemData.TrainingPartition.Start < ProblemData.TrainingPartition.End) {
     83        var targetValues = ProblemData.Dataset.GetVariableValues(ProblemData.TargetVariable, ProblemData.TrainingPartition.Start, ProblemData.TrainingPartition.End);
    8584        var mean = targetValues.Average();
    8685        var range = targetValues.Max() - targetValues.Min();
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveValidationBestSolutionAnalyzer.cs

    r5736 r5759  
    2020#endregion
    2121
    22 using System.Collections.Generic;
    23 using System.Linq;
    2422using HeuristicLab.Common;
    2523using HeuristicLab.Core;
    2624using HeuristicLab.Data;
    2725using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    28 using HeuristicLab.Operators;
    29 using HeuristicLab.Optimization;
    3026using HeuristicLab.Parameters;
    3127using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    4743      get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; }
    4844    }
    49 
    5045    public IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter {
    5146      get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; }
    5247    }
    53 
    5448    public IValueParameter<BoolValue> ApplyLinearScalingParameter {
    5549      get { return (IValueParameter<BoolValue>)Parameters[ApplyLinearScalingParameterName]; }
     
    5852
    5953    #region properties
    60     public DoubleValue UpperEstimationLimit {
    61       get { return UpperEstimationLimitParameter.ActualValue; }
    62     }
    63     public DoubleValue LowerEstimationLimit {
    64       get { return LowerEstimationLimitParameter.ActualValue; }
    65     }
    6654    public BoolValue ApplyLinearScaling {
    6755      get { return ApplyLinearScalingParameter.Value; }
     
    8270
    8371    protected override ISymbolicClassificationSolution CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality) {
    84       var model = new SymbolicDiscriminantFunctionClassificationModel(bestTree, SymbolicDataAnalysisTreeInterpreter, LowerEstimationLimit.Value, UpperEstimationLimit.Value);
    85       var solution = new SymbolicDiscriminantFunctionClassificationSolution(model, ProblemData);
     72      var model = new SymbolicDiscriminantFunctionClassificationModel(bestTree, SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value);
     73      var solution = new SymbolicDiscriminantFunctionClassificationSolution(model, ProblemDataParameter.ActualValue);
    8674      if (ApplyLinearScaling.Value) {
    8775        solution.ScaleModel();
Note: See TracChangeset for help on using the changeset viewer.