- Timestamp:
- 04/14/21 09:55:41 (4 years ago)
- Location:
- trunk/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls/FactorPartialDependencePlot.cs
r17180 r17939 222 222 if (updateOnFinish) 223 223 Update(); 224 } catch (OperationCanceledException) { 224 } catch (OperationCanceledException) { 225 225 } catch (AggregateException ae) { 226 226 if (!ae.InnerExceptions.Any(e => e is OperationCanceledException)) … … 434 434 var refSolution = solutions.First(); 435 435 var refSolVars = refSolution.ProblemData.Dataset.VariableNames; 436 var refFactorVars = refSolution.ProblemData.Dataset.StringVariables; 437 var distinctVals = refFactorVars.ToDictionary(fv => fv, fv => refSolution.ProblemData.Dataset.GetStringValues(fv).Distinct().ToArray()); 438 436 439 foreach (var solution in solutions.Skip(1)) { 437 var variables1 = solution.ProblemData.Dataset.VariableNames;438 if (!variables1. All(refSolVars.Contains))440 var variables1 = new HashSet<string>(solution.ProblemData.Dataset.VariableNames); 441 if (!variables1.IsSubsetOf(refSolVars)) 439 442 return false; 440 443 441 foreach (var factorVar in variables1.Where(solution.ProblemData.Dataset.VariableHasType<string>)) { 442 var distinctVals = refSolution.ProblemData.Dataset.GetStringValues(factorVar).Distinct(); 443 if (solution.ProblemData.Dataset.GetStringValues(factorVar).Any(val => !distinctVals.Contains(val))) return false; 444 foreach (var factorVar in solution.ProblemData.Dataset.StringVariables) { 445 var refValues = distinctVals[factorVar]; 446 var values = new HashSet<string>(solution.ProblemData.Dataset.GetStringValues(factorVar)); 447 448 if (!values.IsSubsetOf(refValues)) 449 return false; 444 450 } 445 451 } -
trunk/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls/PartialDependencePlot.cs
r17920 r17939 568 568 var refSolution = solutions.First(); 569 569 var refSolVars = refSolution.ProblemData.Dataset.VariableNames; 570 var refFactorVars = refSol Vars.Where(refSolution.ProblemData.Dataset.VariableHasType<string>);570 var refFactorVars = refSolution.ProblemData.Dataset.StringVariables; 571 571 var distinctVals = refFactorVars.ToDictionary(fv => fv, fv => refSolution.ProblemData.Dataset.GetStringValues(fv).Distinct().ToArray()); 572 572 573 foreach (var solution in solutions.Skip(1)) { 573 var variables1 = solution.ProblemData.Dataset.VariableNames;574 if (!variables1. All(refSolVars.Contains))574 var variables1 = new HashSet<string>(solution.ProblemData.Dataset.VariableNames); 575 if (!variables1.IsSubsetOf(refSolVars)) 575 576 return false; 576 577 577 foreach (var factorVar in variables1.Where(solution.ProblemData.Dataset.VariableHasType<string>)) {578 foreach (var factorVar in solution.ProblemData.Dataset.StringVariables) { 578 579 var refValues = distinctVals[factorVar]; 579 if (solution.ProblemData.Dataset.GetStringValues(factorVar).Distinct().Any(val => !refValues.Contains(val))) return false; 580 var values = new HashSet<string>(solution.ProblemData.Dataset.GetStringValues(factorVar)); 581 582 if (!values.IsSubsetOf(refValues)) 583 return false; 580 584 } 581 585 }
Note: See TracChangeset
for help on using the changeset viewer.