Changeset 11203 for branches/HiveStatistics/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.cs
- Timestamp:
- 07/18/14 12:35:00 (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.dll11 10 HeuristicLab 3.3.5.1.ReSharper.user 12 11 HeuristicLab 3.3.6.0.ReSharper.user 13 12 HeuristicLab.4.5.resharper.user 14 13 HeuristicLab.ExtLibs.6.0.ReSharper.user 15 HeuristicLab.Scripting.Development16 14 HeuristicLab.resharper.user 17 15 ProtoGen.exe … … 19 17 _ReSharper.HeuristicLab 20 18 _ReSharper.HeuristicLab 3.3 21 _ReSharper.HeuristicLab 3.3 Tests22 19 _ReSharper.HeuristicLab.ExtLibs 23 20 bin 24 21 protoc.exe 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/HiveStatistics/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views
-
branches/HiveStatistics/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.cs
r11202 r11203 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 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;25 23 using System.Windows.Forms; 26 24 using HeuristicLab.MainForm; 27 using HeuristicLab.Problems.DataAnalysis.Symbolic.Views;28 25 using HeuristicLab.Problems.DataAnalysis.Views; 29 26 … … 41 38 } 42 39 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 samples46 exportButton.Enabled = Content != null && !Locked;47 transformModelButton.Visible = Content != null && Content.ProblemData.Transformations.Any();48 transformModelButton.Enabled = Content != null && !Locked;49 }50 51 40 private void btn_SimplifyModel_Click(object sender, EventArgs e) { 52 varview = new InteractiveSymbolicRegressionSolutionSimplifierView();41 InteractiveSymbolicRegressionSolutionSimplifierView view = new InteractiveSymbolicRegressionSolutionSimplifierView(); 53 42 view.Content = (SymbolicRegressionSolution)this.Content.Clone(); 54 43 view.Show(); 55 44 } 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 }83 45 } 84 46 }
Note: See TracChangeset
for help on using the changeset viewer.