Changeset 5663 for branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression
- Timestamp:
- 03/10/11 14:41:17 (14 years ago)
- Location:
- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression
- Files:
-
- 1 added
- 6 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionEstimatedValuesView.Designer.cs
r5642 r5663 20 20 #endregion 21 21 namespace HeuristicLab.Problems.DataAnalysis.Views { 22 partial class EstimatedValuesView {22 partial class RegressionSolutionEstimatedValuesView { 23 23 /// <summary> 24 24 /// Required designer variable. -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionEstimatedValuesView.cs
r5642 r5663 28 28 29 29 namespace HeuristicLab.Problems.DataAnalysis.Views { 30 [View(" Estimated Values View")]31 [Content(typeof( DataAnalysisSolution))]32 public partial class EstimatedValuesView : AsynchronousContentView {30 [View("Regression solution estimated values view")] 31 [Content(typeof(IRegressionSolution))] 32 public partial class RegressionSolutionEstimatedValuesView : AsynchronousContentView { 33 33 private const string TARGETVARIABLE_SERIES_NAME = "TargetVariable"; 34 34 private const string ESTIMATEDVALUES_SERIES_NAME = "EstimatedValues"; 35 35 36 public new DataAnalysisSolution Content {37 get { return ( DataAnalysisSolution)base.Content; }36 public new IRegressionSolution Content { 37 get { return (IRegressionSolution)base.Content; } 38 38 set { 39 39 base.Content = value; … … 43 43 private StringConvertibleMatrixView matrixView; 44 44 45 public EstimatedValuesView()45 public RegressionSolutionEstimatedValuesView() 46 46 : base() { 47 47 InitializeComponent(); … … 56 56 protected override void RegisterContentEvents() { 57 57 base.RegisterContentEvents(); 58 Content. EstimatedValuesChanged += new EventHandler(Content_EstimatedValuesChanged);58 Content.ModelChanged += new EventHandler(Content_ModelChanged); 59 59 Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged); 60 60 } … … 62 62 protected override void DeregisterContentEvents() { 63 63 base.DeregisterContentEvents(); 64 Content. EstimatedValuesChanged -= new EventHandler(Content_EstimatedValuesChanged);64 Content.ModelChanged -= new EventHandler(Content_ModelChanged); 65 65 Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged); 66 66 } 67 67 68 void Content_ProblemDataChanged(object sender, EventArgs e) {68 private void Content_ProblemDataChanged(object sender, EventArgs e) { 69 69 OnContentChanged(); 70 70 } 71 71 72 void Content_EstimatedValuesChanged(object sender, EventArgs e) {72 private void Content_ModelChanged(object sender, EventArgs e) { 73 73 OnContentChanged(); 74 74 } … … 86 86 double[,] values = new double[Content.ProblemData.Dataset.Rows, 4]; 87 87 88 double[] target = Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable .Value);88 double[] target = Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable); 89 89 double[] estimated = Content.EstimatedValues.ToArray(); 90 90 for (int row = 0; row < target.Length; row++) { … … 96 96 97 97 matrix = new DoubleMatrix(values); 98 matrix.ColumnNames = new string[] { "Original", "Estimated", "Error", "Rel.Error" };98 matrix.ColumnNames = new string[] { TARGETVARIABLE_SERIES_NAME, ESTIMATEDVALUES_SERIES_NAME, "Absolute Error", "Relative Error" }; 99 99 } 100 100 matrixView.Content = matrix; -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionLineChartView.Designer.cs
r5642 r5663 20 20 #endregion 21 21 namespace HeuristicLab.Problems.DataAnalysis.Views { 22 partial class LineChartView {22 partial class RegressionSolutionLineChartView { 23 23 /// <summary> 24 24 /// Required designer variable. -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionLineChartView.cs
r5642 r5663 28 28 29 29 namespace HeuristicLab.Problems.DataAnalysis.Views { 30 [View(" Line Chart View")]31 [Content(typeof( DataAnalysisSolution))]32 public partial class LineChartView : AsynchronousContentView {30 [View("Regression solution line chart")] 31 [Content(typeof(IRegressionSolution))] 32 public partial class RegressionSolutionLineChartView : AsynchronousContentView { 33 33 private const string TARGETVARIABLE_SERIES_NAME = "TargetVariable"; 34 34 private const string ESTIMATEDVALUES_SERIES_NAME = "EstimatedValues"; 35 35 36 public new DataAnalysisSolution Content {37 get { return ( DataAnalysisSolution)base.Content; }36 public new IRegressionSolution Content { 37 get { return (IRegressionSolution)base.Content; } 38 38 set { base.Content = value; } 39 39 } 40 40 41 public LineChartView()41 public RegressionSolutionLineChartView() 42 42 : base() { 43 43 InitializeComponent(); … … 57 57 if (Content != null) { 58 58 this.chart.Series.Add(TARGETVARIABLE_SERIES_NAME); 59 this.chart.Series[TARGETVARIABLE_SERIES_NAME].LegendText = Content.ProblemData.TargetVariable .Value;59 this.chart.Series[TARGETVARIABLE_SERIES_NAME].LegendText = Content.ProblemData.TargetVariable; 60 60 this.chart.Series[TARGETVARIABLE_SERIES_NAME].ChartType = SeriesChartType.FastLine; 61 this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.DataBindY(Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable .Value));61 this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.DataBindY(Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable)); 62 62 this.UpdateStripLines(); 63 63 … … 85 85 protected override void RegisterContentEvents() { 86 86 base.RegisterContentEvents(); 87 Content. EstimatedValuesChanged += new EventHandler(Content_EstimatedValuesChanged);87 Content.ModelChanged += new EventHandler(Content_ModelChanged); 88 88 Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged); 89 89 } 90 90 protected override void DeregisterContentEvents() { 91 91 base.DeregisterContentEvents(); 92 Content. EstimatedValuesChanged -= new EventHandler(Content_EstimatedValuesChanged);92 Content.ModelChanged -= new EventHandler(Content_ModelChanged); 93 93 Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged); 94 94 } … … 98 98 } 99 99 100 private void Content_ EstimatedValuesChanged(object sender, EventArgs e) {100 private void Content_ModelChanged(object sender, EventArgs e) { 101 101 UpdateEstimatedValuesLineChart(); 102 102 } … … 136 136 this.chart.ChartAreas[0].AxisX.StripLines.Clear(); 137 137 this.CreateAndAddStripLine("Training", Color.FromArgb(20, Color.Green), 138 Content.ProblemData.Training SamplesStart.Value,139 Content.ProblemData.Training SamplesEnd.Value);138 Content.ProblemData.TrainingPartitionStart.Value, 139 Content.ProblemData.TrainingPartitionEnd.Value); 140 140 this.CreateAndAddStripLine("Test", Color.FromArgb(20, Color.Red), 141 Content.ProblemData.Test SamplesStart.Value,142 Content.ProblemData.Test SamplesEnd.Value);141 Content.ProblemData.TestPartitionStart.Value, 142 Content.ProblemData.TestPartitionEnd.Value); 143 143 } 144 144 -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionScatterPlotView.Designer.cs
r5642 r5663 21 21 22 22 namespace HeuristicLab.Problems.DataAnalysis.Views { 23 partial class ScatterPlotView {23 partial class RegressionSolutionScatterPlotView { 24 24 /// <summary> 25 25 /// Required designer variable. -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionScatterPlotView.cs
r5642 r5663 29 29 30 30 namespace HeuristicLab.Problems.DataAnalysis.Views { 31 [View(" Scatter Plot View")]32 [Content(typeof( DataAnalysisSolution), true)]33 public partial class ScatterPlotView : AsynchronousContentView {34 private const string ALL_SERIES = "All Samples";35 private const string TRAINING_SERIES = "Training Samples";36 private const string TEST_SERIES = "Test Samples";37 38 public new DataAnalysisSolution Content {39 get { return ( DataAnalysisSolution)base.Content; }31 [View("Regression solution scatter plot")] 32 [Content(typeof(IRegressionSolution))] 33 public partial class RegressionSolutionScatterPlotView : AsynchronousContentView { 34 private const string ALL_SERIES = "All samples"; 35 private const string TRAINING_SERIES = "Training samples"; 36 private const string TEST_SERIES = "Test samples"; 37 38 public new IRegressionSolution Content { 39 get { return (IRegressionSolution)base.Content; } 40 40 set { base.Content = value; } 41 41 } 42 42 43 public ScatterPlotView()43 public RegressionSolutionScatterPlotView() 44 44 : base() { 45 45 InitializeComponent(); … … 77 77 protected override void RegisterContentEvents() { 78 78 base.RegisterContentEvents(); 79 Content. EstimatedValuesChanged += new EventHandler(Content_EstimatedValuesChanged);79 Content.ModelChanged += new EventHandler(Content_ModelChanged); 80 80 Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged); 81 81 } 82 82 protected override void DeregisterContentEvents() { 83 83 base.DeregisterContentEvents(); 84 Content. EstimatedValuesChanged -= new EventHandler(Content_EstimatedValuesChanged);84 Content.ModelChanged -= new EventHandler(Content_ModelChanged); 85 85 Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged); 86 86 } … … 90 90 UpdateChart(); 91 91 } 92 private void Content_ EstimatedValuesChanged(object sender, EventArgs e) {92 private void Content_ModelChanged(object sender, EventArgs e) { 93 93 UpdateSeries(); 94 94 } … … 126 126 if (InvokeRequired) Invoke((Action)UpdateSeries); 127 127 else { 128 string targetVariableName = Content.ProblemData.TargetVariable .Value;128 string targetVariableName = Content.ProblemData.TargetVariable; 129 129 Dataset dataset = Content.ProblemData.Dataset; 130 130 if (this.chart.Series[ALL_SERIES].Points.Count > 0) … … 170 170 } 171 171 } else if (Content != null) { 172 string targetVariableName = Content.ProblemData.TargetVariable .Value;172 string targetVariableName = Content.ProblemData.TargetVariable; 173 173 174 174 IEnumerable<double> predictedValues = null;
Note: See TracChangeset
for help on using the changeset viewer.