Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11011


Ignore:
Timestamp:
06/12/14 14:14:33 (10 years ago)
Author:
pfleck
Message:
  • Cloned Model before backtransformation.
  • Set new Model instead of whole Solution after backtransformation.
Location:
branches/DataPreprocessing
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.cs

    r11009 r11011  
    4848
    4949    private void btn_SimplifyModel_Click(object sender, EventArgs e) {
    50       InteractiveSymbolicRegressionSolutionSimplifierView view = new InteractiveSymbolicRegressionSolutionSimplifierView();
     50      var view = new InteractiveSymbolicRegressionSolutionSimplifierView();
    5151      view.Content = (SymbolicRegressionSolution)this.Content.Clone();
    5252      view.Show();
     
    7070      var mapper = new TransformationToSymbolicTreeMapper();
    7171      var transformator = new SymbolicExpressionTreeBacktransformator(mapper);
     72
    7273      var transformations = Content.ProblemData.Transformations;
    7374      var targetVar = Content.ProblemData.TargetVariable;
    74       transformator.Backtransform(Content.Model, transformations, targetVar);
    75       // TODO: cloning is needed for refreshing the view, find a better approach for this.
    76       Content = (SymbolicRegressionSolution)Content.Clone();
     75      var newModel = transformator.Backtransform(Content.Model, transformations, targetVar);
     76      Content.Model = (ISymbolicRegressionModel)newModel;
     77
    7778      MessageBox.Show(this, "Backtransformation successful.");
    7879    }
  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicExpressionTreeBacktransformator.cs

    r10980 r11011  
    3434    }
    3535
    36     public void Backtransform(IDataAnalysisModel model, IEnumerable<ITransformation> transformations, string targetVariable) {
    37       var symbolicModel = (ISymbolicDataAnalysisModel)model;
     36    public IDataAnalysisModel Backtransform(IDataAnalysisModel model, IEnumerable<ITransformation> transformations, string targetVariable) {
     37      var symbolicModel = (ISymbolicDataAnalysisModel)model.Clone();
    3838
    3939      foreach (var transformation in transformations.Reverse()) {
    4040        ApplyBacktransformation(transformation, symbolicModel.SymbolicExpressionTree, targetVariable);
    4141      }
     42
     43      return symbolicModel;
    4244    }
    4345
  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IModelBacktransformator.cs

    r10880 r11011  
    2525namespace HeuristicLab.Problems.DataAnalysis {
    2626  public interface IModelBacktransformator {
    27     void Backtransform(IDataAnalysisModel model, IEnumerable<ITransformation> transformations, string targetVariable);
     27    IDataAnalysisModel Backtransform(IDataAnalysisModel model, IEnumerable<ITransformation> transformations, string targetVariable);
    2828  }
    2929}
Note: See TracChangeset for help on using the changeset viewer.