Free cookie consent management tool by TermsFeed Policy Generator

Changeset 10673


Ignore:
Timestamp:
03/26/14 16:37:02 (11 years ago)
Author:
pfleck
Message:
  • Preprocessing Plugin now uses ISymbolicDataAnalysisProblem instead of IDataAnalysisProblem
  • Added TransformationCollection to ISymbolicDataAnalysisProblem as hidden parameter
Location:
branches/DataPreprocessing
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/DataPreprocessorStarter.cs

    r10559 r10673  
    2626using HeuristicLab.Optimization;
    2727using HeuristicLab.Problems.DataAnalysis;
     28using HeuristicLab.Problems.DataAnalysis.Symbolic;
    2829using HeuristicLab.Problems.DataAnalysis.Views;
    2930using View = HeuristicLab.MainForm.WindowsForms.View;
     
    3435    public void Start(IDataAnalysisProblemData problemData, View currentView) {
    3536      IAlgorithm algorithm;
    36       IDataAnalysisProblem problem;
     37      ISymbolicDataAnalysisProblem problem;
    3738      IItem parentItem = GetMostOuterContent(currentView, out algorithm, out problem);
    3839      var context = new PreprocessingContext(problemData, algorithm, problem);
     
    4041    }
    4142
    42     private IItem GetMostOuterContent(Control control, out IAlgorithm algorithm, out IDataAnalysisProblem problem) {
     43    private IItem GetMostOuterContent(Control control, out IAlgorithm algorithm, out ISymbolicDataAnalysisProblem problem) {
    4344      algorithm = null;
    4445      problem = null;
     
    5152            algorithm = (IAlgorithm)itemView.Content;
    5253          }
    53           if (itemView.Content is IDataAnalysisProblem) {
    54             problem = (IDataAnalysisProblem)itemView.Content;
     54          if (itemView.Content is ISymbolicDataAnalysisProblem) {
     55            problem = (ISymbolicDataAnalysisProblem)itemView.Content;
    5556          }
    5657        }
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/HeuristicLab.DataPreprocessing.Views-3.3.csproj

    r10667 r10673  
    214214      <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
    215215    </ProjectReference>
     216    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
     217      <Project>{3d28463f-ec96-4d82-afee-38be91a0ca00}</Project>
     218      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>
     219    </ProjectReference>
    216220    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Views\3.4\HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj">
    217221      <Project>{3E9E8944-44FF-40BB-A622-3A4A7DD0F198}</Project>
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/Plugin.cs.frame

    r10583 r10673  
    3434  [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
    3535  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Views","3.4")]
     36  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic", "3.4")]
    3637  public class HeuristicLabDataPreprocessingPlugin : PluginBase {
    3738  }
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/HeuristicLab.DataPreprocessing-3.3.csproj

    r10671 r10673  
    160160      <Private>False</Private>
    161161    </ProjectReference>
     162    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
     163      <Project>{3d28463f-ec96-4d82-afee-38be91a0ca00}</Project>
     164      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>
     165    </ProjectReference>
    162166    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj">
    163167      <Project>{df87c13e-a889-46ff-8153-66dcaa8c5674}</Project>
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingContext.cs

    r10617 r10673  
    2323using HeuristicLab.Common;
    2424using HeuristicLab.Core;
     25using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2526using HeuristicLab.Optimization;
    2627using HeuristicLab.Problems.DataAnalysis;
     28using HeuristicLab.Problems.DataAnalysis.Symbolic;
    2729
    2830namespace HeuristicLab.DataPreprocessing {
     
    3739    public IAlgorithm Algorithm { get; private set; }
    3840
    39     public IDataAnalysisProblem Problem { get; private set; }
     41    public ISymbolicDataAnalysisProblem Problem { get; private set; }
    4042
    41     public PreprocessingContext(IDataAnalysisProblemData dataAnalysisProblemData, IAlgorithm algorithm, IDataAnalysisProblem problem) {
     43    public PreprocessingContext(IDataAnalysisProblemData dataAnalysisProblemData, IAlgorithm algorithm, ISymbolicDataAnalysisProblem problem) {
    4244      Data = new TransactionalPreprocessingData(dataAnalysisProblemData);
    4345      DataAnalysisProblemData = dataAnalysisProblemData;
     
    7274    }
    7375
    74     private IDataAnalysisProblem SetupProblem(IProblem problem) {
    75       return (IDataAnalysisProblem)problem;
     76    private ISymbolicDataAnalysisProblem SetupProblem(IProblem problem) {
     77      return (ISymbolicDataAnalysisProblem)problem;
    7678    }
    77     private IDataAnalysisProblem SetupAlgorithm(IAlgorithm algorithm) {
     79    private ISymbolicDataAnalysisProblem SetupAlgorithm(IAlgorithm algorithm) {
    7880      algorithm.Name = algorithm.Name + "(Preprocessed)";
    7981      algorithm.Runs.Clear();
    80       return (IDataAnalysisProblem)algorithm.Problem;
     82      return (ISymbolicDataAnalysisProblem)algorithm.Problem;
    8183    }
    82     private T Export<T>(T original, Func<T, IDataAnalysisProblem> setup)
     84    private T Export<T>(T original, Func<T, ISymbolicDataAnalysisProblem> setup)
    8385        where T : IItem {
    8486      var creator = new ProblemDataCreator(this);
     
    9193      problem.Name = "Preprocessed " + problem.Name;
    9294
     95      var tree = new SymbolicExpressionTree(new ProgramRootSymbol().CreateTreeNode());
     96      var variableNode = (VariableTreeNode)new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable("dummy", "dummy description").CreateTreeNode();
     97      variableNode.VariableName = "dummy";
     98      tree.Root.AddSubtree(variableNode);
     99
     100      problem.TransformationsParameter.Value.Add(tree);
     101
    93102      return clone;
    94103    }
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IPreprocessingContext.cs

    r10617 r10673  
    2424using HeuristicLab.Optimization;
    2525using HeuristicLab.Problems.DataAnalysis;
     26using HeuristicLab.Problems.DataAnalysis.Symbolic;
    2627
    2728namespace HeuristicLab.DataPreprocessing {
     
    3637    IAlgorithm Algorithm { get; }
    3738
    38     IDataAnalysisProblem Problem { get; }
     39    ISymbolicDataAnalysisProblem Problem { get; }
    3940
    4041    IItem ExportAlgorithmOrProblem();
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Plugin.cs.frame

    r10671 r10673  
    4141  [PluginDependency("HeuristicLab.Problems.DataAnalysis","3.4")]
    4242  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Views","3.4")]
    43   [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding","3.4")]
    44   [PluginDependency("HeuristicLab.Parameters","3.4")]
     43  [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "3.4")]
     44  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic", "3.4")]
     45  [PluginDependency("HeuristicLab.Parameters","3.3")]
    4546  public class HeuristicLabDataPreprocessingPlugin : PluginBase {
    4647  }
  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj

    r10538 r10673  
    221221    <Compile Include="Symbols\VariableConditionTreeNode.cs" />
    222222    <Compile Include="Symbols\VariableTreeNode.cs" />
     223    <Compile Include="TransformationCollection.cs" />
    223224    <None Include="HeuristicLab.snk" />
    224225    <None Include="Plugin.cs.frame" />
  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisProblem.cs

    r9456 r10673  
    3535    IFixedValueParameter<IntRange> FitnessCalculationPartitionParameter { get; }
    3636    IFixedValueParameter<IntRange> ValidationPartitionParameter { get; }
     37    IFixedValueParameter<TransformationCollection> TransformationsParameter { get; }
    3738
    3839    ISymbolicDataAnalysisGrammar SymbolicExpressionTreeGrammar { get; set; }
  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs

    r9830 r10673  
    5454    private const string ValidationPartitionParameterName = "ValidationPartition";
    5555    private const string ApplyLinearScalingParameterName = "ApplyLinearScaling";
     56    private const string TransformationsParameterName = "Transformations";
    5657
    5758    private const string ProblemDataParameterDescription = "";
     
    6667    private const string ValidationPartitionParameterDescription = "The partition of the problem data training partition, that should be used to select the best model from (optional).";
    6768    private const string ApplyLinearScalingParameterDescription = "Flag that indicates if the individual should be linearly scaled before evaluating.";
     69    private const string TransformationsParameterDescrioption = "The transformations which were applied on the input variables.";
    6870    #endregion
    6971
     
    104106    public IFixedValueParameter<BoolValue> ApplyLinearScalingParameter {
    105107      get { return (IFixedValueParameter<BoolValue>)Parameters[ApplyLinearScalingParameterName]; }
     108    }
     109    public IFixedValueParameter<TransformationCollection> TransformationsParameter {
     110      get { return (IFixedValueParameter<TransformationCollection>)Parameters[TransformationsParameterName]; }
    106111    }
    107112    #endregion
     
    167172        if (GetType().Name.Contains("SymbolicRegression"))
    168173          ApplyLinearScaling.Value = true;
     174      }
     175
     176      if (!Parameters.ContainsKey(TransformationsParameterName)) {
     177        Parameters.Add(new FixedValueParameter<TransformationCollection>(TransformationsParameterName, TransformationsParameterDescrioption, new TransformationCollection()));
     178        TransformationsParameter.Hidden = true;
    169179      }
    170180
     
    189199      Parameters.Add(new FixedValueParameter<PercentValue>(RelativeNumberOfEvaluatedSamplesParameterName, RelativeNumberOfEvaluatedSamplesParameterDescription, new PercentValue(1)));
    190200      Parameters.Add(new FixedValueParameter<BoolValue>(ApplyLinearScalingParameterName, ApplyLinearScalingParameterDescription, new BoolValue(false)));
     201      Parameters.Add(new FixedValueParameter<TransformationCollection>(TransformationsParameterName, TransformationsParameterDescrioption, new TransformationCollection()));
    191202
    192203      SymbolicExpressionTreeInterpreterParameter.Hidden = true;
     
    194205      MaximumFunctionDefinitionsParameter.Hidden = true;
    195206      ApplyLinearScalingParameter.Hidden = true;
     207      TransformationsParameter.Hidden = true;
    196208
    197209      SymbolicExpressionTreeGrammar = new TypeCoherentExpressionGrammar();
Note: See TracChangeset for help on using the changeset viewer.