Changeset 14166
- Timestamp:
- 07/21/16 17:24:22 (8 years ago)
- Location:
- stable
- Files:
-
- 6 deleted
- 21 edited
- 13 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 14095-14096,14098-14099,14118,14131,14157-14158
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.DataAnalysis.Views
-
stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/HeuristicLab.Algorithms.DataAnalysis.Views-3.4.csproj
r13951 r14166 125 125 </ItemGroup> 126 126 <ItemGroup> 127 <Compile Include="GaussianProcessRegressionSolutionEstimatedValuesView.cs">128 <SubType>UserControl</SubType>129 </Compile>130 <Compile Include="GaussianProcessRegressionSolutionEstimatedValuesView.Designer.cs">131 <DependentUpon>GaussianProcessRegressionSolutionEstimatedValuesView.cs</DependentUpon>132 </Compile>133 127 <Compile Include="MeanProdView.cs"> 134 128 <SubType>UserControl</SubType> … … 180 174 </Compile> 181 175 <Compile Include="Plugin.cs" /> 182 <Compile Include="GaussianProcessRegressionSolutionLineChartView.cs">183 <SubType>UserControl</SubType>184 </Compile>185 <Compile Include="GaussianProcessRegressionSolutionLineChartView.Designer.cs">186 <DependentUpon>GaussianProcessRegressionSolutionLineChartView.cs</DependentUpon>187 </Compile>188 176 <Compile Include="SupportVectorMachineModelSupportVectorsView.cs"> 189 177 <SubType>UserControl</SubType> -
stable/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/Plugin.cs.frame
r13316 r14166 44 44 [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")] 45 45 [PluginDependency("HeuristicLab.Problems.DataAnalysis.Views", "3.4")] 46 [PluginDependency("HeuristicLab.Visualization.ChartControlsExtensions", "3.3")]47 46 public class HeuristicLabAlgorithmsDataAnalysisViewsPlugin : PluginBase { 48 47 } -
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessModel.cs
r14027 r14166 341 341 } 342 342 343 public IEnumerable<double> GetEstimatedVariance (IDataset dataset, IEnumerable<int> rows) {343 public IEnumerable<double> GetEstimatedVariances(IDataset dataset, IEnumerable<int> rows) { 344 344 try { 345 345 if (x == null) { -
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegressionSolution.cs
r12009 r14166 20 20 #endregion 21 21 22 using System.Collections.Generic;23 using System.Linq;24 22 using HeuristicLab.Common; 25 23 using HeuristicLab.Core; … … 33 31 [Item("GaussianProcessRegressionSolution", "Represents a Gaussian process solution for a regression problem which can be visualized in the GUI.")] 34 32 [StorableClass] 35 public sealed class GaussianProcessRegressionSolution : RegressionSolution, IGaussianProcessSolution { 36 private new readonly Dictionary<int, double> evaluationCache; 33 public sealed class GaussianProcessRegressionSolution : ConfidenceRegressionSolution, IGaussianProcessSolution { 37 34 38 35 public new IGaussianProcessModel Model { … … 44 41 private GaussianProcessRegressionSolution(bool deserializing) 45 42 : base(deserializing) { 46 evaluationCache = new Dictionary<int, double>();47 48 43 } 49 44 private GaussianProcessRegressionSolution(GaussianProcessRegressionSolution original, Cloner cloner) 50 : base(original, cloner) { 51 evaluationCache = new Dictionary<int, double>(original.evaluationCache); 52 } 45 : base(original, cloner) { } 53 46 public GaussianProcessRegressionSolution(IGaussianProcessModel model, IRegressionProblemData problemData) 54 : base(model, problemData) { 55 56 evaluationCache = new Dictionary<int, double>(problemData.Dataset.Rows); 57 } 47 : base(model, problemData) { } 58 48 59 49 public override IDeepCloneable Clone(Cloner cloner) { 60 50 return new GaussianProcessRegressionSolution(this, cloner); 61 51 } 62 63 public IEnumerable<double> EstimatedVariance {64 get { return GetEstimatedVariance(Enumerable.Range(0, ProblemData.Dataset.Rows)); }65 }66 public IEnumerable<double> EstimatedTrainingVariance {67 get { return GetEstimatedVariance(ProblemData.TrainingIndices); }68 }69 public IEnumerable<double> EstimatedTestVariance {70 get { return GetEstimatedVariance(ProblemData.TestIndices); }71 }72 73 public IEnumerable<double> GetEstimatedVariance(IEnumerable<int> rows) {74 var rowsToEvaluate = rows.Except(evaluationCache.Keys);75 var rowsEnumerator = rowsToEvaluate.GetEnumerator();76 var valuesEnumerator = Model.GetEstimatedVariance(ProblemData.Dataset, rowsToEvaluate).GetEnumerator();77 78 while (rowsEnumerator.MoveNext() & valuesEnumerator.MoveNext()) {79 evaluationCache.Add(rowsEnumerator.Current, valuesEnumerator.Current);80 }81 82 return rows.Select(row => evaluationCache[row]);83 }84 85 protected override void OnModelChanged() {86 evaluationCache.Clear();87 base.OnModelChanged();88 }89 protected override void OnProblemDataChanged() {90 evaluationCache.Clear();91 base.OnProblemDataChanged();92 }93 52 } 94 53 } -
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/RegressionTreeBuilder.cs
r14027 r14166 22 22 23 23 using System; 24 using System.Collections;25 24 using System.Collections.Generic; 26 25 using System.Diagnostics; … … 129 128 130 129 // y and curPred are changed in gradient boosting 131 this.y = y; 132 this.curPred = curPred; 130 this.y = y; 131 this.curPred = curPred; 133 132 134 133 // shuffle row idx -
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessModel.cs
r12702 r14166 20 20 #endregion 21 21 22 using System.Collections.Generic;23 22 using HeuristicLab.Problems.DataAnalysis; 24 23 … … 27 26 /// Interface to represent a Gaussian process posterior 28 27 /// </summary> 29 public interface IGaussianProcessModel : I RegressionModel {28 public interface IGaussianProcessModel : IConfidenceRegressionModel { 30 29 double NegativeLogLikelihood { get; } 31 30 double SigmaNoise { get; } … … 34 33 double[] HyperparameterGradients { get; } 35 34 36 IEnumerable<double> GetEstimatedVariance(IDataset ds, IEnumerable<int> rows);37 35 void FixParameters(); 38 36 } -
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessSolution.cs
r12009 r14166 26 26 /// Interface to represent a Gaussian process solution (either regression or classification) 27 27 /// </summary> 28 public interface IGaussianProcessSolution : I DataAnalysisSolution {28 public interface IGaussianProcessSolution : IConfidenceRegressionSolution { 29 29 new IGaussianProcessModel Model { get; } 30 30 } -
stable/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Views
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls/GradientChart.Designer.cs
r14099 r14166 31 31 System.Windows.Forms.DataVisualization.Charting.StripLine stripLine2 = new System.Windows.Forms.DataVisualization.Charting.StripLine(); 32 32 System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); 33 System.Windows.Forms.DataVisualization.Charting.Title title1 = new System.Windows.Forms.DataVisualization.Charting.Title(); 33 34 this.calculationPendingLabel = new System.Windows.Forms.Label(); 34 35 this.calculationPendingTimer = new System.Windows.Forms.Timer(this.components); … … 74 75 chartArea1.Name = "ChartArea"; 75 76 chartArea1.Position.Auto = false; 76 chartArea1.Position.Height = 100F;77 chartArea1.Position.Height = 90F; 77 78 chartArea1.Position.Width = 100F; 79 chartArea1.Position.Y = 10F; 78 80 this.chart.ChartAreas.Add(chartArea1); 79 81 this.chart.Dock = System.Windows.Forms.DockStyle.Fill; … … 88 90 this.chart.Size = new System.Drawing.Size(453, 308); 89 91 this.chart.TabIndex = 0; 92 title1.Alignment = System.Drawing.ContentAlignment.TopCenter; 93 title1.DockedToChartArea = "ChartArea"; 94 title1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 95 title1.IsDockedInsideChartArea = false; 96 title1.Name = "Title"; 97 title1.Text = "[Title]"; 98 this.chart.Titles.Add(title1); 90 99 this.chart.SelectionRangeChanged += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.CursorEventArgs>(this.chart_SelectionRangeChanged); 100 this.chart.PostPaint += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.ChartPaintEventArgs>(this.chart_PostPaint); 101 this.chart.AnnotationPositionChanged += new System.EventHandler(this.chart_AnnotationPositionChanged); 91 102 this.chart.AnnotationPositionChanging += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.AnnotationPositionChangingEventArgs>(this.chart_AnnotationPositionChanging); 92 103 this.chart.DragDrop += new System.Windows.Forms.DragEventHandler(this.chart_DragDrop); 93 104 this.chart.DragEnter += new System.Windows.Forms.DragEventHandler(this.chart_DragEnter); 94 105 this.chart.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chart_MouseMove); 106 this.chart.Resize += new System.EventHandler(this.chart_Resize); 95 107 // 96 108 // configurationButton -
stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls/GradientChart.cs
r14099 r14166 66 66 set { 67 67 chart.Annotations[0].Visible = value; 68 if (!value) chart. ChartAreas[0].AxisX.Title= string.Empty;68 if (!value) chart.Titles[0].Text = string.Empty; 69 69 } 70 70 } … … 207 207 #endregion 208 208 209 public event EventHandler ChartPostPaint; 210 209 211 public GradientChart() { 210 212 InitializeComponent(); … … 266 268 ciSeriesCache.Add(solution, series.Item2); 267 269 } 268 269 ResizeAllSeriesData();270 OrderAndColorSeries();271 }272 273 public async Task RecalculateAsync(bool updateOnFinish = true, bool resetYAxis = true) {274 if (IsDisposed275 || sharedFixedVariables == null || !solutions.Any() || string.IsNullOrEmpty(freeVariable)276 || trainingMin.IsAlmost(trainingMax) || trainingMin > trainingMax || drawingSteps == 0)277 return;278 279 calculationPendingTimer.Start();280 281 Update(); // immediately show label282 283 // cancel previous recalculate call284 if (cancelCurrentRecalculateSource != null)285 cancelCurrentRecalculateSource.Cancel();286 cancelCurrentRecalculateSource = new CancellationTokenSource();287 270 288 271 // Set cursor and x-axis … … 300 283 301 284 if (ShowCursor) 302 chart.ChartAreas[0].AxisX.Title = FreeVariable + " : " + defaultValue.ToString("N3", CultureInfo.CurrentCulture); 285 chart.Titles[0].Text = FreeVariable + " : " + defaultValue.ToString("N3", CultureInfo.CurrentCulture); 286 287 ResizeAllSeriesData(); 288 OrderAndColorSeries(); 289 } 290 291 public async Task RecalculateAsync(bool updateOnFinish = true, bool resetYAxis = true) { 292 if (IsDisposed 293 || sharedFixedVariables == null || !solutions.Any() || string.IsNullOrEmpty(freeVariable) 294 || trainingMin.IsAlmost(trainingMax) || trainingMin > trainingMax || drawingSteps == 0) 295 return; 296 297 calculationPendingTimer.Start(); 298 299 // cancel previous recalculate call 300 if (cancelCurrentRecalculateSource != null) 301 cancelCurrentRecalculateSource.Cancel(); 302 cancelCurrentRecalculateSource = new CancellationTokenSource(); 303 var cancellationToken = cancelCurrentRecalculateSource.Token; 303 304 304 305 // Update series 305 var cancellationToken = cancelCurrentRecalculateSource.Token;306 306 try { 307 307 var limits = await UpdateAllSeriesDataAsync(cancellationToken); 308 //cancellationToken.ThrowIfCancellationRequested();309 308 310 309 yMin = limits.Lower; … … 328 327 } 329 328 329 public void UpdateTitlePosition() { 330 var title = chart.Titles[0]; 331 var plotArea = InnerPlotPosition; 332 333 title.Visible = plotArea.Width != 0; 334 335 title.Position.X = plotArea.X + (plotArea.Width / 2); 336 } 337 330 338 private void SetupAxis(Axis axis, double minValue, double maxValue, int ticks, double? fixedAxisMin, double? fixedAxisMax) { 331 double axisMin, axisMax, axisInterval; 332 ChartUtil.CalculateAxisInterval(minValue, maxValue, ticks, out axisMin, out axisMax, out axisInterval); 333 axis.Minimum = fixedAxisMin ?? axisMin; 334 axis.Maximum = fixedAxisMax ?? axisMax; 335 axis.Interval = (axis.Maximum - axis.Minimum) / ticks; 339 if (minValue < maxValue) { 340 double axisMin, axisMax, axisInterval; 341 ChartUtil.CalculateAxisInterval(minValue, maxValue, ticks, out axisMin, out axisMax, out axisInterval); 342 axis.Minimum = fixedAxisMin ?? axisMin; 343 axis.Maximum = fixedAxisMax ?? axisMax; 344 axis.Interval = (axis.Maximum - axis.Minimum) / ticks; 345 } 336 346 337 347 try { … … 453 463 if (yvalues[i] > max) max = yvalues[i]; 454 464 } 465 chart.Invalidate(); 466 467 cancellationToken.ThrowIfCancellationRequested(); 455 468 456 469 var confidenceBoundSolution = solution as IConfidenceRegressionSolution; 457 470 if (confidenceBoundSolution != null) { 458 471 var confidenceIntervalSeries = ciSeriesCache[solution]; 459 460 cancellationToken.ThrowIfCancellationRequested(); 461 var variances = 462 confidenceBoundSolution.Model.GetEstimatedVariances(internalDataset, 463 Enumerable.Range(0, internalDataset.Rows)).ToList(); 472 var variances = confidenceBoundSolution.Model.GetEstimatedVariances(internalDataset, Enumerable.Range(0, internalDataset.Rows)).ToList(); 464 473 for (int i = 0; i < xvalues.Count; i++) { 465 474 var lower = yvalues[i] - 1.96 * Math.Sqrt(variances[i]); … … 469 478 if (upper > max) max = upper; 470 479 } 480 chart.Invalidate(); 471 481 } 472 482 … … 619 629 620 630 e.NewLocationX = newLocation; 621 var annotation = VerticalLineAnnotation; 622 var x = annotation.X; 631 632 UpdateCursor(); 633 } 634 private void chart_AnnotationPositionChanged(object sender, EventArgs e) { 635 UpdateCursor(); 636 } 637 void UpdateCursor() { 638 var x = VerticalLineAnnotation.X; 623 639 sharedFixedVariables.SetVariableValue(x, FreeVariable, 0); 624 640 625 641 if (ShowCursor) { 626 chart. ChartAreas[0].AxisX.Title= FreeVariable + " : " + x.ToString("N3", CultureInfo.CurrentCulture);642 chart.Titles[0].Text = FreeVariable + " : " + x.ToString("N3", CultureInfo.CurrentCulture); 627 643 chart.Update(); 628 644 } … … 636 652 } 637 653 638 private void chart_DragDrop(object sender, DragEventArgs e) {654 private async void chart_DragDrop(object sender, DragEventArgs e) { 639 655 var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat); 640 656 if (data != null) { 641 657 var solution = data as IRegressionSolution; 642 658 if (!solutions.Contains(solution)) 643 AddSolutionAsync(solution);659 await AddSolutionAsync(solution); 644 660 } 645 661 } … … 667 683 OnZoomChanged(this, EventArgs.Empty); 668 684 } 685 686 private void chart_Resize(object sender, EventArgs e) { 687 UpdateTitlePosition(); 688 } 689 690 private void chart_PostPaint(object sender, ChartPaintEventArgs e) { 691 if (ChartPostPaint != null) 692 ChartPostPaint(this, EventArgs.Empty); 693 } 669 694 #endregion 670 695 } 671 696 } 697 -
stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls/GradientChartConfigurationDialog.cs
r14099 r14166 51 51 private async void okButton_Click(object sender, System.EventArgs e) { 52 52 try { 53 Enabled = false; 53 54 chart.SuspendRepaint(); 54 55 if (xAutomaticCheckBox.Checked) { … … 82 83 } 83 84 finally { 85 Enabled = true; 84 86 chart.ResumeRepaint(true); 85 87 } -
stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj
r14005 r14166 120 120 </ItemGroup> 121 121 <ItemGroup> 122 <Compile Include="Controls\DensityChart.cs"> 123 <SubType>UserControl</SubType> 124 </Compile> 125 <Compile Include="Controls\DensityChart.Designer.cs"> 126 <DependentUpon>DensityChart.cs</DependentUpon> 127 </Compile> 128 <Compile Include="Controls\DensityTrackbar.cs"> 129 <SubType>UserControl</SubType> 130 </Compile> 131 <Compile Include="Controls\DensityTrackbar.Designer.cs"> 132 <DependentUpon>DensityTrackbar.cs</DependentUpon> 133 </Compile> 122 134 <Compile Include="FeatureCorrelation\TimeframeFeatureCorrelationCalculator.cs" /> 123 135 <Compile Include="FeatureCorrelation\AbstractFeatureCorrelationCalculator.cs" /> … … 183 195 <DependentUpon>FeatureCorrelationView.cs</DependentUpon> 184 196 </Compile> 197 <Compile Include="Controls\GradientChart.cs"> 198 <SubType>UserControl</SubType> 199 </Compile> 200 <Compile Include="Controls\GradientChart.Designer.cs"> 201 <DependentUpon>GradientChart.cs</DependentUpon> 202 </Compile> 203 <Compile Include="Controls\GradientChartConfigurationDialog.cs"> 204 <SubType>Form</SubType> 205 </Compile> 206 <Compile Include="Controls\GradientChartConfigurationDialog.Designer.cs"> 207 <DependentUpon>GradientChartConfigurationDialog.cs</DependentUpon> 208 </Compile> 185 209 <Compile Include="Interfaces\IDataPreprocessorStarter.cs" /> 186 210 <Compile Include="MenuItems\ShrinkDataAnalysisRunsMenuItem.cs" /> … … 198 222 <DependentUpon>ProblemDataView.cs</DependentUpon> 199 223 </Compile> 224 <Compile Include="Regression\ConfidenceRegressionSolutionEstimatedValuesView.cs"> 225 <SubType>UserControl</SubType> 226 </Compile> 227 <Compile Include="Regression\ConfidenceRegressionSolutionEstimatedValuesView.Designer.cs"> 228 <DependentUpon>ConfidenceRegressionSolutionEstimatedValuesView.cs</DependentUpon> 229 </Compile> 230 <Compile Include="Regression\ConfidenceRegressionSolutionLineChartView.cs"> 231 <SubType>UserControl</SubType> 232 </Compile> 233 <Compile Include="Regression\ConfidenceRegressionSolutionLineChartView.Designer.cs"> 234 <DependentUpon>ConfidenceRegressionSolutionLineChartView.cs</DependentUpon> 235 </Compile> 200 236 <Compile Include="Regression\RegressionEnsembleSolutionModelWeightsView.cs"> 201 237 <SubType>UserControl</SubType> … … 210 246 <DependentUpon>RegressionFeatureCorrelationView.cs</DependentUpon> 211 247 </Compile> 248 <Compile Include="Regression\RegressionSolutionGradientView.cs"> 249 <SubType>UserControl</SubType> 250 </Compile> 251 <Compile Include="Regression\RegressionSolutionGradientView.Designer.cs"> 252 <DependentUpon>RegressionSolutionGradientView.cs</DependentUpon> 253 </Compile> 254 <Compile Include="Regression\RegressionSolutionTargetResponseGradientView.cs"> 255 <SubType>UserControl</SubType> 256 </Compile> 257 <Compile Include="Regression\RegressionSolutionTargetResponseGradientView.Designer.cs"> 258 <DependentUpon>RegressionSolutionTargetResponseGradientView.cs</DependentUpon> 259 </Compile> 212 260 <Compile Include="Regression\RegressionTimeframeFeatureCorrelationView.cs"> 213 261 <SubType>UserControl</SubType> … … 318 366 <DependentUpon>DataAnalysisSolutionView.cs</DependentUpon> 319 367 </Compile> 320 <Compile Include=" DoubleLimitView.cs">321 <SubType>UserControl</SubType> 322 </Compile> 323 <Compile Include=" DoubleLimitView.Designer.cs">368 <Compile Include="Controls\DoubleLimitView.cs"> 369 <SubType>UserControl</SubType> 370 </Compile> 371 <Compile Include="Controls\DoubleLimitView.Designer.cs"> 324 372 <DependentUpon>DoubleLimitView.cs</DependentUpon> 325 373 </Compile> -
stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionGradientView.cs
r14096 r14166 162 162 } 163 163 164 private void trackbar_CheckedChanged(object sender, EventArgs e) {164 private async void trackbar_CheckedChanged(object sender, EventArgs e) { 165 165 var trackBar = sender as DensityTrackbar; 166 166 if (trackBar == null || !trackBar.Checked) return; … … 169 169 tb.Checked = false; 170 170 gradientChart.FreeVariable = variableNames[trackbars.IndexOf(trackBar)]; 171 gradientChart.RecalculateAsync();172 } 173 174 private void trackbar_LimitsChanged(object sender, EventArgs e) {171 await gradientChart.RecalculateAsync(); 172 } 173 174 private async void trackbar_LimitsChanged(object sender, EventArgs e) { 175 175 var trackBar = sender as DensityTrackbar; 176 176 if (trackBar == null || !trackBar.Checked) return; 177 177 gradientChart.FixedXAxisMin = trackBar.Limits.Lower; 178 178 gradientChart.FixedXAxisMax = trackBar.Limits.Upper; 179 gradientChart.RecalculateAsync();180 } 181 182 private void trackbar_ValueChanged(object sender, EventArgs e) {179 await gradientChart.RecalculateAsync(); 180 } 181 182 private async void trackbar_ValueChanged(object sender, EventArgs e) { 183 183 var trackBar = sender as DensityTrackbar; 184 184 if (trackBar == null) return; 185 185 sharedFixedVariables.SetVariableValue((double)trackBar.Value, variableNames[trackbars.IndexOf(trackBar)], 0); 186 gradientChart.RecalculateAsync();186 await gradientChart.RecalculateAsync(); 187 187 } 188 188 -
stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionTargetResponseGradientView.cs
r14096 r14166 127 127 Margin = Padding.Empty, 128 128 Height = 12, 129 Visible = false 129 Visible = false, 130 Top = (int)(gradientChart.Height * 0.1), 130 131 }; 131 132 densityCharts.Add(variableName, densityChart); … … 138 139 UpdateDensityChart(density, gradient.FreeVariable); 139 140 }; 141 gradientChart.SizeChanged += (o, e) => { 142 var gradient = (GradientChart)o; 143 var density = densityCharts[gradient.FreeVariable]; 144 density.Top = (int)(gradient.Height * 0.1); 145 }; 146 147 // Initially, the inner plot areas are not initialized for hidden charts (scollpanel, ...) 148 // This event handler listens for the paint event once (where everything is already initialized) to do some manual layouting. 149 gradientChart.ChartPostPaint += OnGradientChartOnChartPostPaint; 140 150 141 151 var panel = new Panel() { … … 161 171 162 172 RecalculateAndRelayoutCharts(); 173 } 174 175 private void OnGradientChartOnChartPostPaint(object o, EventArgs e) { 176 var gradient = (GradientChart)o; 177 var density = densityCharts[gradient.FreeVariable]; 178 179 density.Width = gradient.Width; 180 181 var gcPlotPosition = gradient.InnerPlotPosition; 182 density.Left = (int)(gcPlotPosition.X / 100.0 * gradient.Width); 183 density.Width = (int)(gcPlotPosition.Width / 100.0 * gradient.Width); 184 gradient.UpdateTitlePosition(); 185 186 // removed after succesful layouting due to performance reasons 187 if (gcPlotPosition.Width != 0) 188 gradient.ChartPostPaint -= OnGradientChartOnChartPostPaint; 163 189 } 164 190 … … 372 398 densityChart.Visible = true; 373 399 } 400 401 gradientChart.UpdateTitlePosition(); 374 402 } 375 403 -
stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionSolutionView.cs
r14022 r14166 31 31 32 32 namespace HeuristicLab.Problems.DataAnalysis.Views { 33 [View(" RegressionSolution View")]33 [View("Solution View")] 34 34 [Content(typeof(RegressionSolutionBase), false)] 35 35 public partial class RegressionSolutionView : DataAnalysisSolutionView { -
stable/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj
r14027 r14166 138 138 <Compile Include="Implementation\ConstantModel.cs" /> 139 139 <Compile Include="Implementation\DataAnalysisModel.cs" /> 140 <Compile Include="Implementation\Regression\ConfidenceBoundRegressionSolution.cs" /> 140 141 <Compile Include="Implementation\Regression\ConstantRegressionModel.cs" /> 141 142 <Compile Include="Implementation\Regression\ConstantRegressionSolution.cs" /> … … 175 176 <Compile Include="Interfaces\ITransformation.cs" /> 176 177 <Compile Include="Interfaces\ITransformationMapper.cs" /> 178 <Compile Include="Interfaces\Regression\IConfidenceRegressionModel.cs" /> 179 <Compile Include="Interfaces\Regression\IConfidenceRegressionSolution.cs" /> 177 180 <Compile Include="Interfaces\Regression\IRegressionEnsembleModel.cs"> 178 181 <SubType>Code</SubType> -
stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ConfidenceBoundRegressionSolution.cs
r14096 r14166 30 30 /// </summary> 31 31 [StorableClass] 32 public class Confidence BoundRegressionSolution : RegressionSolution, IConfidenceBoundRegressionSolution {32 public class ConfidenceRegressionSolution : RegressionSolution, IConfidenceRegressionSolution { 33 33 protected readonly Dictionary<int, double> varianceEvaluationCache; 34 34 35 public new IConfidence BoundRegressionModel Model {36 get { return (IConfidence BoundRegressionModel)base.Model; }35 public new IConfidenceRegressionModel Model { 36 get { return (IConfidenceRegressionModel)base.Model; } 37 37 set { base.Model = value; } 38 38 } 39 39 40 40 [StorableConstructor] 41 protected Confidence BoundRegressionSolution(bool deserializing)41 protected ConfidenceRegressionSolution(bool deserializing) 42 42 : base(deserializing) { 43 43 varianceEvaluationCache = new Dictionary<int, double>(); 44 44 } 45 protected Confidence BoundRegressionSolution(ConfidenceBoundRegressionSolution original, Cloner cloner)45 protected ConfidenceRegressionSolution(ConfidenceRegressionSolution original, Cloner cloner) 46 46 : base(original, cloner) { 47 47 varianceEvaluationCache = new Dictionary<int, double>(original.varianceEvaluationCache); 48 48 } 49 public Confidence BoundRegressionSolution(IConfidenceBoundRegressionModel model, IRegressionProblemData problemData)49 public ConfidenceRegressionSolution(IConfidenceRegressionModel model, IRegressionProblemData problemData) 50 50 : base(model, problemData) { 51 51 varianceEvaluationCache = new Dictionary<int, double>(problemData.Dataset.Rows); … … 53 53 54 54 public override IDeepCloneable Clone(Cloner cloner) { 55 return new Confidence BoundRegressionSolution(this, cloner);55 return new ConfidenceRegressionSolution(this, cloner); 56 56 } 57 57 -
stable/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionModel.cs
r14027 r14166 21 21 22 22 using System.Collections.Generic; 23 23 24 namespace HeuristicLab.Problems.DataAnalysis { 24 25 public interface IRegressionModel : IDataAnalysisModel { -
stable/HeuristicLab.Tests
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Tests merged: 14096
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Tests/HeuristicLab.Algorithms.DataAnalysis-3.4/GaussianProcessModelTest.cs
r12009 r14166 66 66 Assert.AreEqual(347.9993, predTrain[1], 1e-3); 67 67 68 var predTrainVar = model.GetEstimatedVariance (problemData.Dataset, problemData.TrainingIndices).ToArray();68 var predTrainVar = model.GetEstimatedVariances(problemData.Dataset, problemData.TrainingIndices).ToArray(); 69 69 } 70 70
Note: See TracChangeset
for help on using the changeset viewer.