Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/01/11 12:04:53 (14 years ago)
Author:
mkommend
Message:

#1418: worked on data analysis problem representation.

Location:
branches/DataAnalysis Refactoring
Files:
3 added
17 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/Interfaces/ISymbolicClassificationEvaluator.cs

    r5509 r5577  
    2121
    2222namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
    23   public interface ISymbolicClassificationEvaluator : IClassificationEvaluator, ISymbolicDataAnalysisEvaluator<IClassificationProblemData> {
     23  public interface ISymbolicClassificationEvaluator : ISymbolicDataAnalysisEvaluator<IClassificationProblemData> {
    2424  }
    2525}
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj

    r5557 r5577  
    109109  <ItemGroup>
    110110    <Compile Include="Interfaces\ISymbolicRegressionModel.cs" />
     111    <Compile Include="Interfaces\ISymbolicRegressionProblem.cs" />
     112    <Compile Include="Interfaces\ISymbolicRegressionSingleObjectiveProblem.cs" />
    111113    <Compile Include="Interfaces\ISymbolicRegressionSolution.cs" />
    112114    <Compile Include="Interfaces\ISymbolicRegressionEvaluator.cs" />
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/Interfaces/ISymbolicRegressionEvaluator.cs

    r5509 r5577  
    2222
    2323namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression {
    24   public interface ISymbolicRegressionEvaluator : IRegressionEvaluator, ISymbolicDataAnalysisEvaluator<IRegressionProblemData> {
     24  public interface ISymbolicRegressionEvaluator : ISymbolicDataAnalysisEvaluator<IRegressionProblemData> {
    2525  }
    2626}
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj

    r5574 r5577  
    125125    <Compile Include="SymbolicDataAnalysisExpressionTreeInterpreter.cs" />
    126126    <Compile Include="SymbolicDataAnalysisExpressionTreeSimplifier.cs" />
     127    <Compile Include="SymbolicDataAnalysisProblem.cs" />
    127128    <Compile Include="Symbols\Addition.cs" />
    128129    <Compile Include="Symbols\And.cs" />
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisBoundedEvaluator.cs

    r5509 r5577  
    2525namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    2626  public interface ISymbolicDataAnalysisBoundedEvaluator<T> : ISymbolicDataAnalysisEvaluator<T>
    27    where T : class, IDataAnalysisProblemData {
     27  where T : class,IDataAnalysisProblemData {
    2828    IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter { get; }
    2929    IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter { get; }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisEvaluator.cs

    r5514 r5577  
    2222using HeuristicLab.Data;
    2323using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     24using HeuristicLab.Optimization;
    2425namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    25   public interface ISymbolicDataAnalysisEvaluator<T> : IDataAnalysisEvaluator<T>
    26    where T : class, IDataAnalysisProblemData {
     26  public interface ISymbolicDataAnalysisEvaluator<T> : IEvaluator
     27  where T : class,IDataAnalysisProblemData {
    2728    ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter { get; }
    2829    IValueLookupParameter<IntValue> SamplesStartParameter { get; }
    2930    IValueLookupParameter<IntValue> SamplesEndParameter { get; }
     31
     32    IValueLookupParameter<T> ProblemDataParameter { get; }
     33    T ProblemData { get; }
    3034  }
    3135}
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisMultiObjectiveEvaluator.cs

    r5509 r5577  
    2626namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    2727  public interface ISymbolicDataAnalysisMultiObjectiveEvaluator<T> : ISymbolicDataAnalysisEvaluator<T>, IMultiObjectiveEvaluator
    28    where T : class, IDataAnalysisProblemData {
     28  where T : class,IDataAnalysisProblemData {
    2929    IEnumerable<bool> Maximization { get; }
    3030  }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisProblem.cs

    r5514 r5577  
    2020#endregion
    2121
     22using HeuristicLab.Optimization;
    2223namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    23   public interface ISymbolicDataAnalysisProblem<T> : IDataAnalysisProblem<T>
    24   where T : class, IDataAnalysisProblemData {
    25     ISymbolicDataAnalysisGrammar Grammar { get; }
    26     new ISymbolicDataAnalysisEvaluator<T> Evaluator { get; }
    27     new ISymbolicDataAnalysisSolutionCreator<T> SolutionCreator { get; }
     24  public interface ISymbolicDataAnalysisProblem : IDataAnalysisProblem, IProblem {
     25    ISymbolicDataAnalysisGrammar SymbolicExpressionTreeGrammar { get; }
    2826  }
    2927}
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisSingleObjectiveEvaluator.cs

    r5509 r5577  
    2424namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    2525  public interface ISymbolicDataAnalysisSingleObjectiveEvaluator<T> : ISymbolicDataAnalysisEvaluator<T>, ISingleObjectiveEvaluator
    26    where T : class, IDataAnalysisProblemData {
     26    where T : class,IDataAnalysisProblemData {
    2727    bool Maximization { get; }
    2828  }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisSolutionCreator.cs

    r5509 r5577  
    2020#endregion
    2121
     22using HeuristicLab.Core;
    2223using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     24using HeuristicLab.Optimization;
    2325namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    24   public interface ISymbolicDataAnalysisSolutionCreator<T> : ISymbolicExpressionTreeCreator, IDataAnalysisSolutionCreator<T>
    25   where T : class, IDataAnalysisProblemData {
     26  public interface ISymbolicDataAnalysisSolutionCreator : ISymbolicExpressionTreeCreator, ISolutionCreator {
     27    IParameter ProblemDataParameter { get; }
     28    IDataAnalysisProblemData ProblemData { get; }
    2629  }
    2730}
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisValidatingAnalyzer.cs

    r5553 r5577  
    2121using HeuristicLab.Core;
    2222using HeuristicLab.Data;
    23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    24 using HeuristicLab.Optimization;
    2523namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    26   public interface ISymbolicDataAnalysisValidatingAnalyzer<T> : ISymbolicDataAnalysisAnalyzer where T : class, IDataAnalysisProblemData {
    27     ILookupParameter<ISymbolicDataAnalysisEvaluator<T>> EvaluatorParameter { get; }
     24  public interface ISymbolicDataAnalysisValidatingAnalyzer<T, U> : ISymbolicDataAnalysisAnalyzer
     25    where T : class,ISymbolicDataAnalysisEvaluator<U>
     26    where U : class, IDataAnalysisProblemData {
     27    ILookupParameter<T> EvaluatorParameter { get; }
    2828    IValueLookupParameter<IntValue> ValidationSamplesStartParameter { get; }
    2929    IValueLookupParameter<IntValue> ValidationSamplesEndParameter { get; }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClassificationProblem.cs

    r5561 r5577  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    2523using HeuristicLab.Common;
    2624using HeuristicLab.Core;
    27 using HeuristicLab.Data;
     25using HeuristicLab.Parameters;
    2826using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    29 using HeuristicLab.Optimization;
    30 using HeuristicLab.Parameters;
    3127
    3228namespace HeuristicLab.Problems.DataAnalysis {
    3329  [StorableClass]
    34   [Item("RegressionProblem", "")]
     30  [Item("ClassificationProblem", "")]
    3531  [Creatable]
    36   public class RegressionProblem : DataAnalysisProblem<IRegressionProblemData>,
    37     IRegressionProblem {
     32  public class ClassificationProblem : DataAnalysisProblem<IClassificationProblemData>,
     33    IClassificationProblem {
    3834    private const string ProblemDataParameterName = "ProblemData";
    39     #region properties
    40     public new IDataAnalysisEvaluator<IRegressionProblemData> Evaluator {
    41       get { throw new NotImplementedException(); }
    42     }
    43 
    44     public new IRegressionSolutionCreator SolutionCreator {
    45       get { throw new NotImplementedException(); }
    46     }
    47     IDataAnalysisSolutionCreator<IRegressionProblemData> IDataAnalysisProblem<IRegressionProblemData>.SolutionCreator {
    48       get { throw new NotImplementedException(); }
    49     }
    50     #endregion
    51 
    52     public RegressionProblem(RegressionProblem original, Cloner cloner)
     35    public ClassificationProblem(ClassificationProblem original, Cloner cloner)
    5336      : base(original, cloner) {
    5437      RegisterEventHandlers();
    5538    }
    5639    [StorableConstructor]
    57     public RegressionProblem(bool deserializing) : base(deserializing) { }
    58     public RegressionProblem()
     40    public ClassificationProblem(bool deserializing) : base(deserializing) { }
     41    public ClassificationProblem()
    5942      : base() {
    60       Parameters.Add(new ValueParameter<IRegressionProblemData>(ProblemDataParameterName, "", new RegressionProblemData()));
     43      Parameters.Add(new ValueParameter<IClassificationProblemData>(ProblemDataParameterName, "", new ClassificationProblemData()));
    6144      RegisterEventHandlers();
    6245    }
     
    6851
    6952    public override IDeepCloneable Clone(Cloner cloner) {
    70       return new RegressionProblem(this, cloner);
     53      return new ClassificationProblem(this, cloner);
    7154    }
    7255
     
    7760    #region event propagation
    7861    private void Value_Changed(object sender, EventArgs e) {
    79       OnReset();
     62      //OnReset();
    8063    }
    8164    #endregion
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DataAnalysisProblem.cs

    r5554 r5577  
    2020#endregion
    2121
     22using System;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    24 using HeuristicLab.Optimization;
     25using HeuristicLab.Parameters;
    2526using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2627
    2728namespace HeuristicLab.Problems.DataAnalysis {
    2829  [StorableClass]
    29   public abstract class DataAnalysisProblem<T> : Problem<IDataAnalysisEvaluator<T>, IDataAnalysisSolutionCreator<T>>,
     30  public abstract class DataAnalysisProblem<T> : ParameterizedNamedItem,
    3031    IDataAnalysisProblem<T>
    3132    where T : class, IDataAnalysisProblemData {
    3233    private const string ProblemDataParameterName = "ProblemData";
     34    private const string ProblemDataParameterDescription = "";
    3335    #region parameter properties
    3436    IParameter IDataAnalysisProblem.ProblemDataParameter {
     
    5456    public DataAnalysisProblem()
    5557      : base() {
     58      Parameters.Add(new ValueParameter<T>(ProblemDataParameterName, ProblemDataParameterDescription));
     59    }
     60
     61    private void RegisterEventHandlers() {
     62      ProblemDataParameter.Value.Changed += new EventHandler(ProblemDataParameter_ValueChanged);
     63    }
     64    private void ProblemDataParameter_ValueChanged(object sender, EventArgs e) {
     65      OnProblemDataChanged();
     66      OnReset();
     67    }
     68
     69    public event EventHandler ProblemDataChanged;
     70    protected virtual void OnProblemDataChanged() {
     71      var handler = ProblemDataChanged;
     72      if (handler != null) handler(this, EventArgs.Empty);
     73    }
     74
     75    public event EventHandler Reset;
     76    protected virtual void OnReset() {
     77      var handler = Reset;
     78      if (handler != null) handler(this, EventArgs.Empty);
    5679    }
    5780  }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj

    r5559 r5577  
    109109  <ItemGroup>
    110110    <Compile Include="ClassificationProblemData.cs" />
     111    <Compile Include="ClassificationProblem.cs" />
    111112    <Compile Include="RegressionProblemData.cs" />
    112113    <Compile Include="DataAnalysisProblemData.cs" />
     
    114115    <Compile Include="DataAnalysisProblem.cs" />
    115116    <Compile Include="Dataset.cs" />
    116     <Compile Include="Interfaces\Classification\IClassificationEvaluator.cs" />
    117117    <Compile Include="Interfaces\Classification\IClassificationModel.cs" />
    118118    <Compile Include="Interfaces\Classification\IClassificationProblem.cs" />
    119119    <Compile Include="Interfaces\Classification\IClassificationProblemData.cs" />
    120120    <Compile Include="Interfaces\Classification\IClassificationSolution.cs" />
    121     <Compile Include="Interfaces\Classification\IClassificationSolutionCreator.cs" />
    122     <Compile Include="Interfaces\IDataAnalysisEvaluator.cs" />
    123121    <Compile Include="Interfaces\IDataAnalysisProblemData.cs" />
    124122    <Compile Include="Interfaces\IDataAnalysisSolution.cs" />
    125     <Compile Include="Interfaces\IDataAnalysisSolutionCreator.cs" />
    126123    <Compile Include="Interfaces\IOnlineEvaluator.cs" />
    127     <Compile Include="Interfaces\Regression\IRegressionEvaluator.cs" />
    128124    <Compile Include="Interfaces\Regression\IRegressionModel.cs" />
    129125    <Compile Include="Interfaces\Regression\IRegressionProblem.cs" />
    130126    <Compile Include="Interfaces\Regression\IRegressionProblemData.cs" />
    131127    <Compile Include="Interfaces\Regression\IRegressionSolution.cs" />
    132     <Compile Include="Interfaces\Regression\IRegressionSolutionCreator.cs" />
    133128    <Compile Include="OnlineEvaluators\OnlineCovarianceEvaluator.cs" />
    134129    <Compile Include="OnlineEvaluators\OnlineMeanAbsolutePercentageErrorEvaluator.cs" />
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IClassificationProblem.cs

    r5509 r5577  
    2222namespace HeuristicLab.Problems.DataAnalysis {
    2323  public interface IClassificationProblem : IDataAnalysisProblem<IClassificationProblemData> {
    24     new IClassificationSolutionCreator SolutionCreator { get; }
    2524  }
    2625}
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblem.cs

    r5554 r5577  
    2020#endregion
    2121
     22using System;
    2223using HeuristicLab.Core;
    23 using HeuristicLab.Optimization;
    2424
    2525namespace HeuristicLab.Problems.DataAnalysis {
    26   public interface IDataAnalysisProblem : IProblem {
     26  public interface IDataAnalysisProblem : IItem {
    2727    IParameter ProblemDataParameter { get; }
    2828    IDataAnalysisProblemData ProblemData { get; }
     29    event EventHandler ProblemDataChanged;
    2930  }
    3031
     
    3334    new IValueParameter<T> ProblemDataParameter { get; }
    3435    new T ProblemData { get; }
    35     new IDataAnalysisEvaluator<T> Evaluator { get; }
    36     new IDataAnalysisSolutionCreator<T> SolutionCreator { get; }
    3736  }
    3837}
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionProblem.cs

    r5509 r5577  
    2222namespace HeuristicLab.Problems.DataAnalysis {
    2323  public interface IRegressionProblem : IDataAnalysisProblem<IRegressionProblemData> {
    24     new IRegressionSolutionCreator SolutionCreator { get; }
    2524  }
    2625}
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/RegressionProblem.cs

    r5540 r5577  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    2522using HeuristicLab.Common;
    2623using HeuristicLab.Core;
    27 using HeuristicLab.Data;
    2824using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    29 using HeuristicLab.Optimization;
    30 using HeuristicLab.Parameters;
    3125
    3226namespace HeuristicLab.Problems.DataAnalysis {
     
    3630  public class RegressionProblem : DataAnalysisProblem<IRegressionProblemData>,
    3731    IRegressionProblem {
    38     private const string ProblemDataParameterName = "ProblemData";
    39     #region properties
    40     public new IDataAnalysisEvaluator<IRegressionProblemData> Evaluator {
    41       get { throw new NotImplementedException(); }
    42     }
    43 
    44     public new IRegressionSolutionCreator SolutionCreator {
    45       get { throw new NotImplementedException(); }
    46     }
    47     IDataAnalysisSolutionCreator<IRegressionProblemData> IDataAnalysisProblem<IRegressionProblemData>.SolutionCreator {
    48       get { throw new NotImplementedException(); }
    49     }
    50     #endregion
    51 
    5232    public RegressionProblem(RegressionProblem original, Cloner cloner)
    5333      : base(original, cloner) {
    54       RegisterEventHandlers();
    5534    }
    5635    [StorableConstructor]
     
    5837    public RegressionProblem()
    5938      : base() {
    60       Parameters.Add(new ValueParameter<IRegressionProblemData>(ProblemDataParameterName, "", new RegressionProblemData()));
    61       RegisterEventHandlers();
    6239    }
    6340
    6441    [StorableHook(HookType.AfterDeserialization)]
    6542    private void AfterDeserialization() {
    66       RegisterEventHandlers();
    6743    }
    6844
     
    7046      return new RegressionProblem(this, cloner);
    7147    }
    72 
    73     private void RegisterEventHandlers() {
    74       ProblemDataParameter.Value.Changed += new EventHandler(Value_Changed);
    75     }
    76 
    77     #region event propagation
    78     private void Value_Changed(object sender, EventArgs e) {
    79       OnReset();
    80     }
    81     #endregion
    8248  }
    8349}
Note: See TracChangeset for help on using the changeset viewer.