Changeset 11202 for branches/HiveStatistics/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.cs
- Timestamp:
- 07/18/14 12:01:13 (10 years ago)
- Location:
- branches/HiveStatistics/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources
- Property svn:ignore
-
old new 8 8 FxCopResults.txt 9 9 Google.ProtocolBuffers-0.9.1.dll 10 Google.ProtocolBuffers-2.4.1.473.dll 10 11 HeuristicLab 3.3.5.1.ReSharper.user 11 12 HeuristicLab 3.3.6.0.ReSharper.user 12 13 HeuristicLab.4.5.resharper.user 13 14 HeuristicLab.ExtLibs.6.0.ReSharper.user 15 HeuristicLab.Scripting.Development 14 16 HeuristicLab.resharper.user 15 17 ProtoGen.exe … … 17 19 _ReSharper.HeuristicLab 18 20 _ReSharper.HeuristicLab 3.3 21 _ReSharper.HeuristicLab 3.3 Tests 19 22 _ReSharper.HeuristicLab.ExtLibs 20 23 bin 21 24 protoc.exe 22 _ReSharper.HeuristicLab 3.3 Tests23 Google.ProtocolBuffers-2.4.1.473.dll
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/HiveStatistics/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views
- Property svn:mergeinfo changed
-
branches/HiveStatistics/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.cs
r7259 r11202 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 21 21 22 22 using System; 23 using System.ComponentModel; 24 using System.Linq; 23 25 using System.Windows.Forms; 24 26 using HeuristicLab.MainForm; 27 using HeuristicLab.Problems.DataAnalysis.Symbolic.Views; 25 28 using HeuristicLab.Problems.DataAnalysis.Views; 26 29 … … 38 41 } 39 42 43 protected override void SetEnabledStateOfControls() { 44 base.SetEnabledStateOfControls(); 45 btnSimplify.Enabled = Content != null && !Locked && Content.ProblemData.TrainingIndices.Any(); // simplification is only possible if there are trainings samples 46 exportButton.Enabled = Content != null && !Locked; 47 transformModelButton.Visible = Content != null && Content.ProblemData.Transformations.Any(); 48 transformModelButton.Enabled = Content != null && !Locked; 49 } 50 40 51 private void btn_SimplifyModel_Click(object sender, EventArgs e) { 41 InteractiveSymbolicRegressionSolutionSimplifierViewview = new InteractiveSymbolicRegressionSolutionSimplifierView();52 var view = new InteractiveSymbolicRegressionSolutionSimplifierView(); 42 53 view.Content = (SymbolicRegressionSolution)this.Content.Clone(); 43 54 view.Show(); 44 55 } 56 57 private void exportButton_Click(object sender, EventArgs e) { 58 var exporter = new SymbolicSolutionExcelExporter(); 59 exportFileDialog.Filter = exporter.FileTypeFilter; 60 if (exportFileDialog.ShowDialog(this) == DialogResult.OK) { 61 var name = exportFileDialog.FileName; 62 using (BackgroundWorker bg = new BackgroundWorker()) { 63 MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Exporting solution to " + name + "."); 64 bg.DoWork += (o, a) => exporter.Export(Content, name); 65 bg.RunWorkerCompleted += (o, a) => MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this); 66 bg.RunWorkerAsync(); 67 } 68 } 69 } 70 71 private void transformModelButton_Click(object sender, EventArgs e) { 72 var mapper = new TransformationToSymbolicTreeMapper(); 73 var transformator = new SymbolicExpressionTreeBacktransformator(mapper); 74 75 var transformations = Content.ProblemData.Transformations; 76 var targetVar = Content.ProblemData.TargetVariable; 77 78 var transformedModel = (ISymbolicRegressionModel)transformator.Backtransform(Content.Model, transformations, targetVar); 79 var transformedSolution = new SymbolicRegressionSolution(transformedModel, (IRegressionProblemData)Content.ProblemData.Clone()); 80 81 MainFormManager.MainForm.ShowContent(transformedSolution); 82 } 45 83 } 46 84 }
Note: See TracChangeset
for help on using the changeset viewer.