Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/27/14 12:49:33 (10 years ago)
Author:
pfleck
Message:
  • Data preprocessor now works with all types of data analysis problems. Only in case of a symbolic data analysis problem the inverse transformation information is added.
Location:
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingContext.cs

    r10673 r10676  
    2727using HeuristicLab.Problems.DataAnalysis;
    2828using HeuristicLab.Problems.DataAnalysis.Symbolic;
     29using Variable = HeuristicLab.Problems.DataAnalysis.Symbolic.Variable;
    2930
    3031namespace HeuristicLab.DataPreprocessing {
     
    3940    public IAlgorithm Algorithm { get; private set; }
    4041
    41     public ISymbolicDataAnalysisProblem Problem { get; private set; }
     42    public IDataAnalysisProblem Problem { get; private set; }
    4243
    43     public PreprocessingContext(IDataAnalysisProblemData dataAnalysisProblemData, IAlgorithm algorithm, ISymbolicDataAnalysisProblem problem) {
     44    public PreprocessingContext(IDataAnalysisProblemData dataAnalysisProblemData, IAlgorithm algorithm, IDataAnalysisProblem problem) {
    4445      Data = new TransactionalPreprocessingData(dataAnalysisProblemData);
    4546      DataAnalysisProblemData = dataAnalysisProblemData;
     
    6364      if (Algorithm != null) {
    6465        return ExportAlgorithm();
    65       } else {
    66         return ExportProblem();
    6766      }
     67      return ExportProblem();
    6868    }
     69
    6970    public IProblem ExportProblem() {
    7071      return Export(Problem, SetupProblem);
     
    7475    }
    7576
    76     private ISymbolicDataAnalysisProblem SetupProblem(IProblem problem) {
    77       return (ISymbolicDataAnalysisProblem)problem;
     77    private IDataAnalysisProblem SetupProblem(IProblem problem) {
     78      return (IDataAnalysisProblem)problem;
    7879    }
    79     private ISymbolicDataAnalysisProblem SetupAlgorithm(IAlgorithm algorithm) {
     80    private IDataAnalysisProblem SetupAlgorithm(IAlgorithm algorithm) {
    8081      algorithm.Name = algorithm.Name + "(Preprocessed)";
    8182      algorithm.Runs.Clear();
    82       return (ISymbolicDataAnalysisProblem)algorithm.Problem;
     83      return (IDataAnalysisProblem)algorithm.Problem;
    8384    }
    84     private T Export<T>(T original, Func<T, ISymbolicDataAnalysisProblem> setup)
     85    private T Export<T>(T original, Func<T, IDataAnalysisProblem> setup)
    8586        where T : IItem {
    8687      var creator = new ProblemDataCreator(this);
     
    9394      problem.Name = "Preprocessed " + problem.Name;
    9495
    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);
     96      var symbolicProblem = problem as ISymbolicDataAnalysisProblem;
     97      if (symbolicProblem != null) {
     98        var tree = new SymbolicExpressionTree(new ProgramRootSymbol().CreateTreeNode());
     99        var variableNode = (VariableTreeNode)new Variable("dummy", "dummy description").CreateTreeNode();
     100        variableNode.VariableName = "dummy";
     101        tree.Root.AddSubtree(variableNode);
    99102
    100       problem.TransformationsParameter.Value.Add(tree);
     103        symbolicProblem.TransformationsParameter.Value.Add(tree);
     104      }
    101105
    102106      return clone;
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IPreprocessingContext.cs

    r10673 r10676  
    2424using HeuristicLab.Optimization;
    2525using HeuristicLab.Problems.DataAnalysis;
    26 using HeuristicLab.Problems.DataAnalysis.Symbolic;
    2726
    2827namespace HeuristicLab.DataPreprocessing {
     
    3736    IAlgorithm Algorithm { get; }
    3837
    39     ISymbolicDataAnalysisProblem Problem { get; }
     38    IDataAnalysisProblem Problem { get; }
    4039
    4140    IItem ExportAlgorithmOrProblem();
Note: See TracChangeset for help on using the changeset viewer.