Changeset 11093 for trunk/sources
- Timestamp:
- 07/06/14 14:14:42 (10 years ago)
- Location:
- trunk/sources
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SymbolicClassificationSolutionView.cs
r10540 r11093 22 22 using System; 23 23 using System.ComponentModel; 24 using System.Linq; 24 25 using System.Windows.Forms; 25 26 using HeuristicLab.MainForm; … … 42 43 protected override void SetEnabledStateOfControls() { 43 44 base.SetEnabledStateOfControls(); 44 btnSimplify.Enabled = Content != null && !Locked ;45 btnSimplify.Enabled = Content != null && !Locked && Content.ProblemData.TrainingIndices.Any(); // simplification is only possible if there are trainings samples 45 46 exportButton.Enabled = Content != null && !Locked; 46 47 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SymbolicDiscriminantFunctionClassificationSolutionView.cs
r10540 r11093 22 22 using System; 23 23 using System.ComponentModel; 24 using System.Linq; 24 25 using System.Windows.Forms; 25 26 using HeuristicLab.MainForm; … … 42 43 protected override void SetEnabledStateOfControls() { 43 44 base.SetEnabledStateOfControls(); 44 btnSimplify.Enabled = Content != null && !Locked ;45 btnSimplify.Enabled = Content != null && !Locked && Content.ProblemData.TrainingIndices.Any(); // simplification is only possible if there are trainings samples 45 46 exportButton.Enabled = Content != null && !Locked; 46 47 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionErrorCharacteristicsCurveView.cs
r9456 r11093 60 60 double rmse, cvRmsError; 61 61 var problemData = (IRegressionProblemData)ProblemData.Clone(); 62 if(!problemData.TrainingIndices.Any()) return null; // don't create an LR model if the problem does not have a training set (e.g. loaded into an existing model) 62 63 63 64 //clear checked inputVariables -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.cs
r10894 r11093 22 22 using System; 23 23 using System.ComponentModel; 24 using System.Linq; 24 25 using System.Windows.Forms; 25 26 using HeuristicLab.MainForm; … … 42 43 protected override void SetEnabledStateOfControls() { 43 44 base.SetEnabledStateOfControls(); 44 btnSimplify.Enabled = Content != null && !Locked ;45 btnSimplify.Enabled = Content != null && !Locked && Content.ProblemData.TrainingIndices.Any(); // simplification is only possible if there are trainings samples 45 46 exportButton.Enabled = Content != null && !Locked; 46 47 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis.Views/3.4/SymbolicTimeSeriesPrognosisSolutionView.cs
r10540 r11093 21 21 22 22 using System; 23 using System. Windows.Forms;23 using System.Linq; 24 24 using HeuristicLab.MainForm; 25 25 using HeuristicLab.Problems.DataAnalysis.Views; … … 40 40 protected override void SetEnabledStateOfControls() { 41 41 base.SetEnabledStateOfControls(); 42 btnSimplify.Enabled = Content != null && !Locked ;42 btnSimplify.Enabled = Content != null && !Locked && Content.ProblemData.TrainingIndices.Any(); // simplification is only possible if there are trainings samples 43 43 } 44 44 45 45 private void btn_SimplifyModel_Click(object sender, EventArgs e) { 46 InteractiveSymbolicTimeSeriesPrognosisSolutionSimplifierViewview = new InteractiveSymbolicTimeSeriesPrognosisSolutionSimplifierView();46 var view = new InteractiveSymbolicTimeSeriesPrognosisSolutionSimplifierView(); 47 47 view.Content = (SymbolicTimeSeriesPrognosisSolution)this.Content.Clone(); 48 48 view.Show(); -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs
r10500 r11093 99 99 chart.Series.Clear(); 100 100 chart.Annotations.Clear(); 101 101 102 if (Content == null) return; 102 103 var constantModel = CreateConstantModel();104 var originalValues = GetOriginalValues().ToList(); 105 var baselineEstimatedValues = GetEstimatedValues(constantModel);106 var baselineResiduals = GetResiduals(originalValues, baselineEstimatedValues);107 108 baselineResiduals.Sort();109 chart.ChartAreas[0].AxisX.Maximum = Math.Ceiling(baselineResiduals.Last());110 chart.ChartAreas[0].CursorX.Interval = baselineResiduals.First() / 100; 111 112 Series baselineSeries = new Series("Baseline");113 baselineSeries.ChartType = SeriesChartType.FastLine;114 UpdateSeries(baselineResiduals,baselineSeries);115 baselineSeries.ToolTip = "Area over Curve: " + CalculateAreaOverCurve(baselineSeries);116 baselineSeries.Tag = constantModel;117 baselineSeries.LegendToolTip = "Double-click to open model";118 chart.Series.Add(baselineSeries);103 if (cmbSamples.SelectedItem.ToString() == TrainingSamples && !ProblemData.TrainingIndices.Any()) return; 104 if (cmbSamples.SelectedItem.ToString() == TestSamples && !ProblemData.TestIndices.Any()) return; 105 106 if (Content.ProblemData.TrainingIndices.Any()) { 107 var constantModel = CreateConstantModel(); 108 var originalValues = GetOriginalValues().ToList(); 109 var baselineEstimatedValues = GetEstimatedValues(constantModel); 110 var baselineResiduals = GetResiduals(originalValues, baselineEstimatedValues); 111 112 Series baselineSeries = new Series("Baseline"); 113 baselineSeries.ChartType = SeriesChartType.FastLine; 114 UpdateSeries(baselineResiduals, baselineSeries); 115 baselineSeries.ToolTip = "Area over Curve: " + CalculateAreaOverCurve(baselineSeries); 116 baselineSeries.Tag = constantModel; 117 baselineSeries.LegendToolTip = "Double-click to open model"; 118 chart.Series.Add(baselineSeries); 119 } 119 120 120 121 AddRegressionSolution(Content); … … 127 128 solutionSeries.Tag = solution; 128 129 solutionSeries.ChartType = SeriesChartType.FastLine; 129 var estimatedValues = GetResiduals(GetOriginalValues(), GetEstimatedValues(solution)); 130 UpdateSeries(estimatedValues, solutionSeries); 130 var residuals = GetResiduals(GetOriginalValues(), GetEstimatedValues(solution)); 131 132 chart.ChartAreas[0].AxisX.Maximum = Math.Ceiling(residuals.Max()); 133 chart.ChartAreas[0].CursorX.Interval = residuals.Min() / 100; 134 135 UpdateSeries(residuals, solutionSeries); 136 131 137 solutionSeries.ToolTip = "Area over Curve: " + CalculateAreaOverCurve(solutionSeries); 132 138 solutionSeries.LegendToolTip = "Double-click to open model"; … … 236 242 double averageTrainingTarget = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices).Average(); 237 243 var model = new ConstantRegressionModel(averageTrainingTarget); 238 var solution = new ConstantRegressionSolution(model, (IRegressionProblemData)ProblemData.Clone());244 var solution = new ConstantRegressionSolution(model, (IRegressionProblemData)ProblemData.Clone()); 239 245 solution.Name = "Baseline"; 240 246 return solution; -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView.cs
r9462 r11093 22 22 using System.Collections.Generic; 23 23 using System.Linq; 24 using System.Windows.Forms;25 24 using HeuristicLab.MainForm; 26 using HeuristicLab.MainForm.WindowsForms; 25 27 26 namespace HeuristicLab.Problems.DataAnalysis.Views { 28 27 [View("Error Characteristics Curve")] … … 51 50 if (Content == null) return; 52 51 53 //AR1 model54 double alpha, beta;55 OnlineCalculatorError errorState;56 52 IEnumerable<double> trainingStartValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices.Select(r => r - 1).Where(r => r > 0)).ToList(); 57 OnlineLinearScalingParameterCalculator.Calculate(ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices.Where(x => x > 0)), trainingStartValues, out alpha, out beta, out errorState); 58 var AR1model = new TimeSeriesPrognosisAutoRegressiveModel(ProblemData.TargetVariable, new double[] { beta }, alpha).CreateTimeSeriesPrognosisSolution(ProblemData); 59 AR1model.Name = "AR(1) Model"; 60 AddRegressionSolution(AR1model); 53 if (trainingStartValues.Any()) { 54 //AR1 model 55 double alpha, beta; 56 OnlineCalculatorError errorState; 57 OnlineLinearScalingParameterCalculator.Calculate(ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices.Where(x => x > 0)), trainingStartValues, out alpha, out beta, out errorState); 58 var ar1model = new TimeSeriesPrognosisAutoRegressiveModel(ProblemData.TargetVariable, new double[] { beta }, alpha).CreateTimeSeriesPrognosisSolution(ProblemData); 59 ar1model.Name = "AR(1) Model"; 60 AddRegressionSolution(ar1model); 61 } 61 62 } 62 63 }
Note: See TracChangeset
for help on using the changeset viewer.