Changeset 16517 for branches/2972_PDPRowSelect/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionPartialDependencePlotView.cs
- Timestamp:
- 01/08/19 14:40:15 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2972_PDPRowSelect/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionPartialDependencePlotView.cs
r16516 r16517 97 97 var problemData = Content.ProblemData; 98 98 99 if (sharedFixedVariables != null) { 100 sharedFixedVariables.ItemChanged -= SharedFixedVariables_ItemChanged; 101 sharedFixedVariables.Reset -= SharedFixedVariables_Reset; 102 } 103 99 104 // Init Y-axis range 100 105 double min = double.MaxValue, max = double.MinValue; … … 120 125 Content.ProblemData.Dataset.VariableNames.Where(v => inputvariables.Contains(v)).ToList(); 121 126 122 // ToDo: set default values with the variableValuesMode123 127 var doubleVariables = allowedInputVariables.Where(problemData.Dataset.VariableHasType<double>); 124 128 var doubleVariableValues = (IEnumerable<IList>)doubleVariables.Select(x => new List<double> { 125 problemData.Dataset.GetDoubleValue s(x, problemData.TrainingIndices).Median()129 problemData.Dataset.GetDoubleValue(x, 0) 126 130 }); 127 131 128 132 var factorVariables = allowedInputVariables.Where(problemData.Dataset.VariableHasType<string>); 129 133 var factorVariableValues = (IEnumerable<IList>)factorVariables.Select(x => new List<string> { 130 MostCommon(problemData.Dataset.GetStringValues(x, problemData.TrainingIndices))134 problemData.Dataset.GetStringValue(x, 0) 131 135 }); 132 136 133 if (sharedFixedVariables != null) {134 sharedFixedVariables.ItemChanged -= SharedFixedVariables_ItemChanged;135 sharedFixedVariables.Reset -= SharedFixedVariables_Reset;136 }137 138 137 sharedFixedVariables = new ModifiableDataset(doubleVariables.Concat(factorVariables), doubleVariableValues.Concat(factorVariableValues)); 139 138 variableValuesModeComboBox.SelectedItem = "Median"; // triggers UpdateVariableValue and changes shardFixedVariables 140 139 141 140 // create controls … … 645 644 return values.GroupBy(x => x).OrderByDescending(g => g.Count()).Select(g => g.Key).First(); 646 645 } 646 647 // ToolTips cannot be shown longer than 5000ms, only by using ToolTip.Show manually 648 // See: https://stackoverflow.com/questions/8225807/c-sharp-tooltip-doesnt-display-long-enough 649 private void variableValuesModeComboBox_MouseHover(object sender, EventArgs e) { 650 string tooltipText = @"Sets each variable to a specific value: 651 Row - Selects the value based on a specified row of the dataset. 652 Mean - Sets the value to the arithmetic mean of the variable. 653 Median - Sets the value to the median of the variable. 654 Most Common - Sets the value to the most common value of the variable (first if multiple). 655 656 Note: For categorical values, the most common value is used when selecting Mean, Median or Most Common."; 657 toolTip.Show(tooltipText, variableValuesModeComboBox, 30000); 658 toolTip.Active = true; 659 } 660 private void variableValuesModeComboBox_MouseLeave(object sender, EventArgs e) { 661 toolTip.Active = false; 662 } 647 663 } 648 664 }
Note: See TracChangeset
for help on using the changeset viewer.