Changeset 17928 for branches/3026_IntegrationIntoSymSpace/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls
- Timestamp:
- 04/06/21 13:13:32 (4 years ago)
- Location:
- branches/3026_IntegrationIntoSymSpace
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace
- Property svn:mergeinfo changed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.Problems.DataAnalysis.Views
- Property svn:mergeinfo changed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls/PartialDependencePlot.cs
r17180 r17928 36 36 namespace HeuristicLab.Problems.DataAnalysis.Views { 37 37 public partial class PartialDependencePlot : UserControl, IPartialDependencePlot { 38 private ModifiableDataset sharedFixedVariables; // used for sync ronising variable values between charts38 private ModifiableDataset sharedFixedVariables; // used for synchronizing variable values between charts 39 39 private ModifiableDataset internalDataset; // holds the x values for each point drawn 40 40 … … 351 351 352 352 private void RecalculateTrainingLimits(bool initializeAxisRanges) { 353 trainingMin = solutions.Select(s => s.ProblemData.Dataset.GetDoubleValues(freeVariable, s.ProblemData.TrainingIndices).Where(x => !double.IsNaN(x)).Min()).Max(); 354 trainingMax = solutions.Select(s => s.ProblemData.Dataset.GetDoubleValues(freeVariable, s.ProblemData.TrainingIndices).Where(x => !double.IsNaN(x)).Max()).Min(); 353 //Set min and max to the interval ranges 354 trainingMin = solutions.Select(s => s.ProblemData.VariableRanges.GetInterval(freeVariable).LowerBound).Max(); 355 trainingMax = solutions.Select(s => s.ProblemData.VariableRanges.GetInterval(freeVariable).UpperBound).Min(); 355 356 356 357 if (initializeAxisRanges) { … … 438 439 chart.Palette = ChartColorPalette.None; 439 440 440 // Add confidence interval series before its cor esponding series for correct z index441 // Add confidence interval series before its corresponding series for correct z index 441 442 foreach (var solution in solutions) { 442 443 Series ciSeries; … … 529 530 530 531 public async Task AddSolutionAsync(IRegressionSolution solution) { 532 if (solutions.Contains(solution)) 533 return; 531 534 if (!SolutionsCompatible(solutions.Concat(new[] { solution }))) 532 535 throw new ArgumentException("The solution is not compatible with the problem data."); 533 if (solutions.Contains(solution))534 return;535 536 536 537 solutions.Add(solution); … … 567 568 var refSolution = solutions.First(); 568 569 var refSolVars = refSolution.ProblemData.Dataset.VariableNames; 570 var refFactorVars = refSolVars.Where(refSolution.ProblemData.Dataset.VariableHasType<string>); 571 var distinctVals = refFactorVars.ToDictionary(fv => fv, fv => refSolution.ProblemData.Dataset.GetStringValues(fv).Distinct().ToArray()); 569 572 foreach (var solution in solutions.Skip(1)) { 570 573 var variables1 = solution.ProblemData.Dataset.VariableNames; … … 573 576 574 577 foreach (var factorVar in variables1.Where(solution.ProblemData.Dataset.VariableHasType<string>)) { 575 var distinctVals = refSolution.ProblemData.Dataset.GetStringValues(factorVar).Distinct();576 if (solution.ProblemData.Dataset.GetStringValues(factorVar). Any(val => !distinctVals.Contains(val))) return false;578 var refValues = distinctVals[factorVar]; 579 if (solution.ProblemData.Dataset.GetStringValues(factorVar).Distinct().Any(val => !refValues.Contains(val))) return false; 577 580 } 578 581 } … … 645 648 646 649 private void sharedFixedVariables_Reset(object sender, EventArgs e) { 650 RecalculateInternalDataset(); 647 651 var newValue = sharedFixedVariables.GetDoubleValue(FreeVariable, 0); 648 652 VerticalLineAnnotation.X = newValue; 649 UpdateCursor(); // triggers update of InternalDataset653 UpdateCursor(); 650 654 } 651 655
Note: See TracChangeset
for help on using the changeset viewer.