- Timestamp:
- 04/26/16 13:07:26 (9 years ago)
- Location:
- branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/PerformanceModelingView.Designer.cs
r13794 r13797 56 56 this.crossvalidationTabPage = new System.Windows.Forms.TabPage(); 57 57 this.kendallsTauLabel = new System.Windows.Forms.Label(); 58 this.predictedLabel = new System.Windows.Forms.Label(); 59 this.actualLabel = new System.Windows.Forms.Label(); 60 this.absoluteLogErrorLabel = new System.Windows.Forms.Label(); 58 61 this.absoluteErrorLabel = new System.Windows.Forms.Label(); 59 62 this.kendallsTauView = new HeuristicLab.Data.Views.StringConvertibleValueView(); 63 this.absoluteLogErrorView = new HeuristicLab.Data.Views.StringConvertibleValueView(); 60 64 this.absoluteErrorView = new HeuristicLab.Data.Views.StringConvertibleValueView(); 61 65 this.confusionMatrixView = new HeuristicLab.Data.Views.StringConvertibleMatrixView(); … … 63 67 this.minTargetView = new HeuristicLab.Data.Views.StringConvertibleValueView(); 64 68 this.minimumTargetLabel = new System.Windows.Forms.Label(); 65 this.actualLabel = new System.Windows.Forms.Label();66 this.predictedLabel = new System.Windows.Forms.Label();67 69 this.tabControl.SuspendLayout(); 68 70 this.characteristicsTabPage.SuspendLayout(); … … 111 113 this.tabControl.Name = "tabControl"; 112 114 this.tabControl.SelectedIndex = 0; 113 this.tabControl.Size = new System.Drawing.Size( 817, 509);115 this.tabControl.Size = new System.Drawing.Size(960, 509); 114 116 this.tabControl.TabIndex = 14; 115 117 // … … 121 123 this.characteristicsTabPage.Name = "characteristicsTabPage"; 122 124 this.characteristicsTabPage.Padding = new System.Windows.Forms.Padding(3); 123 this.characteristicsTabPage.Size = new System.Drawing.Size( 692, 324);125 this.characteristicsTabPage.Size = new System.Drawing.Size(952, 483); 124 126 this.characteristicsTabPage.TabIndex = 2; 125 127 this.characteristicsTabPage.Text = "Characteristics"; … … 158 160 this.parametersTabPage.Name = "parametersTabPage"; 159 161 this.parametersTabPage.Padding = new System.Windows.Forms.Padding(3); 160 this.parametersTabPage.Size = new System.Drawing.Size( 692, 324);162 this.parametersTabPage.Size = new System.Drawing.Size(952, 483); 161 163 this.parametersTabPage.TabIndex = 0; 162 164 this.parametersTabPage.Text = "Parameters"; … … 173 175 this.parameterCollectionView.ReadOnly = false; 174 176 this.parameterCollectionView.ShowDetails = true; 175 this.parameterCollectionView.Size = new System.Drawing.Size( 686, 318);177 this.parameterCollectionView.Size = new System.Drawing.Size(946, 477); 176 178 this.parameterCollectionView.TabIndex = 0; 177 179 // … … 181 183 this.crossvalidationTabPage.Controls.Add(this.predictedLabel); 182 184 this.crossvalidationTabPage.Controls.Add(this.actualLabel); 185 this.crossvalidationTabPage.Controls.Add(this.absoluteLogErrorLabel); 183 186 this.crossvalidationTabPage.Controls.Add(this.absoluteErrorLabel); 184 187 this.crossvalidationTabPage.Controls.Add(this.kendallsTauView); 188 this.crossvalidationTabPage.Controls.Add(this.absoluteLogErrorView); 185 189 this.crossvalidationTabPage.Controls.Add(this.absoluteErrorView); 186 190 this.crossvalidationTabPage.Controls.Add(this.confusionMatrixView); … … 189 193 this.crossvalidationTabPage.Name = "crossvalidationTabPage"; 190 194 this.crossvalidationTabPage.Padding = new System.Windows.Forms.Padding(3); 191 this.crossvalidationTabPage.Size = new System.Drawing.Size( 809, 483);195 this.crossvalidationTabPage.Size = new System.Drawing.Size(952, 483); 192 196 this.crossvalidationTabPage.TabIndex = 1; 193 197 this.crossvalidationTabPage.Text = "Crossvalidation"; … … 197 201 // 198 202 this.kendallsTauLabel.AutoSize = true; 199 this.kendallsTauLabel.Location = new System.Drawing.Point(5 36, 110);203 this.kendallsTauLabel.Location = new System.Drawing.Point(519, 165); 200 204 this.kendallsTauLabel.Margin = new System.Windows.Forms.Padding(3); 201 205 this.kendallsTauLabel.Name = "kendallsTauLabel"; … … 204 208 this.kendallsTauLabel.Text = "Mean Kendall\'s Tau:"; 205 209 // 210 // predictedLabel 211 // 212 this.predictedLabel.AutoSize = true; 213 this.predictedLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 214 this.predictedLabel.Location = new System.Drawing.Point(223, 52); 215 this.predictedLabel.Margin = new System.Windows.Forms.Padding(3); 216 this.predictedLabel.Name = "predictedLabel"; 217 this.predictedLabel.Size = new System.Drawing.Size(69, 13); 218 this.predictedLabel.TabIndex = 3; 219 this.predictedLabel.Text = "PREDICTED"; 220 // 221 // actualLabel 222 // 223 this.actualLabel.AutoSize = true; 224 this.actualLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 225 this.actualLabel.Location = new System.Drawing.Point(16, 155); 226 this.actualLabel.Margin = new System.Windows.Forms.Padding(3); 227 this.actualLabel.Name = "actualLabel"; 228 this.actualLabel.Size = new System.Drawing.Size(15, 78); 229 this.actualLabel.TabIndex = 3; 230 this.actualLabel.Text = "A\r\nC\r\nT\r\nU\r\nA\r\nL"; 231 // 232 // absoluteLogErrorLabel 233 // 234 this.absoluteLogErrorLabel.AutoSize = true; 235 this.absoluteLogErrorLabel.Location = new System.Drawing.Point(519, 109); 236 this.absoluteLogErrorLabel.Margin = new System.Windows.Forms.Padding(3); 237 this.absoluteLogErrorLabel.Name = "absoluteLogErrorLabel"; 238 this.absoluteLogErrorLabel.Size = new System.Drawing.Size(127, 13); 239 this.absoluteLogErrorLabel.TabIndex = 3; 240 this.absoluteLogErrorLabel.Text = "Mean Absolute Log Error:"; 241 // 206 242 // absoluteErrorLabel 207 243 // 208 244 this.absoluteErrorLabel.AutoSize = true; 209 this.absoluteErrorLabel.Location = new System.Drawing.Point(5 36, 52);245 this.absoluteErrorLabel.Location = new System.Drawing.Point(519, 52); 210 246 this.absoluteErrorLabel.Margin = new System.Windows.Forms.Padding(3); 211 247 this.absoluteErrorLabel.Name = "absoluteErrorLabel"; … … 219 255 this.kendallsTauView.Content = null; 220 256 this.kendallsTauView.LabelVisible = false; 221 this.kendallsTauView.Location = new System.Drawing.Point(5 20, 129);257 this.kendallsTauView.Location = new System.Drawing.Point(503, 184); 222 258 this.kendallsTauView.Name = "kendallsTauView"; 223 259 this.kendallsTauView.ReadOnly = true; … … 225 261 this.kendallsTauView.TabIndex = 2; 226 262 // 263 // absoluteLogErrorView 264 // 265 this.absoluteLogErrorView.Caption = "StringConvertibleValue View"; 266 this.absoluteLogErrorView.Content = null; 267 this.absoluteLogErrorView.LabelVisible = false; 268 this.absoluteLogErrorView.Location = new System.Drawing.Point(503, 128); 269 this.absoluteLogErrorView.Name = "absoluteLogErrorView"; 270 this.absoluteLogErrorView.ReadOnly = true; 271 this.absoluteLogErrorView.Size = new System.Drawing.Size(194, 21); 272 this.absoluteLogErrorView.TabIndex = 2; 273 // 227 274 // absoluteErrorView 228 275 // … … 230 277 this.absoluteErrorView.Content = null; 231 278 this.absoluteErrorView.LabelVisible = false; 232 this.absoluteErrorView.Location = new System.Drawing.Point(5 20, 71);279 this.absoluteErrorView.Location = new System.Drawing.Point(503, 71); 233 280 this.absoluteErrorView.Name = "absoluteErrorView"; 234 281 this.absoluteErrorView.ReadOnly = true; … … 245 292 this.confusionMatrixView.ShowRowsAndColumnsTextBox = false; 246 293 this.confusionMatrixView.ShowStatisticalInformation = false; 247 this.confusionMatrixView.Size = new System.Drawing.Size(4 77, 363);294 this.confusionMatrixView.Size = new System.Drawing.Size(438, 244); 248 295 this.confusionMatrixView.TabIndex = 1; 249 296 // … … 277 324 this.minimumTargetLabel.TabIndex = 17; 278 325 this.minimumTargetLabel.Text = "Target:"; 279 //280 // actualLabel281 //282 this.actualLabel.AutoSize = true;283 this.actualLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));284 this.actualLabel.Location = new System.Drawing.Point(16, 210);285 this.actualLabel.Margin = new System.Windows.Forms.Padding(3);286 this.actualLabel.Name = "actualLabel";287 this.actualLabel.Size = new System.Drawing.Size(15, 78);288 this.actualLabel.TabIndex = 3;289 this.actualLabel.Text = "A\r\nC\r\nT\r\nU\r\nA\r\nL";290 //291 // predictedLabel292 //293 this.predictedLabel.AutoSize = true;294 this.predictedLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));295 this.predictedLabel.Location = new System.Drawing.Point(241, 52);296 this.predictedLabel.Margin = new System.Windows.Forms.Padding(3);297 this.predictedLabel.Name = "predictedLabel";298 this.predictedLabel.Size = new System.Drawing.Size(69, 13);299 this.predictedLabel.TabIndex = 3;300 this.predictedLabel.Text = "PREDICTED";301 326 // 302 327 // PerformanceModelingView … … 311 336 this.Controls.Add(this.recommendStartButton); 312 337 this.Name = "PerformanceModelingView"; 313 this.Size = new System.Drawing.Size( 817, 539);338 this.Size = new System.Drawing.Size(960, 539); 314 339 this.tabControl.ResumeLayout(false); 315 340 this.characteristicsTabPage.ResumeLayout(false); … … 344 369 private System.Windows.Forms.Label predictedLabel; 345 370 private System.Windows.Forms.Label actualLabel; 371 private System.Windows.Forms.Label absoluteLogErrorLabel; 372 private Data.Views.StringConvertibleValueView absoluteLogErrorView; 346 373 } 347 374 } -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/PerformanceModelingView.cs
r13794 r13797 31 31 using System.Collections.Generic; 32 32 using System.Linq; 33 using System.Threading.Tasks; 33 34 34 35 namespace HeuristicLab.OptimizationExpertSystem { … … 131 132 private void xValidateButton_Click(object sender, EventArgs e) { 132 133 var recommender = (IAlgorithmInstanceRecommender)recommenderComboBox.SelectedItem; 134 var progress = MainForm.AddOperationProgressToView(this, "Performing Leave-one-out Crossvalidation"); 135 136 Task.Factory.StartNew(() => { DoCrossvalidate(recommender, progress); }, TaskCreationOptions.LongRunning); 137 } 138 139 private void DoCrossvalidate(IAlgorithmInstanceRecommender recommender, IProgress progress) { 133 140 var features = characteristics.CheckedItems.Select(x => x.Value.Value).ToArray(); 134 135 141 var trainingSet = Content.ProblemInstances.Where(x => !Content.IsCurrentInstance(x)).ToArray(); 136 142 137 143 var absErr = 0.0; 144 var absLogError = 0.0; 138 145 var confMatrix = new int[6, 6]; 139 146 var tau = 0.0; 140 147 // leave one out crossvalidation 148 var count = 0; 141 149 foreach (var pi in trainingSet) { 150 progress.Status = pi.Name + "..."; 142 151 var model = recommender.TrainModel(trainingSet.Where(x => x != pi).ToArray(), Content, features); 143 152 var predicted = model.GetRanking(pi).ToDictionary(x => x.Key, x => x.Value); 144 153 var observed = Content.GetAlgorithmPerformance(pi); 145 154 absErr += AbsoluteError(observed, predicted); 155 absLogError += AbsoluteLogError(observed, predicted); 146 156 var confMat = ConfusionMatrix(observed, predicted); 147 for (var i = 0; i < confMat.GetLength(0); i++) 157 for (var i = 0; i < confMat.GetLength(0); i++) { 148 158 for (var j = 0; j < confMat.GetLength(1); j++) 149 159 confMatrix[i, j] += confMat[i, j]; 160 } 150 161 tau += KendallsTau(observed, predicted); 151 162 // average NCDG ... relevance determined by clustering (unsuccessful algorithms being penalized with negative relevance) 152 163 // mean reciprocal rank 153 164 // optional: expected reciprocal rank 165 progress.ProgressValue = ++count / (double)trainingSet.Length; 154 166 } 155 167 absErr /= trainingSet.Length; 168 absLogError /= trainingSet.Length; 156 169 tau /= trainingSet.Length; 157 170 158 confusionMatrixView.Content = new IntMatrix(confMatrix);159 171 absoluteErrorView.Content = new DoubleValue(absErr); 172 absoluteLogErrorView.Content = new DoubleValue(absLogError); 173 var description = new[] { "A", "B", "C", "D", "E", "F" }; 174 confusionMatrixView.Content = new IntMatrix(confMatrix) { ColumnNames = description, RowNames = description }; 160 175 kendallsTauView.Content = new DoubleValue(tau); 176 177 progress.Finish(); 161 178 } 162 179 … … 168 185 if (double.IsNaN(actual)) actual = int.MaxValue; 169 186 error += Math.Abs(actual - tuple.Value); 187 } 188 return error; 189 } 190 191 private static double AbsoluteLogError(Dictionary<IAlgorithm, double> performance, Dictionary<IAlgorithm, double> ranking) { 192 var error = 0.0; 193 foreach (var tuple in ranking) { 194 double actual; 195 if (!performance.TryGetValue(tuple.Key, out actual)) continue; 196 if (double.IsNaN(actual)) actual = int.MaxValue; 197 error += Math.Abs(Math.Log10(actual) - Math.Log10(tuple.Value)); 170 198 } 171 199 return error; -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/UnderstandingProblemInstanceView.Designer.cs
r13791 r13797 147 147 this.invPropCheckBox.Checked = true; 148 148 this.invPropCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; 149 this.invPropCheckBox.Location = new System.Drawing.Point(5 15, 8);149 this.invPropCheckBox.Location = new System.Drawing.Point(577, 8); 150 150 this.invPropCheckBox.Name = "invPropCheckBox"; 151 151 this.invPropCheckBox.Size = new System.Drawing.Size(118, 17); … … 158 158 // 159 159 this.colorLabel.AutoSize = true; 160 this.colorLabel.Location = new System.Drawing.Point( 652, 9);160 this.colorLabel.Location = new System.Drawing.Point(714, 9); 161 161 this.colorLabel.Name = "colorLabel"; 162 162 this.colorLabel.Size = new System.Drawing.Size(34, 13); … … 222 222 this.colorComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 223 223 this.colorComboBox.FormattingEnabled = true; 224 this.colorComboBox.Location = new System.Drawing.Point( 692, 6);224 this.colorComboBox.Location = new System.Drawing.Point(754, 6); 225 225 this.colorComboBox.Name = "colorComboBox"; 226 this.colorComboBox.Size = new System.Drawing.Size( 222, 21);226 this.colorComboBox.Size = new System.Drawing.Size(305, 21); 227 227 this.colorComboBox.TabIndex = 13; 228 228 this.colorComboBox.SelectedIndexChanged += new System.EventHandler(this.colorComboBox_SelectedIndexChanged); … … 234 234 this.sizeComboBox.Location = new System.Drawing.Point(287, 6); 235 235 this.sizeComboBox.Name = "sizeComboBox"; 236 this.sizeComboBox.Size = new System.Drawing.Size(2 22, 21);236 this.sizeComboBox.Size = new System.Drawing.Size(271, 21); 237 237 this.sizeComboBox.TabIndex = 13; 238 238 this.sizeComboBox.SelectedIndexChanged += new System.EventHandler(this.SizeComboBoxOnSelectedIndexChanged);
Note: See TracChangeset
for help on using the changeset viewer.