Changeset 17920
- Timestamp:
- 03/29/21 19:29:08 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls/PartialDependencePlot.cs
r17775 r17920 530 530 531 531 public async Task AddSolutionAsync(IRegressionSolution solution) { 532 if (solutions.Contains(solution)) 533 return; 532 534 if (!SolutionsCompatible(solutions.Concat(new[] { solution }))) 533 535 throw new ArgumentException("The solution is not compatible with the problem data."); 534 if (solutions.Contains(solution))535 return;536 536 537 537 solutions.Add(solution); … … 568 568 var refSolution = solutions.First(); 569 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()); 570 572 foreach (var solution in solutions.Skip(1)) { 571 573 var variables1 = solution.ProblemData.Dataset.VariableNames; … … 574 576 575 577 foreach (var factorVar in variables1.Where(solution.ProblemData.Dataset.VariableHasType<string>)) { 576 var distinctVals = refSolution.ProblemData.Dataset.GetStringValues(factorVar).Distinct();577 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; 578 580 } 579 581 }
Note: See TracChangeset
for help on using the changeset viewer.