Changeset 12821 for branches/crossvalidation-2434
- Timestamp:
- 07/30/15 19:40:56 (9 years ago)
- Location:
- branches/crossvalidation-2434
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/crossvalidation-2434/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/CrossValidationView.cs
r12800 r12821 62 62 storeAlgorithmInEachRunCheckBox.Checked = true; 63 63 } else { 64 disableUpdateToContent = true; // don't propagate changes from GUI elements back to the content 64 65 Locked = ReadOnly = Content.ExecutionState == ExecutionState.Started; 65 66 workersNumericUpDown.Value = Content.NumberOfWorkers.Value; 66 foldsNumericUpDown.Value = Content.Folds;67 67 samplesStartStringConvertibleValueView.Content = Content.SamplesStart; 68 68 samplesEndStringConvertibleValueView.Content = Content.SamplesEnd; 69 69 UpdateAlgorithmView(); 70 70 UpdateProblemView(); 71 UpdateFolds(); 71 72 runCollectionView.Content = Content.Runs; 72 73 algorithmParameterCollectionView.Content = ((IParameterizedNamedItem)Content).Parameters; … … 74 75 executionTimeTextBox.Text = Content.ExecutionTime.ToString(); 75 76 storeAlgorithmInEachRunCheckBox.Checked = Content.StoreAlgorithmInEachRun; 77 disableUpdateToContent = false; 76 78 } 77 79 } … … 147 149 #region Content Events 148 150 private void Content_AlgorithmChanged(object sender, EventArgs e) { 151 disableUpdateToContent = true; 149 152 UpdateAlgorithmView(); 150 153 UpdateFolds(); 151 154 UpdateProblemView(); 152 155 SetEnabledStateOfControls(); 156 disableUpdateToContent = false; 153 157 } 154 158 private void UpdateAlgorithmView() { … … 162 166 private void Content_ProblemChanged(object sender, EventArgs e) { 163 167 if (Content.Problem != null) Content.Problem.Reset += Content_ProblemReset; 168 disableUpdateToContent = true; 164 169 UpdateFolds(); 165 170 UpdateProblemView(); 166 171 SetEnabledStateOfControls(); 172 disableUpdateToContent = false; 167 173 } 168 174 169 175 private void Content_ProblemReset(object sender, EventArgs e) { 176 disableUpdateToContent = true; 170 177 UpdateFolds(); 178 disableUpdateToContent = false; 171 179 } 172 180 … … 180 188 181 189 private void Content_FoldsChanged(object sender, EventArgs e) { 190 disableUpdateToContent = true; 182 191 UpdateFolds(); 192 disableUpdateToContent = false; 183 193 } 184 194 … … 193 203 partitionVariableComboBox.Items.Clear(); 194 204 partitionVariableComboBox.Items.Add(CrossValidation.NoPartitionVariable); 195 var ds = Content.Problem.ProblemData.Dataset; 196 var rows = Enumerable.Range(Content.SamplesStart.Value, Content.SamplesEnd.Value - Content.SamplesStart.Value); 197 foreach (var variable in Content.Problem.ProblemData.Dataset.DoubleVariables) { 198 if (Content.Problem.ProblemData.AllowedInputVariables.Contains(variable)) continue; 199 int distinctValues = ds.GetDoubleValues(variable, rows).Distinct().Count(); 200 if (distinctValues < 2 || distinctValues > 20) continue; 201 partitionVariableComboBox.Items.Add(variable); 205 if (Content.Problem != null) { 206 var ds = Content.Problem.ProblemData.Dataset; 207 var rows = Enumerable.Range(Content.SamplesStart.Value, Content.SamplesEnd.Value - Content.SamplesStart.Value); 208 foreach (var variable in Content.Problem.ProblemData.Dataset.DoubleVariables) { 209 if (Content.Problem.ProblemData.AllowedInputVariables.Contains(variable)) continue; 210 int distinctValues = ds.GetDoubleValues(variable, rows).Distinct().Count(); 211 if (distinctValues < 2 || distinctValues > 20) continue; 212 partitionVariableComboBox.Items.Add(variable); 213 } 202 214 } 203 215 partitionVariableComboBox.SelectedItem = Content.PartitionVariable; … … 256 268 } 257 269 private void workersNumericUpDown_ValueChanged(object sender, EventArgs e) { 258 if (Content != null )270 if (Content != null && !disableUpdateToContent) 259 271 Content.NumberOfWorkers.Value = (int)workersNumericUpDown.Value; 260 272 } -
branches/crossvalidation-2434/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs
r12814 r12821 91 91 92 92 folds = original.folds; 93 partitionVariable = original.partitionVariable; 93 94 numberOfWorkers = cloner.Clone(original.numberOfWorkers); 94 95 samplesStart = cloner.Clone(original.samplesStart); … … 195 196 } 196 197 197 [Storable]198 198 // folds are either specified explicitly or by a variable from the dataset 199 199 public const string NoPartitionVariable = "<none>"; 200 [Storable] 200 201 private string partitionVariable = NoPartitionVariable; 201 202 public string PartitionVariable {
Note: See TracChangeset
for help on using the changeset viewer.