- Timestamp:
- 06/12/14 14:14:33 (10 years ago)
- Location:
- branches/DataPreprocessing
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.cs
r11009 r11011 48 48 49 49 private void btn_SimplifyModel_Click(object sender, EventArgs e) { 50 InteractiveSymbolicRegressionSolutionSimplifierViewview = new InteractiveSymbolicRegressionSolutionSimplifierView();50 var view = new InteractiveSymbolicRegressionSolutionSimplifierView(); 51 51 view.Content = (SymbolicRegressionSolution)this.Content.Clone(); 52 52 view.Show(); … … 70 70 var mapper = new TransformationToSymbolicTreeMapper(); 71 71 var transformator = new SymbolicExpressionTreeBacktransformator(mapper); 72 72 73 var transformations = Content.ProblemData.Transformations; 73 74 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 77 78 MessageBox.Show(this, "Backtransformation successful."); 78 79 } -
branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicExpressionTreeBacktransformator.cs
r10980 r11011 34 34 } 35 35 36 public voidBacktransform(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(); 38 38 39 39 foreach (var transformation in transformations.Reverse()) { 40 40 ApplyBacktransformation(transformation, symbolicModel.SymbolicExpressionTree, targetVariable); 41 41 } 42 43 return symbolicModel; 42 44 } 43 45 -
branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IModelBacktransformator.cs
r10880 r11011 25 25 namespace HeuristicLab.Problems.DataAnalysis { 26 26 public interface IModelBacktransformator { 27 voidBacktransform(IDataAnalysisModel model, IEnumerable<ITransformation> transformations, string targetVariable);27 IDataAnalysisModel Backtransform(IDataAnalysisModel model, IEnumerable<ITransformation> transformations, string targetVariable); 28 28 } 29 29 }
Note: See TracChangeset
for help on using the changeset viewer.