- Timestamp:
- 09/21/09 20:23:47 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 1 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.CEDMA.Core/3.3/ConsoleEditor.cs
r2289 r2375 37 37 private Button openButton; 38 38 private Console console; 39 private VisualMatrix matrix;40 39 41 40 public ConsoleEditor(Console console) { -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherView.Designer.cs
r2290 r2375 29 29 this.inputVariablesLabel = new System.Windows.Forms.Label(); 30 30 this.splitContainer = new System.Windows.Forms.SplitContainer(); 31 this.learningTaskGroupBox = new System.Windows.Forms.GroupBox(); 32 this.autoregressiveLabel = new System.Windows.Forms.Label(); 33 this.classificationRadioButton = new System.Windows.Forms.RadioButton(); 31 34 this.algorithmsListBox = new System.Windows.Forms.CheckedListBox(); 32 this.algorithmsLabel = new System.Windows.Forms.Label(); 35 this.minTimeOffsetLabel = new System.Windows.Forms.Label(); 36 this.minTimeOffsetTextBox = new System.Windows.Forms.TextBox(); 37 this.maxTimeOffsetLabel = new System.Windows.Forms.Label(); 38 this.regressionRadioButton = new System.Windows.Forms.RadioButton(); 39 this.maxTimeOffsetTextBox = new System.Windows.Forms.TextBox(); 40 this.timeSeriesRadioButton = new System.Windows.Forms.RadioButton(); 41 this.autoregressiveCheckBox = new System.Windows.Forms.CheckBox(); 42 this.partitioningGroupBox = new System.Windows.Forms.GroupBox(); 43 this.validationSamplesEndTextBox = new System.Windows.Forms.TextBox(); 44 this.trainingLabel = new System.Windows.Forms.Label(); 45 this.trainingSamplesStartTextBox = new System.Windows.Forms.TextBox(); 46 this.trainingSamplesEndTextBox = new System.Windows.Forms.TextBox(); 47 this.validationLabel = new System.Windows.Forms.Label(); 48 this.testSamplesEndTextBox = new System.Windows.Forms.TextBox(); 49 this.validationSamplesStartTextBox = new System.Windows.Forms.TextBox(); 50 this.testSamplesStartTextBox = new System.Windows.Forms.TextBox(); 51 this.testLabel = new System.Windows.Forms.Label(); 33 52 this.setAllButton = new System.Windows.Forms.Button(); 34 53 this.splitContainer.Panel1.SuspendLayout(); 35 54 this.splitContainer.Panel2.SuspendLayout(); 36 55 this.splitContainer.SuspendLayout(); 56 this.learningTaskGroupBox.SuspendLayout(); 57 this.partitioningGroupBox.SuspendLayout(); 37 58 this.SuspendLayout(); 38 59 // … … 44 65 this.targetVariableList.FormattingEnabled = true; 45 66 this.targetVariableList.HorizontalScrollbar = true; 46 this.targetVariableList.Location = new System.Drawing.Point( 6, 181);67 this.targetVariableList.Location = new System.Drawing.Point(3, 16); 47 68 this.targetVariableList.Name = "targetVariableList"; 48 this.targetVariableList.Size = new System.Drawing.Size( 193, 289);69 this.targetVariableList.Size = new System.Drawing.Size(346, 214); 49 70 this.targetVariableList.TabIndex = 0; 50 71 this.targetVariableList.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.targetVariableList_ItemCheck); … … 60 81 this.inputVariableList.Location = new System.Drawing.Point(2, 16); 61 82 this.inputVariableList.Name = "inputVariableList"; 62 this.inputVariableList.Size = new System.Drawing.Size( 221, 439);83 this.inputVariableList.Size = new System.Drawing.Size(393, 634); 63 84 this.inputVariableList.TabIndex = 1; 64 85 this.inputVariableList.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.inputVariableList_ItemCheck); … … 67 88 // 68 89 this.targetVariablesLabel.AutoSize = true; 69 this.targetVariablesLabel.Location = new System.Drawing.Point( 3, 165);90 this.targetVariablesLabel.Location = new System.Drawing.Point(0, 0); 70 91 this.targetVariablesLabel.Name = "targetVariablesLabel"; 71 92 this.targetVariablesLabel.Size = new System.Drawing.Size(86, 13); … … 90 111 // splitContainer.Panel1 91 112 // 92 this.splitContainer.Panel1.Controls.Add(this. algorithmsListBox);93 this.splitContainer.Panel1.Controls.Add(this. algorithmsLabel);113 this.splitContainer.Panel1.Controls.Add(this.learningTaskGroupBox); 114 this.splitContainer.Panel1.Controls.Add(this.partitioningGroupBox); 94 115 this.splitContainer.Panel1.Controls.Add(this.targetVariablesLabel); 95 116 this.splitContainer.Panel1.Controls.Add(this.targetVariableList); … … 100 121 this.splitContainer.Panel2.Controls.Add(this.inputVariablesLabel); 101 122 this.splitContainer.Panel2.Controls.Add(this.inputVariableList); 102 this.splitContainer.Size = new System.Drawing.Size( 429, 482);103 this.splitContainer.SplitterDistance = 202;123 this.splitContainer.Size = new System.Drawing.Size(754, 688); 124 this.splitContainer.SplitterDistance = 355; 104 125 this.splitContainer.SplitterWidth = 1; 105 126 this.splitContainer.TabIndex = 4; 106 127 // 128 // learningTaskGroupBox 129 // 130 this.learningTaskGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 131 this.learningTaskGroupBox.Controls.Add(this.autoregressiveLabel); 132 this.learningTaskGroupBox.Controls.Add(this.classificationRadioButton); 133 this.learningTaskGroupBox.Controls.Add(this.algorithmsListBox); 134 this.learningTaskGroupBox.Controls.Add(this.minTimeOffsetLabel); 135 this.learningTaskGroupBox.Controls.Add(this.minTimeOffsetTextBox); 136 this.learningTaskGroupBox.Controls.Add(this.maxTimeOffsetLabel); 137 this.learningTaskGroupBox.Controls.Add(this.regressionRadioButton); 138 this.learningTaskGroupBox.Controls.Add(this.maxTimeOffsetTextBox); 139 this.learningTaskGroupBox.Controls.Add(this.timeSeriesRadioButton); 140 this.learningTaskGroupBox.Controls.Add(this.autoregressiveCheckBox); 141 this.learningTaskGroupBox.Enabled = false; 142 this.learningTaskGroupBox.Location = new System.Drawing.Point(6, 236); 143 this.learningTaskGroupBox.Name = "learningTaskGroupBox"; 144 this.learningTaskGroupBox.Size = new System.Drawing.Size(343, 321); 145 this.learningTaskGroupBox.TabIndex = 36; 146 this.learningTaskGroupBox.TabStop = false; 147 this.learningTaskGroupBox.Text = "Learning task"; 148 // 149 // autoregressiveLabel 150 // 151 this.autoregressiveLabel.AutoSize = true; 152 this.autoregressiveLabel.Enabled = false; 153 this.autoregressiveLabel.Location = new System.Drawing.Point(45, 83); 154 this.autoregressiveLabel.Name = "autoregressiveLabel"; 155 this.autoregressiveLabel.Size = new System.Drawing.Size(80, 13); 156 this.autoregressiveLabel.TabIndex = 35; 157 this.autoregressiveLabel.Text = "Autoregressive:"; 158 // 159 // classificationRadioButton 160 // 161 this.classificationRadioButton.AutoSize = true; 162 this.classificationRadioButton.Location = new System.Drawing.Point(6, 16); 163 this.classificationRadioButton.Name = "classificationRadioButton"; 164 this.classificationRadioButton.Size = new System.Drawing.Size(86, 17); 165 this.classificationRadioButton.TabIndex = 28; 166 this.classificationRadioButton.Text = "Classification"; 167 this.classificationRadioButton.UseVisualStyleBackColor = true; 168 this.classificationRadioButton.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChanged); 169 // 107 170 // algorithmsListBox 108 171 // 109 this.algorithmsListBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 172 this.algorithmsListBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 173 | System.Windows.Forms.AnchorStyles.Left) 110 174 | System.Windows.Forms.AnchorStyles.Right))); 175 this.algorithmsListBox.Enabled = false; 111 176 this.algorithmsListBox.FormattingEnabled = true; 112 177 this.algorithmsListBox.HorizontalScrollbar = true; 113 this.algorithmsListBox.Location = new System.Drawing.Point(6, 1 6);178 this.algorithmsListBox.Location = new System.Drawing.Point(6, 155); 114 179 this.algorithmsListBox.Name = "algorithmsListBox"; 115 this.algorithmsListBox.Size = new System.Drawing.Size( 193, 139);180 this.algorithmsListBox.Size = new System.Drawing.Size(331, 154); 116 181 this.algorithmsListBox.TabIndex = 4; 117 182 this.algorithmsListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.algorithmsListBox_ItemCheck); 118 183 // 119 // algorithmsLabel 120 // 121 this.algorithmsLabel.AutoSize = true; 122 this.algorithmsLabel.Location = new System.Drawing.Point(3, 0); 123 this.algorithmsLabel.Name = "algorithmsLabel"; 124 this.algorithmsLabel.Size = new System.Drawing.Size(58, 13); 125 this.algorithmsLabel.TabIndex = 3; 126 this.algorithmsLabel.Text = "Algorithms:"; 184 // minTimeOffsetLabel 185 // 186 this.minTimeOffsetLabel.AutoSize = true; 187 this.minTimeOffsetLabel.Enabled = false; 188 this.minTimeOffsetLabel.Location = new System.Drawing.Point(38, 106); 189 this.minTimeOffsetLabel.Name = "minTimeOffsetLabel"; 190 this.minTimeOffsetLabel.Size = new System.Drawing.Size(87, 13); 191 this.minTimeOffsetLabel.TabIndex = 31; 192 this.minTimeOffsetLabel.Text = "Min. Time Offset:"; 193 // 194 // minTimeOffsetTextBox 195 // 196 this.minTimeOffsetTextBox.Enabled = false; 197 this.minTimeOffsetTextBox.Location = new System.Drawing.Point(131, 103); 198 this.minTimeOffsetTextBox.Name = "minTimeOffsetTextBox"; 199 this.minTimeOffsetTextBox.Size = new System.Drawing.Size(96, 20); 200 this.minTimeOffsetTextBox.TabIndex = 32; 201 this.minTimeOffsetTextBox.Validated += new System.EventHandler(this.timeOffsetTextBox_Validated); 202 this.minTimeOffsetTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.timeOffsetTextBox_Validating); 203 // 204 // maxTimeOffsetLabel 205 // 206 this.maxTimeOffsetLabel.AutoSize = true; 207 this.maxTimeOffsetLabel.Enabled = false; 208 this.maxTimeOffsetLabel.Location = new System.Drawing.Point(35, 132); 209 this.maxTimeOffsetLabel.Name = "maxTimeOffsetLabel"; 210 this.maxTimeOffsetLabel.Size = new System.Drawing.Size(90, 13); 211 this.maxTimeOffsetLabel.TabIndex = 33; 212 this.maxTimeOffsetLabel.Text = "Max. Time Offset:"; 213 // 214 // regressionRadioButton 215 // 216 this.regressionRadioButton.AutoSize = true; 217 this.regressionRadioButton.Location = new System.Drawing.Point(6, 39); 218 this.regressionRadioButton.Name = "regressionRadioButton"; 219 this.regressionRadioButton.Size = new System.Drawing.Size(78, 17); 220 this.regressionRadioButton.TabIndex = 29; 221 this.regressionRadioButton.Text = "Regression"; 222 this.regressionRadioButton.UseVisualStyleBackColor = true; 223 this.regressionRadioButton.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChanged); 224 // 225 // maxTimeOffsetTextBox 226 // 227 this.maxTimeOffsetTextBox.Enabled = false; 228 this.maxTimeOffsetTextBox.Location = new System.Drawing.Point(131, 129); 229 this.maxTimeOffsetTextBox.Name = "maxTimeOffsetTextBox"; 230 this.maxTimeOffsetTextBox.Size = new System.Drawing.Size(96, 20); 231 this.maxTimeOffsetTextBox.TabIndex = 34; 232 this.maxTimeOffsetTextBox.Validated += new System.EventHandler(this.timeOffsetTextBox_Validated); 233 this.maxTimeOffsetTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.timeOffsetTextBox_Validating); 234 // 235 // timeSeriesRadioButton 236 // 237 this.timeSeriesRadioButton.AutoSize = true; 238 this.timeSeriesRadioButton.Location = new System.Drawing.Point(6, 62); 239 this.timeSeriesRadioButton.Name = "timeSeriesRadioButton"; 240 this.timeSeriesRadioButton.Size = new System.Drawing.Size(119, 17); 241 this.timeSeriesRadioButton.TabIndex = 30; 242 this.timeSeriesRadioButton.Text = "Time series forecast"; 243 this.timeSeriesRadioButton.UseVisualStyleBackColor = true; 244 this.timeSeriesRadioButton.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChanged); 245 // 246 // autoregressiveCheckBox 247 // 248 this.autoregressiveCheckBox.Anchor = System.Windows.Forms.AnchorStyles.Top; 249 this.autoregressiveCheckBox.AutoSize = true; 250 this.autoregressiveCheckBox.Enabled = false; 251 this.autoregressiveCheckBox.Location = new System.Drawing.Point(139, 83); 252 this.autoregressiveCheckBox.Name = "autoregressiveCheckBox"; 253 this.autoregressiveCheckBox.Size = new System.Drawing.Size(15, 14); 254 this.autoregressiveCheckBox.TabIndex = 22; 255 this.autoregressiveCheckBox.UseVisualStyleBackColor = true; 256 this.autoregressiveCheckBox.CheckedChanged += new System.EventHandler(this.autoregressiveCheckBox_CheckedChanged); 257 // 258 // partitioningGroupBox 259 // 260 this.partitioningGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 261 this.partitioningGroupBox.Controls.Add(this.validationSamplesEndTextBox); 262 this.partitioningGroupBox.Controls.Add(this.trainingLabel); 263 this.partitioningGroupBox.Controls.Add(this.trainingSamplesStartTextBox); 264 this.partitioningGroupBox.Controls.Add(this.trainingSamplesEndTextBox); 265 this.partitioningGroupBox.Controls.Add(this.validationLabel); 266 this.partitioningGroupBox.Controls.Add(this.testSamplesEndTextBox); 267 this.partitioningGroupBox.Controls.Add(this.validationSamplesStartTextBox); 268 this.partitioningGroupBox.Controls.Add(this.testSamplesStartTextBox); 269 this.partitioningGroupBox.Controls.Add(this.testLabel); 270 this.partitioningGroupBox.Enabled = false; 271 this.partitioningGroupBox.Location = new System.Drawing.Point(6, 563); 272 this.partitioningGroupBox.Name = "partitioningGroupBox"; 273 this.partitioningGroupBox.Size = new System.Drawing.Size(343, 122); 274 this.partitioningGroupBox.TabIndex = 26; 275 this.partitioningGroupBox.TabStop = false; 276 this.partitioningGroupBox.Text = "Data set partitions:"; 277 // 278 // validationSamplesEndTextBox 279 // 280 this.validationSamplesEndTextBox.Location = new System.Drawing.Point(221, 43); 281 this.validationSamplesEndTextBox.Name = "validationSamplesEndTextBox"; 282 this.validationSamplesEndTextBox.Size = new System.Drawing.Size(96, 20); 283 this.validationSamplesEndTextBox.TabIndex = 13; 284 this.validationSamplesEndTextBox.Validated += new System.EventHandler(this.samplesTextBox_Validated); 285 this.validationSamplesEndTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.samplesTextBox_Validating); 286 // 287 // trainingLabel 288 // 289 this.trainingLabel.AutoSize = true; 290 this.trainingLabel.Location = new System.Drawing.Point(13, 20); 291 this.trainingLabel.Name = "trainingLabel"; 292 this.trainingLabel.Size = new System.Drawing.Size(89, 13); 293 this.trainingLabel.TabIndex = 3; 294 this.trainingLabel.Text = "Training samples:"; 295 // 296 // trainingSamplesStartTextBox 297 // 298 this.trainingSamplesStartTextBox.Location = new System.Drawing.Point(119, 17); 299 this.trainingSamplesStartTextBox.Name = "trainingSamplesStartTextBox"; 300 this.trainingSamplesStartTextBox.Size = new System.Drawing.Size(96, 20); 301 this.trainingSamplesStartTextBox.TabIndex = 4; 302 this.trainingSamplesStartTextBox.Validated += new System.EventHandler(this.samplesTextBox_Validated); 303 this.trainingSamplesStartTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.samplesTextBox_Validating); 304 // 305 // trainingSamplesEndTextBox 306 // 307 this.trainingSamplesEndTextBox.Location = new System.Drawing.Point(221, 17); 308 this.trainingSamplesEndTextBox.Name = "trainingSamplesEndTextBox"; 309 this.trainingSamplesEndTextBox.Size = new System.Drawing.Size(96, 20); 310 this.trainingSamplesEndTextBox.TabIndex = 10; 311 this.trainingSamplesEndTextBox.Validated += new System.EventHandler(this.samplesTextBox_Validated); 312 this.trainingSamplesEndTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.samplesTextBox_Validating); 313 // 314 // validationLabel 315 // 316 this.validationLabel.AutoSize = true; 317 this.validationLabel.Location = new System.Drawing.Point(5, 46); 318 this.validationLabel.Name = "validationLabel"; 319 this.validationLabel.Size = new System.Drawing.Size(97, 13); 320 this.validationLabel.TabIndex = 11; 321 this.validationLabel.Text = "Validation samples:"; 322 // 323 // testSamplesEndTextBox 324 // 325 this.testSamplesEndTextBox.Location = new System.Drawing.Point(221, 68); 326 this.testSamplesEndTextBox.Name = "testSamplesEndTextBox"; 327 this.testSamplesEndTextBox.Size = new System.Drawing.Size(96, 20); 328 this.testSamplesEndTextBox.TabIndex = 16; 329 this.testSamplesEndTextBox.Validated += new System.EventHandler(this.samplesTextBox_Validated); 330 this.testSamplesEndTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.samplesTextBox_Validating); 331 // 332 // validationSamplesStartTextBox 333 // 334 this.validationSamplesStartTextBox.Location = new System.Drawing.Point(119, 43); 335 this.validationSamplesStartTextBox.Name = "validationSamplesStartTextBox"; 336 this.validationSamplesStartTextBox.Size = new System.Drawing.Size(96, 20); 337 this.validationSamplesStartTextBox.TabIndex = 12; 338 this.validationSamplesStartTextBox.Validated += new System.EventHandler(this.samplesTextBox_Validated); 339 this.validationSamplesStartTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.samplesTextBox_Validating); 340 // 341 // testSamplesStartTextBox 342 // 343 this.testSamplesStartTextBox.Location = new System.Drawing.Point(119, 68); 344 this.testSamplesStartTextBox.Name = "testSamplesStartTextBox"; 345 this.testSamplesStartTextBox.Size = new System.Drawing.Size(96, 20); 346 this.testSamplesStartTextBox.TabIndex = 15; 347 this.testSamplesStartTextBox.Validated += new System.EventHandler(this.samplesTextBox_Validated); 348 this.testSamplesStartTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.samplesTextBox_Validating); 349 // 350 // testLabel 351 // 352 this.testLabel.AutoSize = true; 353 this.testLabel.Location = new System.Drawing.Point(30, 71); 354 this.testLabel.Name = "testLabel"; 355 this.testLabel.Size = new System.Drawing.Size(72, 13); 356 this.testLabel.TabIndex = 14; 357 this.testLabel.Text = "Test samples:"; 127 358 // 128 359 // setAllButton 129 360 // 130 361 this.setAllButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 131 this.setAllButton.Location = new System.Drawing.Point(3, 456);362 this.setAllButton.Location = new System.Drawing.Point(3, 662); 132 363 this.setAllButton.Name = "setAllButton"; 133 364 this.setAllButton.Size = new System.Drawing.Size(91, 23); … … 143 374 this.Controls.Add(this.splitContainer); 144 375 this.Name = "DispatcherView"; 145 this.Size = new System.Drawing.Size( 429, 482);376 this.Size = new System.Drawing.Size(754, 688); 146 377 this.splitContainer.Panel1.ResumeLayout(false); 147 378 this.splitContainer.Panel1.PerformLayout(); … … 149 380 this.splitContainer.Panel2.PerformLayout(); 150 381 this.splitContainer.ResumeLayout(false); 382 this.learningTaskGroupBox.ResumeLayout(false); 383 this.learningTaskGroupBox.PerformLayout(); 384 this.partitioningGroupBox.ResumeLayout(false); 385 this.partitioningGroupBox.PerformLayout(); 151 386 this.ResumeLayout(false); 152 387 … … 162 397 private System.Windows.Forms.Button setAllButton; 163 398 private System.Windows.Forms.CheckedListBox algorithmsListBox; 164 private System.Windows.Forms.Label algorithmsLabel; 399 private System.Windows.Forms.GroupBox partitioningGroupBox; 400 private System.Windows.Forms.TextBox validationSamplesEndTextBox; 401 private System.Windows.Forms.Label trainingLabel; 402 private System.Windows.Forms.TextBox trainingSamplesStartTextBox; 403 private System.Windows.Forms.TextBox trainingSamplesEndTextBox; 404 private System.Windows.Forms.Label validationLabel; 405 private System.Windows.Forms.TextBox testSamplesEndTextBox; 406 private System.Windows.Forms.TextBox validationSamplesStartTextBox; 407 private System.Windows.Forms.TextBox testSamplesStartTextBox; 408 private System.Windows.Forms.Label testLabel; 409 private System.Windows.Forms.GroupBox learningTaskGroupBox; 410 private System.Windows.Forms.Label autoregressiveLabel; 411 private System.Windows.Forms.RadioButton classificationRadioButton; 412 private System.Windows.Forms.Label minTimeOffsetLabel; 413 private System.Windows.Forms.TextBox minTimeOffsetTextBox; 414 private System.Windows.Forms.Label maxTimeOffsetLabel; 415 private System.Windows.Forms.RadioButton regressionRadioButton; 416 private System.Windows.Forms.TextBox maxTimeOffsetTextBox; 417 private System.Windows.Forms.RadioButton timeSeriesRadioButton; 418 private System.Windows.Forms.CheckBox autoregressiveCheckBox; 165 419 } 166 420 } -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherView.cs
r2290 r2375 8 8 using System.Windows.Forms; 9 9 using HeuristicLab.Core; 10 using System.Diagnostics; 10 11 11 12 namespace HeuristicLab.CEDMA.Server { 12 13 public partial class DispatcherView : ViewBase { 13 14 private SimpleDispatcher dispatcher; 15 private ProblemSpecification selectedSpec; 14 16 public DispatcherView(SimpleDispatcher dispatcher) 15 17 : base() { 16 18 this.dispatcher = dispatcher; 17 19 InitializeComponent(); 20 dispatcher.Changed += (sender, args) => UpdateControls(); 18 21 UpdateControls(); 19 dispatcher.Changed += (sender, args) => UpdateControls();20 22 this.inputVariableList.CheckOnClick = true; 21 23 } … … 34 36 } 35 37 36 foreach (string inputVar in dispatcher. InputVariables) {38 foreach (string inputVar in dispatcher.Variables) { 37 39 inputVariableList.Items.Add(inputVar, false); 38 40 } 39 41 40 foreach (HeuristicLab.Modeling.IAlgorithm algo in dispatcher.Algorithms) {41 algorithmsListBox.Items.Add(algo, false);42 }43 42 targetVariableList.ClearSelected(); 44 43 inputVariableList.Enabled = false; … … 55 54 56 55 private void inputVariableList_ItemCheck(object sender, ItemCheckEventArgs e) { 57 string selectedTarget = (string)targetVariableList.SelectedItem;58 56 if (e.NewValue == CheckState.Checked) { 59 dispatcher.EnableInputVariable(selectedTarget,(string)inputVariableList.Items[e.Index]);57 selectedSpec.AddInputVariable((string)inputVariableList.Items[e.Index]); 60 58 } else if (e.NewValue == CheckState.Unchecked) { 61 dispatcher.DisableInputVariable(selectedTarget,(string)inputVariableList.Items[e.Index]);59 selectedSpec.RemoveInputVariable((string)inputVariableList.Items[e.Index]); 62 60 } 63 61 } … … 65 63 private void targetVariableList_SelectedValueChanged(object sender, EventArgs e) { 66 64 string selectedTarget = (string)targetVariableList.SelectedItem; 67 UpdateInputVariableList(selectedTarget); 68 } 69 70 private void UpdateInputVariableList(string target) { 65 selectedSpec = dispatcher.GetProblemSpecification(selectedTarget); 66 UpdateInputVariableList(); 67 UpdateAlgorithms(); 68 } 69 70 private void UpdateAlgorithms() { 71 learningTaskGroupBox.Enabled = true; 72 algorithmsListBox.Enabled = true; 73 switch (selectedSpec.LearningTask) { 74 case LearningTask.Classification: { 75 classificationRadioButton.Checked = true; 76 break; 77 } 78 case LearningTask.Regression: { 79 regressionRadioButton.Checked = true; 80 break; 81 } 82 case LearningTask.TimeSeries: { 83 regressionRadioButton.Checked = true; 84 break; 85 } 86 default: { break; } 87 } 88 algorithmsListBox.Items.Clear(); 89 foreach (HeuristicLab.Modeling.IAlgorithm algo in dispatcher.GetAlgorithms(selectedSpec.LearningTask)) { 90 algorithmsListBox.Items.Add(algo, dispatcher.GetAllowedAlgorithms(selectedSpec.TargetVariable).Contains(algo)); 91 } 92 UpdateAlgorithmConfiguration(); 93 } 94 95 private void UpdateAlgorithmConfiguration() { 96 partitioningGroupBox.Enabled = true; 97 trainingSamplesStartTextBox.Text = selectedSpec.TrainingSamplesStart.ToString(); 98 trainingSamplesEndTextBox.Text = selectedSpec.TrainingSamplesEnd.ToString(); 99 validationSamplesStartTextBox.Text = selectedSpec.ValidationSamplesStart.ToString(); 100 validationSamplesEndTextBox.Text = selectedSpec.ValidationSamplesEnd.ToString(); 101 testSamplesStartTextBox.Text = selectedSpec.TestSamplesStart.ToString(); 102 testSamplesEndTextBox.Text = selectedSpec.TestSamplesEnd.ToString(); 103 } 104 105 private void UpdateInputVariableList() { 71 106 inputVariableList.Items.Clear(); 72 var activatedInputVariables = dispatcher.GetInputVariables(target);73 foreach (string inputVar in dispatcher. InputVariables) {107 var activatedInputVariables = selectedSpec.InputVariables; 108 foreach (string inputVar in dispatcher.Variables) { 74 109 inputVariableList.Items.Add(inputVar, activatedInputVariables.Contains(inputVar)); 75 110 } … … 77 112 } 78 113 79 private void setAllButton_Click(object sender, EventArgs e) { 114 private void setAllButton_Click(object sender, EventArgs e) { 80 115 foreach (string targetVar in dispatcher.TargetVariables) { 116 ProblemSpecification spec = dispatcher.GetProblemSpecification(targetVar); 81 117 for (int i = 0; i < inputVariableList.Items.Count; i++) { 82 118 if (inputVariableList.GetItemChecked(i)) { 83 dispatcher.EnableInputVariable(targetVar,(string)inputVariableList.Items[i]);119 spec.AddInputVariable((string)inputVariableList.Items[i]); 84 120 } else { 85 dispatcher.DisableInputVariable(targetVar,(string)inputVariableList.Items[i]);121 spec.RemoveInputVariable((string)inputVariableList.Items[i]); 86 122 } 87 123 } … … 90 126 91 127 private void algorithmsListBox_ItemCheck(object sender, ItemCheckEventArgs e) { 92 if(e.NewValue == CheckState.Checked) { 93 dispatcher.EnableAlgorithm((HeuristicLab.Modeling.IAlgorithm)algorithmsListBox.Items[e.Index]); 94 } else if(e.NewValue == CheckState.Unchecked) { 95 dispatcher.DisableAlgorithm((HeuristicLab.Modeling.IAlgorithm)algorithmsListBox.Items[e.Index]); 96 } 128 if (e.NewValue == CheckState.Checked) { 129 dispatcher.EnableAlgorithm(selectedSpec.TargetVariable, (HeuristicLab.Modeling.IAlgorithm)algorithmsListBox.Items[e.Index]); 130 } else if (e.NewValue == CheckState.Unchecked) { 131 dispatcher.DisableAlgorithm(selectedSpec.TargetVariable, (HeuristicLab.Modeling.IAlgorithm)algorithmsListBox.Items[e.Index]); 132 } 133 } 134 135 private void radioButton_CheckedChanged(object sender, EventArgs e) { 136 string selectedTarget = (string)targetVariableList.SelectedItem; 137 minTimeOffsetLabel.Enabled = timeSeriesRadioButton.Checked; 138 minTimeOffsetTextBox.Enabled = timeSeriesRadioButton.Checked; 139 maxTimeOffsetLabel.Enabled = timeSeriesRadioButton.Checked; 140 maxTimeOffsetTextBox.Enabled = timeSeriesRadioButton.Checked; 141 autoregressiveCheckBox.Enabled = timeSeriesRadioButton.Checked; 142 autoregressiveLabel.Enabled = timeSeriesRadioButton.Checked; 143 if (timeSeriesRadioButton.Checked) selectedSpec.LearningTask = LearningTask.TimeSeries; 144 else if (classificationRadioButton.Checked) selectedSpec.LearningTask = LearningTask.Classification; 145 else if (regressionRadioButton.Checked) selectedSpec.LearningTask = LearningTask.Regression; 146 UpdateAlgorithms(); 147 } 148 149 private void timeOffsetTextBox_Validating(object sender, CancelEventArgs e) { 150 int min, max; 151 e.Cancel = !int.TryParse(minTimeOffsetTextBox.Text, out min); 152 e.Cancel = !int.TryParse(maxTimeOffsetTextBox.Text, out max); 153 e.Cancel = min > max; 154 } 155 156 private void timeOffsetTextBox_Validated(object sender, EventArgs e) { 157 selectedSpec.MinTimeOffset = int.Parse(minTimeOffsetTextBox.Text); 158 selectedSpec.MaxTimeOffset = int.Parse(maxTimeOffsetTextBox.Text); 159 } 160 161 private void samplesTextBox_Validated(object sender, EventArgs e) { 162 selectedSpec.TrainingSamplesStart = int.Parse(trainingSamplesStartTextBox.Text); 163 selectedSpec.TrainingSamplesEnd = int.Parse(trainingSamplesEndTextBox.Text); 164 selectedSpec.ValidationSamplesStart = int.Parse(validationSamplesStartTextBox.Text); 165 selectedSpec.ValidationSamplesEnd = int.Parse(validationSamplesEndTextBox.Text); 166 selectedSpec.TestSamplesStart = int.Parse(testSamplesStartTextBox.Text); 167 selectedSpec.TestSamplesEnd = int.Parse(testSamplesEndTextBox.Text); 168 } 169 170 private void ColorSamplesTextBoxes(Color color) { 171 trainingSamplesStartTextBox.BackColor = color; 172 trainingSamplesEndTextBox.BackColor = color; 173 validationSamplesStartTextBox.BackColor = color; 174 validationSamplesEndTextBox.BackColor = color; 175 testSamplesStartTextBox.BackColor = color; 176 testSamplesEndTextBox.BackColor = color; 177 } 178 179 private void samplesTextBox_Validating(object sender, CancelEventArgs e) { 180 try { 181 int trainingStart = int.Parse(trainingSamplesStartTextBox.Text); 182 int trainingEnd = int.Parse(trainingSamplesEndTextBox.Text); 183 int validationStart = int.Parse(validationSamplesStartTextBox.Text); 184 int validationEnd = int.Parse(validationSamplesEndTextBox.Text); 185 int testStart = int.Parse(testSamplesStartTextBox.Text); 186 int testEnd = int.Parse(testSamplesEndTextBox.Text); 187 if (trainingStart < 0 || validationStart < 0 || testStart < 0 || 188 trainingEnd >= selectedSpec.Dataset.Rows || validationEnd >= selectedSpec.Dataset.Rows || testEnd >= selectedSpec.Dataset.Rows || 189 trainingStart >= trainingEnd || 190 validationStart >= validationEnd || 191 testStart >= testEnd || 192 IsOverlapping(trainingStart, trainingEnd, validationStart, validationEnd) || 193 IsOverlapping(trainingStart, trainingEnd, testStart, testEnd) || 194 IsOverlapping(validationStart, validationEnd, testStart, testEnd)) 195 ColorSamplesTextBoxes(Color.Red); 196 else 197 ColorSamplesTextBoxes(Color.White); 198 } 199 catch (FormatException) { 200 ColorSamplesTextBoxes(Color.Red); 201 } 202 } 203 204 private void autoregressiveCheckBox_CheckedChanged(object sender, EventArgs e) { 205 selectedSpec.AutoRegressive = autoregressiveCheckBox.Checked; 206 } 207 208 private bool IsOverlapping(int x0, int y0, int x1, int y1) { 209 Trace.Assert(x0 <= y0 && x1 <= y1); 210 int tmp; 211 // make sure that x0,y0 is the left interval 212 if (x1 < x0) { 213 tmp = x1; 214 x1 = x0; 215 x0 = tmp; 216 tmp = y1; 217 y1 = y0; 218 y0 = tmp; 219 } 220 return y0 > x1; 97 221 } 98 222 } -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/HeuristicLab.CEDMA.Server-3.3.csproj
r2290 r2375 91 91 </ItemGroup> 92 92 <ItemGroup> 93 <Compile Include="ProblemSpecification.cs" /> 93 94 <Compile Include="LearningTask.cs" /> 94 <Compile Include="Problem.cs" />95 95 <Compile Include="ProblemView.cs"> 96 96 <SubType>UserControl</SubType> -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/IDispatcher.cs
r2222 r2375 24 24 25 25 namespace HeuristicLab.CEDMA.Server { 26 public interface IDispatcher : IViewable{26 public interface IDispatcher { 27 27 IAlgorithm GetNextJob(); 28 28 } -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/ProblemView.Designer.cs
r2223 r2375 47 47 private void InitializeComponent() { 48 48 this.importButton = new System.Windows.Forms.Button(); 49 this.trainingSamplesStartTextBox = new System.Windows.Forms.TextBox();50 this.trainingLabel = new System.Windows.Forms.Label();51 this.trainingSamplesEndTextBox = new System.Windows.Forms.TextBox();52 this.validationSamplesEndTextBox = new System.Windows.Forms.TextBox();53 this.validationSamplesStartTextBox = new System.Windows.Forms.TextBox();54 this.validationLabel = new System.Windows.Forms.Label();55 this.testSamplesEndTextBox = new System.Windows.Forms.TextBox();56 this.testSamplesStartTextBox = new System.Windows.Forms.TextBox();57 this.testLabel = new System.Windows.Forms.Label();58 this.autoregressiveCheckBox = new System.Windows.Forms.CheckBox();59 this.partitioningGroupBox = new System.Windows.Forms.GroupBox();60 49 this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); 61 this.classificationRadioButton = new System.Windows.Forms.RadioButton(); 62 this.regressionRadioButton = new System.Windows.Forms.RadioButton(); 63 this.timeSeriesRadioButton = new System.Windows.Forms.RadioButton(); 64 this.minTimeOffsetLabel = new System.Windows.Forms.Label(); 65 this.minTimeOffsetTextBox = new System.Windows.Forms.TextBox(); 66 this.learningTaskGroupBox = new System.Windows.Forms.GroupBox(); 67 this.autoregressiveLabel = new System.Windows.Forms.Label(); 68 this.maxTimeOffsetLabel = new System.Windows.Forms.Label(); 69 this.maxTimeOffsetTextBox = new System.Windows.Forms.TextBox(); 70 this.datasetView1 = new HeuristicLab.DataAnalysis.DatasetView(); 71 this.partitioningGroupBox.SuspendLayout(); 72 this.learningTaskGroupBox.SuspendLayout(); 50 this.datasetView = new HeuristicLab.DataAnalysis.DatasetView(); 73 51 this.SuspendLayout(); 74 52 // … … 83 61 this.importButton.Click += new System.EventHandler(this.importButton_Click); 84 62 // 85 // trainingSamplesStartTextBox86 //87 this.trainingSamplesStartTextBox.Location = new System.Drawing.Point(119, 17);88 this.trainingSamplesStartTextBox.Name = "trainingSamplesStartTextBox";89 this.trainingSamplesStartTextBox.Size = new System.Drawing.Size(96, 20);90 this.trainingSamplesStartTextBox.TabIndex = 4;91 this.trainingSamplesStartTextBox.Validated += new System.EventHandler(this.samplesTextBox_Validated);92 this.trainingSamplesStartTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.samplesTextBox_Validating);93 //94 // trainingLabel95 //96 this.trainingLabel.AutoSize = true;97 this.trainingLabel.Location = new System.Drawing.Point(13, 20);98 this.trainingLabel.Name = "trainingLabel";99 this.trainingLabel.Size = new System.Drawing.Size(89, 13);100 this.trainingLabel.TabIndex = 3;101 this.trainingLabel.Text = "Training samples:";102 //103 // trainingSamplesEndTextBox104 //105 this.trainingSamplesEndTextBox.Location = new System.Drawing.Point(221, 17);106 this.trainingSamplesEndTextBox.Name = "trainingSamplesEndTextBox";107 this.trainingSamplesEndTextBox.Size = new System.Drawing.Size(96, 20);108 this.trainingSamplesEndTextBox.TabIndex = 10;109 this.trainingSamplesEndTextBox.Validated += new System.EventHandler(this.samplesTextBox_Validated);110 this.trainingSamplesEndTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.samplesTextBox_Validating);111 //112 // validationSamplesEndTextBox113 //114 this.validationSamplesEndTextBox.Location = new System.Drawing.Point(221, 43);115 this.validationSamplesEndTextBox.Name = "validationSamplesEndTextBox";116 this.validationSamplesEndTextBox.Size = new System.Drawing.Size(96, 20);117 this.validationSamplesEndTextBox.TabIndex = 13;118 this.validationSamplesEndTextBox.Validated += new System.EventHandler(this.samplesTextBox_Validated);119 this.validationSamplesEndTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.samplesTextBox_Validating);120 //121 // validationSamplesStartTextBox122 //123 this.validationSamplesStartTextBox.Location = new System.Drawing.Point(119, 43);124 this.validationSamplesStartTextBox.Name = "validationSamplesStartTextBox";125 this.validationSamplesStartTextBox.Size = new System.Drawing.Size(96, 20);126 this.validationSamplesStartTextBox.TabIndex = 12;127 this.validationSamplesStartTextBox.Validated += new System.EventHandler(this.samplesTextBox_Validated);128 this.validationSamplesStartTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.samplesTextBox_Validating);129 //130 // validationLabel131 //132 this.validationLabel.AutoSize = true;133 this.validationLabel.Location = new System.Drawing.Point(5, 46);134 this.validationLabel.Name = "validationLabel";135 this.validationLabel.Size = new System.Drawing.Size(97, 13);136 this.validationLabel.TabIndex = 11;137 this.validationLabel.Text = "Validation samples:";138 //139 // testSamplesEndTextBox140 //141 this.testSamplesEndTextBox.Location = new System.Drawing.Point(221, 68);142 this.testSamplesEndTextBox.Name = "testSamplesEndTextBox";143 this.testSamplesEndTextBox.Size = new System.Drawing.Size(96, 20);144 this.testSamplesEndTextBox.TabIndex = 16;145 this.testSamplesEndTextBox.Validated += new System.EventHandler(this.samplesTextBox_Validated);146 this.testSamplesEndTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.samplesTextBox_Validating);147 //148 // testSamplesStartTextBox149 //150 this.testSamplesStartTextBox.Location = new System.Drawing.Point(119, 68);151 this.testSamplesStartTextBox.Name = "testSamplesStartTextBox";152 this.testSamplesStartTextBox.Size = new System.Drawing.Size(96, 20);153 this.testSamplesStartTextBox.TabIndex = 15;154 this.testSamplesStartTextBox.Validated += new System.EventHandler(this.samplesTextBox_Validated);155 this.testSamplesStartTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.samplesTextBox_Validating);156 //157 // testLabel158 //159 this.testLabel.AutoSize = true;160 this.testLabel.Location = new System.Drawing.Point(30, 71);161 this.testLabel.Name = "testLabel";162 this.testLabel.Size = new System.Drawing.Size(72, 13);163 this.testLabel.TabIndex = 14;164 this.testLabel.Text = "Test samples:";165 //166 // autoregressiveCheckBox167 //168 this.autoregressiveCheckBox.Anchor = System.Windows.Forms.AnchorStyles.Top;169 this.autoregressiveCheckBox.AutoSize = true;170 this.autoregressiveCheckBox.Enabled = false;171 this.autoregressiveCheckBox.Location = new System.Drawing.Point(131, 83);172 this.autoregressiveCheckBox.Name = "autoregressiveCheckBox";173 this.autoregressiveCheckBox.Size = new System.Drawing.Size(15, 14);174 this.autoregressiveCheckBox.TabIndex = 22;175 this.autoregressiveCheckBox.UseVisualStyleBackColor = true;176 this.autoregressiveCheckBox.CheckedChanged += new System.EventHandler(this.autoregressiveCheckBox_CheckedChanged);177 //178 // partitioningGroupBox179 //180 this.partitioningGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));181 this.partitioningGroupBox.Controls.Add(this.validationSamplesEndTextBox);182 this.partitioningGroupBox.Controls.Add(this.trainingLabel);183 this.partitioningGroupBox.Controls.Add(this.trainingSamplesStartTextBox);184 this.partitioningGroupBox.Controls.Add(this.trainingSamplesEndTextBox);185 this.partitioningGroupBox.Controls.Add(this.validationLabel);186 this.partitioningGroupBox.Controls.Add(this.testSamplesEndTextBox);187 this.partitioningGroupBox.Controls.Add(this.validationSamplesStartTextBox);188 this.partitioningGroupBox.Controls.Add(this.testSamplesStartTextBox);189 this.partitioningGroupBox.Controls.Add(this.testLabel);190 this.partitioningGroupBox.Location = new System.Drawing.Point(3, 452);191 this.partitioningGroupBox.Name = "partitioningGroupBox";192 this.partitioningGroupBox.Size = new System.Drawing.Size(326, 100);193 this.partitioningGroupBox.TabIndex = 25;194 this.partitioningGroupBox.TabStop = false;195 this.partitioningGroupBox.Text = "Data set partitions:";196 //197 63 // openFileDialog 198 64 // … … 202 68 this.openFileDialog.Title = "Import data set from file"; 203 69 // 204 // classificationRadioButton70 // datasetView 205 71 // 206 this.classificationRadioButton.AutoSize = true; 207 this.classificationRadioButton.Checked = true; 208 this.classificationRadioButton.Location = new System.Drawing.Point(6, 16); 209 this.classificationRadioButton.Name = "classificationRadioButton"; 210 this.classificationRadioButton.Size = new System.Drawing.Size(86, 17); 211 this.classificationRadioButton.TabIndex = 28; 212 this.classificationRadioButton.TabStop = true; 213 this.classificationRadioButton.Text = "Classification"; 214 this.classificationRadioButton.UseVisualStyleBackColor = true; 215 this.classificationRadioButton.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChanged); 216 // 217 // regressionRadioButton 218 // 219 this.regressionRadioButton.AutoSize = true; 220 this.regressionRadioButton.Location = new System.Drawing.Point(6, 39); 221 this.regressionRadioButton.Name = "regressionRadioButton"; 222 this.regressionRadioButton.Size = new System.Drawing.Size(78, 17); 223 this.regressionRadioButton.TabIndex = 29; 224 this.regressionRadioButton.Text = "Regression"; 225 this.regressionRadioButton.UseVisualStyleBackColor = true; 226 this.regressionRadioButton.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChanged); 227 // 228 // timeSeriesRadioButton 229 // 230 this.timeSeriesRadioButton.AutoSize = true; 231 this.timeSeriesRadioButton.Location = new System.Drawing.Point(6, 62); 232 this.timeSeriesRadioButton.Name = "timeSeriesRadioButton"; 233 this.timeSeriesRadioButton.Size = new System.Drawing.Size(119, 17); 234 this.timeSeriesRadioButton.TabIndex = 30; 235 this.timeSeriesRadioButton.Text = "Time series forecast"; 236 this.timeSeriesRadioButton.UseVisualStyleBackColor = true; 237 this.timeSeriesRadioButton.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChanged); 238 // 239 // minTimeOffsetLabel 240 // 241 this.minTimeOffsetLabel.AutoSize = true; 242 this.minTimeOffsetLabel.Enabled = false; 243 this.minTimeOffsetLabel.Location = new System.Drawing.Point(38, 106); 244 this.minTimeOffsetLabel.Name = "minTimeOffsetLabel"; 245 this.minTimeOffsetLabel.Size = new System.Drawing.Size(87, 13); 246 this.minTimeOffsetLabel.TabIndex = 31; 247 this.minTimeOffsetLabel.Text = "Min. Time Offset:"; 248 // 249 // minTimeOffsetTextBox 250 // 251 this.minTimeOffsetTextBox.Enabled = false; 252 this.minTimeOffsetTextBox.Location = new System.Drawing.Point(131, 103); 253 this.minTimeOffsetTextBox.Name = "minTimeOffsetTextBox"; 254 this.minTimeOffsetTextBox.Size = new System.Drawing.Size(96, 20); 255 this.minTimeOffsetTextBox.TabIndex = 32; 256 this.minTimeOffsetTextBox.Validated += new System.EventHandler(this.timeOffsetTextBox_Validated); 257 this.minTimeOffsetTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.timeOffsetTextBox_Validating); 258 // 259 // learningTaskGroupBox 260 // 261 this.learningTaskGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 262 this.learningTaskGroupBox.Controls.Add(this.autoregressiveLabel); 263 this.learningTaskGroupBox.Controls.Add(this.classificationRadioButton); 264 this.learningTaskGroupBox.Controls.Add(this.minTimeOffsetLabel); 265 this.learningTaskGroupBox.Controls.Add(this.minTimeOffsetTextBox); 266 this.learningTaskGroupBox.Controls.Add(this.maxTimeOffsetLabel); 267 this.learningTaskGroupBox.Controls.Add(this.regressionRadioButton); 268 this.learningTaskGroupBox.Controls.Add(this.maxTimeOffsetTextBox); 269 this.learningTaskGroupBox.Controls.Add(this.timeSeriesRadioButton); 270 this.learningTaskGroupBox.Controls.Add(this.autoregressiveCheckBox); 271 this.learningTaskGroupBox.Location = new System.Drawing.Point(335, 452); 272 this.learningTaskGroupBox.Name = "learningTaskGroupBox"; 273 this.learningTaskGroupBox.Size = new System.Drawing.Size(326, 163); 274 this.learningTaskGroupBox.TabIndex = 35; 275 this.learningTaskGroupBox.TabStop = false; 276 this.learningTaskGroupBox.Text = "Learning task"; 277 // 278 // autoregressiveLabel 279 // 280 this.autoregressiveLabel.AutoSize = true; 281 this.autoregressiveLabel.Enabled = false; 282 this.autoregressiveLabel.Location = new System.Drawing.Point(45, 83); 283 this.autoregressiveLabel.Name = "autoregressiveLabel"; 284 this.autoregressiveLabel.Size = new System.Drawing.Size(80, 13); 285 this.autoregressiveLabel.TabIndex = 35; 286 this.autoregressiveLabel.Text = "Autoregressive:"; 287 // 288 // maxTimeOffsetLabel 289 // 290 this.maxTimeOffsetLabel.AutoSize = true; 291 this.maxTimeOffsetLabel.Enabled = false; 292 this.maxTimeOffsetLabel.Location = new System.Drawing.Point(35, 132); 293 this.maxTimeOffsetLabel.Name = "maxTimeOffsetLabel"; 294 this.maxTimeOffsetLabel.Size = new System.Drawing.Size(90, 13); 295 this.maxTimeOffsetLabel.TabIndex = 33; 296 this.maxTimeOffsetLabel.Text = "Max. Time Offset:"; 297 // 298 // maxTimeOffsetTextBox 299 // 300 this.maxTimeOffsetTextBox.Enabled = false; 301 this.maxTimeOffsetTextBox.Location = new System.Drawing.Point(131, 129); 302 this.maxTimeOffsetTextBox.Name = "maxTimeOffsetTextBox"; 303 this.maxTimeOffsetTextBox.Size = new System.Drawing.Size(96, 20); 304 this.maxTimeOffsetTextBox.TabIndex = 34; 305 this.maxTimeOffsetTextBox.Validated += new System.EventHandler(this.timeOffsetTextBox_Validated); 306 this.maxTimeOffsetTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.timeOffsetTextBox_Validating); 307 // 308 // datasetView1 309 // 310 this.datasetView1.Location = new System.Drawing.Point(3, 32); 311 this.datasetView1.Name = "datasetView1"; 312 this.datasetView1.Size = new System.Drawing.Size(770, 414); 313 this.datasetView1.TabIndex = 36; 72 this.datasetView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 73 | System.Windows.Forms.AnchorStyles.Left) 74 | System.Windows.Forms.AnchorStyles.Right))); 75 this.datasetView.Caption = "Editor"; 76 this.datasetView.Dataset = null; 77 this.datasetView.Filename = null; 78 this.datasetView.Location = new System.Drawing.Point(3, 32); 79 this.datasetView.Name = "datasetView"; 80 this.datasetView.Size = new System.Drawing.Size(770, 580); 81 this.datasetView.TabIndex = 36; 314 82 // 315 83 // ProblemView … … 317 85 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 318 86 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 319 this.Controls.Add(this.datasetView1); 320 this.Controls.Add(this.learningTaskGroupBox); 321 this.Controls.Add(this.partitioningGroupBox); 87 this.Controls.Add(this.datasetView); 322 88 this.Controls.Add(this.importButton); 323 89 this.Name = "ProblemView"; 324 90 this.Size = new System.Drawing.Size(776, 615); 325 this.partitioningGroupBox.ResumeLayout(false);326 this.partitioningGroupBox.PerformLayout();327 this.learningTaskGroupBox.ResumeLayout(false);328 this.learningTaskGroupBox.PerformLayout();329 91 this.ResumeLayout(false); 330 92 … … 334 96 335 97 private System.Windows.Forms.Button importButton; 336 private System.Windows.Forms.TextBox trainingSamplesStartTextBox;337 private System.Windows.Forms.Label trainingLabel;338 private System.Windows.Forms.TextBox trainingSamplesEndTextBox;339 private System.Windows.Forms.TextBox validationSamplesEndTextBox;340 private System.Windows.Forms.TextBox validationSamplesStartTextBox;341 private System.Windows.Forms.Label validationLabel;342 private System.Windows.Forms.TextBox testSamplesEndTextBox;343 private System.Windows.Forms.TextBox testSamplesStartTextBox;344 private System.Windows.Forms.Label testLabel;345 private System.Windows.Forms.CheckBox autoregressiveCheckBox;346 private System.Windows.Forms.GroupBox partitioningGroupBox;347 98 private System.Windows.Forms.OpenFileDialog openFileDialog; 348 private System.Windows.Forms.RadioButton classificationRadioButton; 349 private System.Windows.Forms.RadioButton regressionRadioButton; 350 private System.Windows.Forms.RadioButton timeSeriesRadioButton; 351 private System.Windows.Forms.Label minTimeOffsetLabel; 352 private System.Windows.Forms.TextBox minTimeOffsetTextBox; 353 private System.Windows.Forms.GroupBox learningTaskGroupBox; 354 private System.Windows.Forms.Label maxTimeOffsetLabel; 355 private System.Windows.Forms.TextBox maxTimeOffsetTextBox; 356 private System.Windows.Forms.Label autoregressiveLabel; 357 private HeuristicLab.DataAnalysis.DatasetView datasetView1; 99 private HeuristicLab.DataAnalysis.DatasetView datasetView; 358 100 } 359 101 } -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/ProblemView.cs
r2290 r2375 35 35 namespace HeuristicLab.CEDMA.Server { 36 36 public partial class ProblemView : ViewBase { 37 private Problem problem;37 private Dataset dataset; 38 38 39 public ProblemView(Problem problem) { 40 this.problem = problem; 41 problem.Changed += (sender, args) => UpdateControls(); 39 public ProblemView(Dataset dataset) { 40 this.dataset = dataset; 42 41 InitializeComponent(); 42 datasetView.Dataset = dataset; 43 dataset.Changed += (sender, args) => UpdateControls(); 43 44 UpdateControls(); 44 }45 46 protected override void UpdateControls() {47 base.UpdateControls();48 trainingSamplesStartTextBox.Text = problem.TrainingSamplesStart.ToString();49 trainingSamplesEndTextBox.Text = problem.TrainingSamplesEnd.ToString();50 validationSamplesStartTextBox.Text = problem.ValidationSamplesStart.ToString();51 validationSamplesEndTextBox.Text = problem.ValidationSamplesEnd.ToString();52 testSamplesStartTextBox.Text = problem.TestSamplesStart.ToString();53 testSamplesEndTextBox.Text = problem.TestSamplesEnd.ToString();54 minTimeOffsetTextBox.Text = problem.MinTimeOffset.ToString();55 maxTimeOffsetTextBox.Text = problem.MaxTimeOffset.ToString();56 autoregressiveCheckBox.Checked = problem.AutoRegressive;57 switch (problem.LearningTask) {58 case LearningTask.Classification: classificationRadioButton.Checked = true; break;59 case LearningTask.Regression: regressionRadioButton.Checked = true; break;60 case LearningTask.TimeSeries: timeSeriesRadioButton.Checked = true; break;61 }62 45 } 63 46 … … 84 67 } 85 68 if (success) { 86 Dataset dataset = (Dataset)problem.Dataset;87 69 dataset.Rows = parser.Rows; 88 70 dataset.Columns = parser.Columns; … … 90 72 dataset.Samples = new double[dataset.Rows * dataset.Columns]; 91 73 Array.Copy(parser.Samples, dataset.Samples, dataset.Columns * dataset.Rows); 92 datasetView 1.Dataset = problem.Dataset;74 datasetView.Dataset = dataset; 93 75 94 problem.TrainingSamplesStart = parser.TrainingSamplesStart;95 problem.ValidationSamplesEnd = parser.TrainingSamplesStart;96 problem.TrainingSamplesEnd = parser.TrainingSamplesEnd;97 problem.ValidationSamplesStart = parser.ValidationSamplesStart;98 problem.ValidationSamplesEnd = parser.ValidationSamplesEnd;99 problem.TestSamplesStart = parser.TestSamplesStart;100 problem.TestSamplesEnd = parser.TestSamplesEnd;101 76 for (int i = 0; i < parser.VariableNames.Length; i++) { 102 77 dataset.SetVariableName(i, parser.VariableNames[i]); 103 78 } 104 79 105 problem.FireChanged(); 80 106 81 Refresh(); 107 82 } … … 109 84 } 110 85 111 private void autoregressiveCheckBox_CheckedChanged(object sender, EventArgs e) {112 problem.AutoRegressive = autoregressiveCheckBox.Checked;113 problem.FireChanged();114 }115 116 private void samplesTextBox_Validating(object sender, CancelEventArgs e) {117 try {118 int trainingStart = int.Parse(trainingSamplesStartTextBox.Text);119 int trainingEnd = int.Parse(trainingSamplesEndTextBox.Text);120 int validationStart = int.Parse(validationSamplesStartTextBox.Text);121 int validationEnd = int.Parse(validationSamplesEndTextBox.Text);122 int testStart = int.Parse(testSamplesStartTextBox.Text);123 int testEnd = int.Parse(testSamplesEndTextBox.Text);124 if (trainingStart < 0 || validationStart < 0 || testStart < 0 ||125 trainingEnd >= problem.Dataset.Rows || validationEnd >= problem.Dataset.Rows || testEnd >= problem.Dataset.Rows ||126 trainingStart >= trainingEnd ||127 validationStart >= validationEnd ||128 testStart >= testEnd ||129 IsOverlapping(trainingStart, trainingEnd, validationStart, validationEnd) ||130 IsOverlapping(trainingStart, trainingEnd, testStart, testEnd) ||131 IsOverlapping(validationStart, validationEnd, testStart, testEnd))132 ColorSamplesTextBoxes(Color.Red);133 else134 ColorSamplesTextBoxes(Color.White);135 }136 catch (FormatException ex) {137 ColorSamplesTextBoxes(Color.Red);138 }139 }140 141 private void samplesTextBox_Validated(object sender, EventArgs e) {142 problem.TrainingSamplesStart = int.Parse(trainingSamplesStartTextBox.Text);143 problem.TrainingSamplesEnd = int.Parse(trainingSamplesEndTextBox.Text);144 problem.ValidationSamplesStart = int.Parse(validationSamplesStartTextBox.Text);145 problem.ValidationSamplesEnd = int.Parse(validationSamplesEndTextBox.Text);146 problem.TestSamplesStart = int.Parse(testSamplesStartTextBox.Text);147 problem.TestSamplesEnd = int.Parse(testSamplesEndTextBox.Text);148 problem.FireChanged();149 }150 151 private void ColorSamplesTextBoxes(Color color) {152 trainingSamplesStartTextBox.BackColor = color;153 trainingSamplesEndTextBox.BackColor = color;154 validationSamplesStartTextBox.BackColor = color;155 validationSamplesEndTextBox.BackColor = color;156 testSamplesStartTextBox.BackColor = color;157 testSamplesEndTextBox.BackColor = color;158 }159 160 private bool IsOverlapping(int x0, int y0, int x1, int y1) {161 Trace.Assert(x0 <= y0 && x1 <= y1);162 int tmp;163 // make sure that x0,y0 is the left interval164 if (x1 < x0) {165 tmp = x1;166 x1 = x0;167 x0 = tmp;168 tmp = y1;169 y1 = y0;170 y0 = tmp;171 }172 return y0 > x1;173 }174 86 private void ShowWarningMessageBox(Exception ex) { 175 87 MessageBox.Show(ex.Message, … … 195 107 } 196 108 197 private void radioButton_CheckedChanged(object sender, EventArgs e) {198 minTimeOffsetLabel.Enabled = timeSeriesRadioButton.Checked;199 minTimeOffsetTextBox.Enabled = timeSeriesRadioButton.Checked;200 maxTimeOffsetLabel.Enabled = timeSeriesRadioButton.Checked;201 maxTimeOffsetTextBox.Enabled = timeSeriesRadioButton.Checked;202 autoregressiveCheckBox.Enabled = timeSeriesRadioButton.Checked;203 autoregressiveLabel.Enabled = timeSeriesRadioButton.Checked;204 if (timeSeriesRadioButton.Checked) problem.LearningTask = LearningTask.TimeSeries;205 else if (classificationRadioButton.Checked) problem.LearningTask = LearningTask.Classification;206 else if (regressionRadioButton.Checked) problem.LearningTask = LearningTask.Regression;207 problem.FireChanged();208 }209 210 private void timeOffsetTextBox_Validating(object sender, CancelEventArgs e) {211 int min, max;212 e.Cancel = !int.TryParse(minTimeOffsetTextBox.Text, out min);213 e.Cancel = !int.TryParse(maxTimeOffsetTextBox.Text, out max);214 e.Cancel = min > max;215 }216 private void timeOffsetTextBox_Validated(object sender, EventArgs e) {217 problem.MinTimeOffset = int.Parse(minTimeOffsetTextBox.Text);218 problem.MaxTimeOffset = int.Parse(maxTimeOffsetTextBox.Text);219 problem.FireChanged();220 }221 109 } 222 110 } -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/Server.cs
r2223 r2375 33 33 using HeuristicLab.Modeling.Database; 34 34 using HeuristicLab.Modeling.Database.SQLServerCompact; 35 using HeuristicLab.DataAnalysis; 35 36 36 37 namespace HeuristicLab.CEDMA.Server { … … 44 45 private IExecuter executer; 45 46 public IExecuter Executer { get { return executer; } } 46 private Problem problem; 47 public Problem Problem { get { return problem; } } 47 //private Problem problem; 48 //public Problem Problem { get { return problem; } } 49 private Dataset dataset; 50 public Dataset Dataset { get { return dataset; } } 48 51 49 52 private string gridServiceUrl; … … 55 58 public Server() { 56 59 database = new DatabaseService(sqlServerCompactConnectionString); 57 problem = new Problem();60 dataset = new Dataset(); 58 61 try { 59 problem.Dataset = database.GetDataset();62 dataset = database.GetDataset(); 60 63 } 61 catch (InvalidOperationException ex) {64 catch (InvalidOperationException) { 62 65 } 63 66 } 64 67 65 68 internal void Connect(string serverUrl) { 66 dispatcher = new SimpleDispatcher(database, problem);69 dispatcher = new SimpleDispatcher(database, dataset); 67 70 IGridServer gridServer = null; 68 71 if (serverUrl.Contains("ExecutionEngine")) { -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/ServerApplication.cs
r2223 r2375 27 27 28 28 namespace HeuristicLab.CEDMA.Server { 29 [ClassInfo(Name = "CEDMA", Description = "Cooperative Evolutionary Data Mining.", AutoRestart =true)]29 [ClassInfo(Name = "CEDMA", Description = "Cooperative Evolutionary Data Mining.", AutoRestart = true)] 30 30 class ServerApplication : ApplicationBase { 31 31 public override void Run() { … … 35 35 serverControl.Dock = DockStyle.Fill; 36 36 mainForm.Controls.Add(serverControl); 37 mainForm. Name= "CEDMA";37 mainForm.Text = "CEDMA"; 38 38 Application.Run(mainForm); 39 39 } -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/ServerView.cs
r2223 r2375 42 42 private Server server; 43 43 44 public ServerView(Server server) : base() { 44 public ServerView(Server server) 45 : base() { 45 46 this.server = server; 46 47 InitializeComponent(); … … 52 53 executerControl.Dock = DockStyle.Fill; 53 54 executerTabPage.Controls.Add(executerControl); 54 UserControl dispatcherControl = (UserControl) server.Dispatcher.CreateView();55 UserControl dispatcherControl = (UserControl)((IViewable)server.Dispatcher).CreateView(); 55 56 dispatcherControl.Dock = DockStyle.Fill; 56 57 dispatcherTabPage.Controls.Add(dispatcherControl); 57 UserControl problemControl = (UserControl)server.Problem.CreateView();58 UserControl problemControl = new ProblemView(server.Dataset); 58 59 problemControl.Dock = DockStyle.Fill; 59 60 problemPage.Controls.Add(problemControl); 60 connectButton.Enabled = false; 61 connectButton.Enabled = false; 61 62 } 62 63 } -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/ServerView.designer.cs
r2223 r2375 58 58 // 59 59 this.gridAddressLabel.AutoSize = true; 60 this.gridAddressLabel.Location = new System.Drawing.Point( 12, 35);60 this.gridAddressLabel.Location = new System.Drawing.Point(2, 8); 61 61 this.gridAddressLabel.Name = "gridAddressLabel"; 62 62 this.gridAddressLabel.Size = new System.Drawing.Size(69, 13); … … 66 66 // address 67 67 // 68 this.address.Location = new System.Drawing.Point( 106, 32);68 this.address.Location = new System.Drawing.Point(96, 5); 69 69 this.address.Name = "address"; 70 70 this.address.Size = new System.Drawing.Size(160, 20); … … 73 73 // connectButton 74 74 // 75 this.connectButton.Location = new System.Drawing.Point(2 72, 30);75 this.connectButton.Location = new System.Drawing.Point(262, 3); 76 76 this.connectButton.Name = "connectButton"; 77 77 this.connectButton.Size = new System.Drawing.Size(75, 23); … … 89 89 this.tabControl.Controls.Add(this.dispatcherTabPage); 90 90 this.tabControl.Controls.Add(this.problemPage); 91 this.tabControl.Location = new System.Drawing.Point(3, 58);91 this.tabControl.Location = new System.Drawing.Point(3, 31); 92 92 this.tabControl.Name = "tabControl"; 93 93 this.tabControl.SelectedIndex = 0; 94 this.tabControl.Size = new System.Drawing.Size(573, 5 43);94 this.tabControl.Size = new System.Drawing.Size(573, 570); 95 95 this.tabControl.TabIndex = 14; 96 96 // … … 100 100 this.executerTabPage.Name = "executerTabPage"; 101 101 this.executerTabPage.Padding = new System.Windows.Forms.Padding(3); 102 this.executerTabPage.Size = new System.Drawing.Size(565, 5 17);102 this.executerTabPage.Size = new System.Drawing.Size(565, 544); 103 103 this.executerTabPage.TabIndex = 0; 104 104 this.executerTabPage.Text = "Executer"; -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/SimpleDispatcher.cs
r2366 r2375 34 34 using HeuristicLab.Modeling; 35 35 using HeuristicLab.Modeling.Database; 36 using HeuristicLab.DataAnalysis; 36 37 37 38 namespace HeuristicLab.CEDMA.Server { 38 public class SimpleDispatcher : IDispatcher {39 public class SimpleDispatcher : IDispatcher, IViewable { 39 40 private class AlgorithmConfiguration { 40 41 public string name; 41 public int targetVariable; 42 public List<int> inputVariables; 43 } 42 public ProblemSpecification problemSpecification; 43 } 44 45 internal event EventHandler Changed; 44 46 45 47 private IModelingDatabase database; … … 50 52 } 51 53 52 private Problem problem;53 public Problem Problem{54 private Dataset dataset; 55 public Dataset Dataset { 54 56 get { 55 return problem; 56 } 57 } 58 internal event EventHandler Changed; 57 return dataset; 58 } 59 } 59 60 60 61 public IEnumerable<string> TargetVariables { 61 62 get { 62 return Enumerable.Range(0, problem.Dataset.Columns).Select(x => problem.Dataset.GetVariableName(x));63 } 64 } 65 66 public IEnumerable<string> InputVariables {63 return Enumerable.Range(0, Dataset.Columns).Select(x => Dataset.GetVariableName(x)); 64 } 65 } 66 67 public IEnumerable<string> Variables { 67 68 get { 68 69 return TargetVariables; … … 70 71 } 71 72 72 private HeuristicLab.Modeling.IAlgorithm[] algorithms; 73 public IEnumerable<HeuristicLab.Modeling.IAlgorithm> Algorithms { 74 get { 75 switch (Problem.LearningTask) { 76 case LearningTask.Regression: { 77 return algorithms.Where(a => (a as IClassificationAlgorithm) == null && (a as ITimeSeriesAlgorithm) == null); 78 } 79 case LearningTask.Classification: { 80 return algorithms.Where(a => (a as IClassificationAlgorithm) != null); 81 } 82 case LearningTask.TimeSeries: { 83 return algorithms.Where(a => (a as ITimeSeriesAlgorithm) != null); 84 } 85 } 86 return new HeuristicLab.Modeling.IAlgorithm[] { }; 87 } 88 } 89 90 private List<HeuristicLab.Modeling.IAlgorithm> activeAlgorithms; 91 public IEnumerable<HeuristicLab.Modeling.IAlgorithm> ActiveAlgorithms { 92 get { return activeAlgorithms; } 73 private HeuristicLab.Modeling.IAlgorithm[] defaultAlgorithms; 74 public IEnumerable<HeuristicLab.Modeling.IAlgorithm> GetAlgorithms(LearningTask task) { 75 switch (task) { 76 case LearningTask.Regression: { 77 return defaultAlgorithms.Where(a => (a as IClassificationAlgorithm) == null && (a as ITimeSeriesAlgorithm) == null); 78 } 79 case LearningTask.Classification: { 80 return defaultAlgorithms.Where(a => (a as IClassificationAlgorithm) != null); 81 } 82 case LearningTask.TimeSeries: { 83 return defaultAlgorithms.Where(a => (a as ITimeSeriesAlgorithm) != null); 84 } 85 default: { 86 return new HeuristicLab.Modeling.IAlgorithm[] { }; 87 } 88 } 93 89 } 94 90 95 91 private Random random; 96 private List<int> allowedTargetVariables; 97 private Dictionary<int, List<int>> activeInputVariables; 98 private Dictionary<int, List<AlgorithmConfiguration>> finishedAndDispatchedRuns; 92 private Dictionary<string, ProblemSpecification> problemSpecifications; 93 private Dictionary<string, List<HeuristicLab.Modeling.IAlgorithm>> algorithms; 94 public IEnumerable<HeuristicLab.Modeling.IAlgorithm> GetAllowedAlgorithms(string targetVariable) { 95 if (algorithms.ContainsKey(targetVariable)) 96 return algorithms[targetVariable]; 97 else return new HeuristicLab.Modeling.IAlgorithm[] { }; 98 } 99 private Dictionary<string, bool> activeVariables; 100 public IEnumerable<string> AllowedTargetVariables { 101 get { return activeVariables.Where(x => x.Value).Select(x => x.Key); } 102 } 103 private Dictionary<string, List<AlgorithmConfiguration>> finishedAndDispatchedRuns; 99 104 private object locker = new object(); 100 105 101 public SimpleDispatcher(IModelingDatabase database, Problem problem) {102 this. problem = problem;106 public SimpleDispatcher(IModelingDatabase database, Dataset dataset) { 107 this.dataset = dataset; 103 108 this.database = database; 104 this.random = new Random(); 105 106 this.finishedAndDispatchedRuns = new Dictionary<int, List<AlgorithmConfiguration>>(); 107 this.allowedTargetVariables = new List<int>(); 108 this.activeInputVariables = new Dictionary<int, List<int>>(); 109 this.activeAlgorithms = new List<HeuristicLab.Modeling.IAlgorithm>(); 109 dataset.Changed += (sender, args) => FireChanged(); 110 random = new Random(); 111 112 activeVariables = new Dictionary<string, bool>(); 113 problemSpecifications = new Dictionary<string, ProblemSpecification>(); 114 algorithms = new Dictionary<string, List<HeuristicLab.Modeling.IAlgorithm>>(); 115 finishedAndDispatchedRuns = new Dictionary<string, List<AlgorithmConfiguration>>(); 116 110 117 DiscoveryService ds = new DiscoveryService(); 111 this.algorithms = ds.GetInstances<HeuristicLab.Modeling.IAlgorithm>(); 112 problem.Changed += (sender, args) => { 113 lock (locker) { 114 allowedTargetVariables.Clear(); 115 activeInputVariables.Clear(); 116 activeAlgorithms.Clear(); 117 } 118 OnChanged(); 119 }; 120 121 PopulateFinishedRuns(); 118 defaultAlgorithms = ds.GetInstances<HeuristicLab.Modeling.IAlgorithm>(); 119 120 // PopulateFinishedRuns(); 122 121 } 123 122 124 123 public HeuristicLab.Modeling.IAlgorithm GetNextJob() { 125 124 lock (locker) { 126 if (allowedTargetVariables.Count > 0) { 127 int[] targetVariables = allowedTargetVariables.ToArray(); 128 int targetVariable = SelectTargetVariable(targetVariables); 129 int[] inputVariables = activeInputVariables[targetVariable].ToArray(); 130 131 HeuristicLab.Modeling.IAlgorithm selectedAlgorithm = SelectAndConfigureAlgorithm(targetVariable, inputVariables, problem); 125 if (activeVariables.Count > 0) { 126 string[] targetVariables = activeVariables.Keys.ToArray(); 127 string targetVariable = SelectTargetVariable(targetVariables); 128 HeuristicLab.Modeling.IAlgorithm selectedAlgorithm = SelectAndConfigureAlgorithm(targetVariable); 132 129 133 130 return selectedAlgorithm; … … 136 133 } 137 134 138 public virtual int SelectTargetVariable(int[] targetVariables) {135 public virtual string SelectTargetVariable(string[] targetVariables) { 139 136 return targetVariables[random.Next(targetVariables.Length)]; 140 137 } 141 138 142 public HeuristicLab.Modeling.IAlgorithm SelectAndConfigureAlgorithm( int targetVariable, int[] inputVariables, Problem problem) {139 public HeuristicLab.Modeling.IAlgorithm SelectAndConfigureAlgorithm(string targetVariable) { 143 140 HeuristicLab.Modeling.IAlgorithm selectedAlgorithm = null; 144 DiscoveryService ds = new DiscoveryService();145 var allAlgorithms = ds.GetInstances<HeuristicLab.Modeling.IAlgorithm>();146 var allowedAlgorithmTypes = activeAlgorithms.Select(x => x.GetType());147 141 var possibleAlgos = 148 al lAlgorithms149 .Where(x => allowedAlgorithmTypes.Contains(x.GetType()) &&150 ((x is IStochasticAlgorithm) || !AlgorithmFinishedOrDispatched( targetVariable, inputVariables, x.Name)));142 algorithms[targetVariable] 143 .Where(x => 144 ((x is IStochasticAlgorithm) || !AlgorithmFinishedOrDispatched(problemSpecifications[targetVariable], x.Name))); 151 145 if (possibleAlgos.Count() > 0) selectedAlgorithm = possibleAlgos.ElementAt(random.Next(possibleAlgos.Count())); 152 146 if (selectedAlgorithm != null) { 153 SetProblemParameters(selectedAlgorithm, problem , targetVariable, inputVariables);147 SetProblemParameters(selectedAlgorithm, problemSpecifications[targetVariable]); 154 148 if (!(selectedAlgorithm is IStochasticAlgorithm)) 155 AddDispatchedRun( targetVariable, inputVariables, selectedAlgorithm.Name);149 AddDispatchedRun(problemSpecifications[targetVariable], selectedAlgorithm.Name); 156 150 } 157 151 return selectedAlgorithm; 158 152 } 159 153 160 private void PopulateFinishedRuns() { 161 var dispatchedAlgos = from model in Database.GetAllModels() 162 select new { 163 TargetVariable = model.TargetVariable.Name, 164 Algorithm = model.Algorithm.Name, 165 Inputvariables = Database.GetInputVariableResults(model).Select(x => x.Variable.Name).Distinct() 166 }; 167 foreach (var algo in dispatchedAlgos) { 168 AddDispatchedRun(algo.TargetVariable, algo.Inputvariables, algo.Algorithm); 169 } 170 } 171 172 private void SetProblemParameters(HeuristicLab.Modeling.IAlgorithm algo, Problem problem, int targetVariable, int[] inputVariables) { 173 algo.Dataset = problem.Dataset; 174 algo.TargetVariable = targetVariable; 175 algo.ProblemInjector.GetVariable("TrainingSamplesStart").GetValue<IntData>().Data = problem.TrainingSamplesStart; 176 algo.ProblemInjector.GetVariable("TrainingSamplesEnd").GetValue<IntData>().Data = problem.TrainingSamplesEnd; 177 algo.ProblemInjector.GetVariable("ValidationSamplesStart").GetValue<IntData>().Data = problem.ValidationSamplesStart; 178 algo.ProblemInjector.GetVariable("ValidationSamplesEnd").GetValue<IntData>().Data = problem.ValidationSamplesEnd; 179 algo.ProblemInjector.GetVariable("TestSamplesStart").GetValue<IntData>().Data = problem.TestSamplesStart; 180 algo.ProblemInjector.GetVariable("TestSamplesEnd").GetValue<IntData>().Data = problem.TestSamplesEnd; 181 ItemList<IntData> allowedFeatures = algo.ProblemInjector.GetVariable("AllowedFeatures").GetValue<ItemList<IntData>>(); 182 foreach (int inputVariable in inputVariables) { 183 if (inputVariable != targetVariable) { 184 allowedFeatures.Add(new IntData(inputVariable)); 154 //private void PopulateFinishedRuns() { 155 // var dispatchedAlgos = from model in Database.GetAllModels() 156 // select new { 157 // TargetVariable = model.TargetVariable.Name, 158 // Algorithm = model.Algorithm.Name, 159 // InputVariables = Database.GetInputVariableResults(model).Select(x => x.Variable.Name).Distinct(), 160 // }; 161 // foreach (var algo in dispatchedAlgos) { 162 // ProblemSpecification spec = new ProblemSpecification(); 163 // spec.TargetVariable = algo.TargetVariable; 164 // foreach (string variable in algo.InputVariables) spec.AddInputVariable(variable); 165 // AddDispatchedRun(spec, algo.Algorithm); 166 // } 167 //} 168 169 private void SetProblemParameters(HeuristicLab.Modeling.IAlgorithm algo, ProblemSpecification spec) { 170 algo.Dataset = spec.Dataset; 171 algo.TargetVariable = spec.Dataset.GetVariableIndex(spec.TargetVariable); 172 algo.TrainingSamplesStart = spec.TrainingSamplesStart; 173 algo.TrainingSamplesEnd = spec.TrainingSamplesEnd; 174 algo.ValidationSamplesStart = spec.ValidationSamplesStart; 175 algo.ValidationSamplesEnd = spec.ValidationSamplesEnd; 176 algo.TestSamplesStart = spec.TestSamplesStart; 177 algo.TestSamplesEnd = spec.TestSamplesEnd; 178 List<int> allowedFeatures = new List<int>(); 179 foreach (string inputVariable in spec.InputVariables) { 180 if (inputVariable != spec.TargetVariable) { 181 allowedFeatures.Add(spec.Dataset.GetVariableIndex(inputVariable)); 185 182 } 186 183 } 187 184 188 if ( problem.LearningTask == LearningTask.TimeSeries) {185 if (spec.LearningTask == LearningTask.TimeSeries) { 189 186 ITimeSeriesAlgorithm timeSeriesAlgo = (ITimeSeriesAlgorithm)algo; 190 timeSeriesAlgo.MinTimeOffset = problem.MinTimeOffset;191 timeSeriesAlgo.MaxTimeOffset = problem.MaxTimeOffset;192 if ( problem.AutoRegressive) {193 allowedFeatures.Add( new IntData(targetVariable));187 timeSeriesAlgo.MinTimeOffset = spec.MinTimeOffset; 188 timeSeriesAlgo.MaxTimeOffset = spec.MaxTimeOffset; 189 if (spec.AutoRegressive) { 190 allowedFeatures.Add(spec.Dataset.GetVariableIndex(spec.TargetVariable)); 194 191 } 195 192 } 196 } 197 198 199 private void AddDispatchedRun(string targetVariable, IEnumerable<string> inputVariables, string algorithm) { 200 AddDispatchedRun( 201 Problem.Dataset.GetVariableIndex(targetVariable), 202 inputVariables.Select(x => Problem.Dataset.GetVariableIndex(x)).ToArray(), 203 algorithm); 204 } 205 206 private void AddDispatchedRun(int targetVariable, int[] inputVariables, string algoName) { 207 if (!finishedAndDispatchedRuns.ContainsKey(targetVariable)) { 208 finishedAndDispatchedRuns[targetVariable] = new List<AlgorithmConfiguration>(); 209 } 193 algo.AllowedVariables = allowedFeatures; 194 } 195 196 197 private void AddDispatchedRun(ProblemSpecification specification, string algorithm) { 210 198 AlgorithmConfiguration conf = new AlgorithmConfiguration(); 211 conf.name = algoName; 212 conf.inputVariables = new List<int>(inputVariables); 213 conf.targetVariable = targetVariable; 214 finishedAndDispatchedRuns[targetVariable].Add(conf); 215 } 216 217 private bool AlgorithmFinishedOrDispatched(int targetVariable, int[] inputVariables, string algoName) { 199 conf.name = algorithm; 200 conf.problemSpecification = new ProblemSpecification(specification); 201 if (!finishedAndDispatchedRuns.ContainsKey(specification.TargetVariable)) 202 finishedAndDispatchedRuns.Add(specification.TargetVariable, new List<AlgorithmConfiguration>()); 203 finishedAndDispatchedRuns[specification.TargetVariable].Add(conf); 204 } 205 206 private bool AlgorithmFinishedOrDispatched(ProblemSpecification specification, string algoName) { 218 207 return 219 finishedAndDispatchedRuns.ContainsKey( targetVariable) &&220 finishedAndDispatchedRuns[ targetVariable].Any(x => targetVariable == x.targetVariable &&208 finishedAndDispatchedRuns.ContainsKey(specification.TargetVariable) && 209 finishedAndDispatchedRuns[specification.TargetVariable].Any(x => 221 210 algoName == x.name && 222 inputVariables.Count() == x.inputVariables.Count() && 223 inputVariables.All(v => x.inputVariables.Contains(v))); 224 } 225 226 public void EnableAlgorithm(HeuristicLab.Modeling.IAlgorithm algo) { 227 lock (locker) { 228 if (!activeAlgorithms.Contains(algo)) activeAlgorithms.Add(algo); 229 } 230 } 231 232 public void DisableAlgorithm(HeuristicLab.Modeling.IAlgorithm algo) { 233 lock (locker) { 234 while (activeAlgorithms.Remove(algo)) ; 235 } 211 specification.Equals(x.problemSpecification)); 236 212 } 237 213 238 214 internal void EnableTargetVariable(string name) { 239 int varIndex = problem.Dataset.GetVariableIndex(name); 240 lock (locker) 241 if (!allowedTargetVariables.Contains(varIndex)) allowedTargetVariables.Add(varIndex); 215 activeVariables[name] = true; 242 216 } 243 217 244 218 internal void DisableTargetVariable(string name) { 245 int varIndex = problem.Dataset.GetVariableIndex(name); 246 lock (locker) 247 while (allowedTargetVariables.Remove(varIndex)) ; 248 } 249 250 internal void EnableInputVariable(string target, string name) { 251 int targetIndex = problem.Dataset.GetVariableIndex(target); 252 int inputIndex = problem.Dataset.GetVariableIndex(name); 253 lock (locker) { 254 if (!activeInputVariables.ContainsKey(targetIndex)) activeInputVariables[targetIndex] = new List<int>(); 255 if (!activeInputVariables[targetIndex].Contains(inputIndex)) { 256 activeInputVariables[targetIndex].Add(inputIndex); 257 } 258 } 259 } 260 261 internal void DisableInputVariable(string target, string name) { 262 int targetIndex = problem.Dataset.GetVariableIndex(target); 263 int inputIndex = problem.Dataset.GetVariableIndex(name); 264 lock (locker) { 265 if (!activeInputVariables.ContainsKey(targetIndex)) activeInputVariables[targetIndex] = new List<int>(); 266 while (activeInputVariables[targetIndex].Remove(inputIndex)) ; 267 } 268 } 269 270 public void OnChanged() { 219 activeVariables[name] = false; 220 } 221 222 public void EnableAlgorithm(string targetVariable, HeuristicLab.Modeling.IAlgorithm algo) { 223 if (!algorithms.ContainsKey(targetVariable)) algorithms.Add(targetVariable, new List<HeuristicLab.Modeling.IAlgorithm>()); 224 algorithms[targetVariable].Add(algo); 225 } 226 227 public void DisableAlgorithm(string targetVariable, HeuristicLab.Modeling.IAlgorithm algo) { 228 algorithms[targetVariable].Remove(algo); 229 } 230 231 public ProblemSpecification GetProblemSpecification(string targetVariable) { 232 if (!problemSpecifications.ContainsKey(targetVariable)) 233 problemSpecifications[targetVariable] = CreateDefaultProblemSpecification(targetVariable); 234 235 return problemSpecifications[targetVariable]; 236 } 237 238 //internal void EnableInputVariable(string target, string name) { 239 // problemSpecifications[target].AddInputVariable(name); 240 //} 241 242 //internal void DisableInputVariable(string target, string name) { 243 // problemSpecifications[target].RemoveInputVariable(name); 244 //} 245 246 //internal void SetLearningTask(string target, LearningTask task) { 247 // problemSpecifications[target].LearningTask = task; 248 //} 249 250 //internal void SetDatasetBoundaries( 251 // string target, 252 // int trainingStart, int trainingEnd, 253 // int validationStart, int validationEnd, 254 // int testStart, int testEnd) { 255 // problemSpecifications[target].TrainingSamplesStart = trainingStart; 256 // problemSpecifications[target].TrainingSamplesEnd = trainingEnd; 257 // problemSpecifications[target].ValidationSamplesStart = validationStart; 258 // problemSpecifications[target].ValidationSamplesEnd = validationEnd; 259 // problemSpecifications[target].TestSamplesStart = testStart; 260 // problemSpecifications[target].TestSamplesEnd = testEnd; 261 //} 262 263 private ProblemSpecification CreateDefaultProblemSpecification(string targetVariable) { 264 ProblemSpecification spec = new ProblemSpecification(); 265 spec.Dataset = dataset; 266 spec.TargetVariable = targetVariable; 267 spec.LearningTask = LearningTask.Regression; 268 int targetColumn = dataset.GetVariableIndex(targetVariable); 269 // find index of first correct target value 270 int firstValueIndex; 271 for (firstValueIndex = 0; firstValueIndex < dataset.Rows; firstValueIndex++) { 272 double x = dataset.GetValue(firstValueIndex, targetColumn); 273 if (!(double.IsNaN(x) || double.IsInfinity(x))) break; 274 } 275 // find index of last correct target value 276 int lastValueIndex; 277 for (lastValueIndex = dataset.Rows - 1; lastValueIndex > firstValueIndex; lastValueIndex--) { 278 double x = dataset.GetValue(lastValueIndex, targetColumn); 279 if (!(double.IsNaN(x) || double.IsInfinity(x))) break; 280 } 281 282 int validTargetRange = lastValueIndex - firstValueIndex; 283 spec.TrainingSamplesStart = firstValueIndex; 284 spec.TrainingSamplesEnd = firstValueIndex + (int)Math.Floor(validTargetRange * 0.5); 285 spec.ValidationSamplesStart = spec.TrainingSamplesEnd; 286 spec.ValidationSamplesEnd = firstValueIndex + (int)Math.Floor(validTargetRange * 0.75); 287 spec.TestSamplesStart = spec.ValidationSamplesEnd; 288 spec.TestSamplesEnd = lastValueIndex; 289 return spec; 290 } 291 292 public void FireChanged() { 271 293 if (Changed != null) Changed(this, new EventArgs()); 272 294 } 273 274 internal IEnumerable<string> GetInputVariables(string target) {275 int targetIndex = problem.Dataset.GetVariableIndex(target);276 lock (locker) {277 if (!activeInputVariables.ContainsKey(targetIndex)) activeInputVariables[targetIndex] = new List<int>();278 return activeInputVariables[targetIndex]279 .Select(i => problem.Dataset.GetVariableName(i));280 }281 }282 283 295 284 296 #region IViewable Members … … 289 301 290 302 #endregion 291 292 293 303 } 294 304 } -
trunk/sources/HeuristicLab.DataAnalysis/3.2/Dataset.cs
r2368 r2375 198 198 public void SetVariableName(int variableIndex, string name) { 199 199 variableNames[variableIndex] = name; 200 if (fireChangeEvents) FireChanged(); 200 201 } 201 202 -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/OffspringSelectionGPRegression.cs
r2363 r2375 21 21 22 22 using System; 23 using System.Linq; 23 24 using System.Collections.Generic; 24 25 using HeuristicLab.Core; … … 54 55 return CreateGPModel(); 55 56 } 57 } 58 public IEnumerable<int> AllowedVariables { 59 get { 60 ItemList<IntData> allowedVariables = ProblemInjector.GetVariableValue<ItemList<IntData>>("AllowedFeatures", null, false); 61 return allowedVariables.Select(x => x.Data); 62 } 63 set { 64 ItemList<IntData> allowedVariables = ProblemInjector.GetVariableValue<ItemList<IntData>>("AllowedFeatures", null, false); 65 foreach (int x in value) allowedVariables.Add(new IntData(x)); 66 } 67 } 68 69 public int TrainingSamplesStart { 70 get { return ProblemInjector.GetVariableValue<IntData>("TrainingSamplesStart", null, false).Data; } 71 set { ProblemInjector.GetVariableValue<IntData>("TrainingSamplesStart", null, false).Data = value; } 72 } 73 74 public int TrainingSamplesEnd { 75 get { return ProblemInjector.GetVariableValue<IntData>("TrainingSamplesEnd", null, false).Data; } 76 set { ProblemInjector.GetVariableValue<IntData>("TrainingSamplesEnd", null, false).Data = value; } 77 } 78 79 public int ValidationSamplesStart { 80 get { return ProblemInjector.GetVariableValue<IntData>("ValidationSamplesStart", null, false).Data; } 81 set { ProblemInjector.GetVariableValue<IntData>("ValidationSamplesStart", null, false).Data = value; } 82 } 83 84 public int ValidationSamplesEnd { 85 get { return ProblemInjector.GetVariableValue<IntData>("ValidationSamplesEnd", null, false).Data; } 86 set { ProblemInjector.GetVariableValue<IntData>("ValidationSamplesEnd", null, false).Data = value; } 87 } 88 89 public int TestSamplesStart { 90 get { return ProblemInjector.GetVariableValue<IntData>("TestSamplesStart", null, false).Data; } 91 set { ProblemInjector.GetVariableValue<IntData>("TestSamplesStart", null, false).Data = value; } 92 } 93 94 public int TestSamplesEnd { 95 get { return ProblemInjector.GetVariableValue<IntData>("TestSamplesEnd", null, false).Data; } 96 set { ProblemInjector.GetVariableValue<IntData>("TestSamplesEnd", null, false).Data = value; } 56 97 } 57 98 -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/StandardGPRegression.cs
r2363 r2375 29 29 using System.Collections.Generic; 30 30 using System; 31 using System.Linq; 31 32 using HeuristicLab.DataAnalysis; 32 33 using HeuristicLab.Operators.Programmable; … … 54 55 return CreateGPModel(); 55 56 } 57 } 58 59 public IEnumerable<int> AllowedVariables { 60 get { 61 ItemList<IntData> allowedVariables = ProblemInjector.GetVariableValue<ItemList<IntData>>("AllowedFeatures", null, false); 62 return allowedVariables.Select(x => x.Data); 63 } 64 set { 65 ItemList<IntData> allowedVariables = ProblemInjector.GetVariableValue<ItemList<IntData>>("AllowedFeatures", null, false); 66 foreach (int x in value) allowedVariables.Add(new IntData(x)); 67 } 68 } 69 70 public int TrainingSamplesStart { 71 get { return ProblemInjector.GetVariableValue<IntData>("TrainingSamplesStart", null, false).Data; } 72 set { ProblemInjector.GetVariableValue<IntData>("TrainingSamplesStart", null, false).Data = value; } 73 } 74 75 public int TrainingSamplesEnd { 76 get { return ProblemInjector.GetVariableValue<IntData>("TrainingSamplesEnd", null, false).Data; } 77 set { ProblemInjector.GetVariableValue<IntData>("TrainingSamplesEnd", null, false).Data = value; } 78 } 79 80 public int ValidationSamplesStart { 81 get { return ProblemInjector.GetVariableValue<IntData>("ValidationSamplesStart", null, false).Data; } 82 set { ProblemInjector.GetVariableValue<IntData>("ValidationSamplesStart", null, false).Data = value; } 83 } 84 85 public int ValidationSamplesEnd { 86 get { return ProblemInjector.GetVariableValue<IntData>("ValidationSamplesEnd", null, false).Data; } 87 set { ProblemInjector.GetVariableValue<IntData>("ValidationSamplesEnd", null, false).Data = value; } 88 } 89 90 public int TestSamplesStart { 91 get { return ProblemInjector.GetVariableValue<IntData>("TestSamplesStart", null, false).Data; } 92 set { ProblemInjector.GetVariableValue<IntData>("TestSamplesStart", null, false).Data = value; } 93 } 94 95 public int TestSamplesEnd { 96 get { return ProblemInjector.GetVariableValue<IntData>("TestSamplesEnd", null, false).Data; } 97 set { ProblemInjector.GetVariableValue<IntData>("TestSamplesEnd", null, false).Data = value; } 56 98 } 57 99 -
trunk/sources/HeuristicLab.LinearRegression/3.2/LinearRegression.cs
r2363 r2375 69 69 probInjector.OperatorGraph.InitialOperator.AddSubOperator(value, 0); 70 70 } 71 } 72 public IEnumerable<int> AllowedVariables { 73 get { 74 ItemList<IntData> allowedVariables = ProblemInjector.GetVariableValue<ItemList<IntData>>("AllowedFeatures", null, false); 75 return allowedVariables.Select(x => x.Data); 76 } 77 set { 78 ItemList<IntData> allowedVariables = ProblemInjector.GetVariableValue<ItemList<IntData>>("AllowedFeatures", null, false); 79 foreach (int x in value) allowedVariables.Add(new IntData(x)); 80 } 81 } 82 83 public int TrainingSamplesStart { 84 get { return ProblemInjector.GetVariableValue<IntData>("TrainingSamplesStart", null, false).Data; } 85 set { ProblemInjector.GetVariableValue<IntData>("TrainingSamplesStart", null, false).Data = value; } 86 } 87 88 public int TrainingSamplesEnd { 89 get { return ProblemInjector.GetVariableValue<IntData>("TrainingSamplesEnd", null, false).Data; } 90 set { ProblemInjector.GetVariableValue<IntData>("TrainingSamplesEnd", null, false).Data = value; } 91 } 92 93 public int ValidationSamplesStart { 94 get { return ProblemInjector.GetVariableValue<IntData>("ValidationSamplesStart", null, false).Data; } 95 set { ProblemInjector.GetVariableValue<IntData>("ValidationSamplesStart", null, false).Data = value; } 96 } 97 98 public int ValidationSamplesEnd { 99 get { return ProblemInjector.GetVariableValue<IntData>("ValidationSamplesEnd", null, false).Data; } 100 set { ProblemInjector.GetVariableValue<IntData>("ValidationSamplesEnd", null, false).Data = value; } 101 } 102 103 public int TestSamplesStart { 104 get { return ProblemInjector.GetVariableValue<IntData>("TestSamplesStart", null, false).Data; } 105 set { ProblemInjector.GetVariableValue<IntData>("TestSamplesStart", null, false).Data = value; } 106 } 107 108 public int TestSamplesEnd { 109 get { return ProblemInjector.GetVariableValue<IntData>("TestSamplesEnd", null, false).Data; } 110 set { ProblemInjector.GetVariableValue<IntData>("TestSamplesEnd", null, false).Data = value; } 71 111 } 72 112 -
trunk/sources/HeuristicLab.Modeling/3.2/IAlgorithm.cs
r2285 r2375 30 30 string Name { get; } 31 31 string Description { get; } 32 IOperator ProblemInjector { get; set; } 32 33 33 Dataset Dataset { get; set; } 34 IEnumerable<int> AllowedVariables { get; set; } 35 int TrainingSamplesStart { get; set; } 36 int TrainingSamplesEnd { get; set; } 37 int ValidationSamplesStart { get; set; } 38 int ValidationSamplesEnd { get; set; } 39 int TestSamplesStart { get; set; } 40 int TestSamplesEnd { get; set; } 34 41 int TargetVariable { get; set; } 35 42 IEngine Engine { get; } -
trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorRegression.cs
r2363 r2375 77 77 return CreateSVMModel(bestModelScope); 78 78 } 79 } 80 public IEnumerable<int> AllowedVariables { 81 get { 82 ItemList<IntData> allowedVariables = ProblemInjector.GetVariableValue<ItemList<IntData>>("AllowedFeatures", null, false); 83 return allowedVariables.Select(x => x.Data); 84 } 85 set { 86 ItemList<IntData> allowedVariables = ProblemInjector.GetVariableValue<ItemList<IntData>>("AllowedFeatures", null, false); 87 foreach (int x in value) allowedVariables.Add(new IntData(x)); 88 } 89 } 90 91 public int TrainingSamplesStart { 92 get { return ProblemInjector.GetVariableValue<IntData>("TrainingSamplesStart", null, false).Data; } 93 set { ProblemInjector.GetVariableValue<IntData>("TrainingSamplesStart", null, false).Data = value; } 94 } 95 96 public int TrainingSamplesEnd { 97 get { return ProblemInjector.GetVariableValue<IntData>("TrainingSamplesEnd", null, false).Data; } 98 set { ProblemInjector.GetVariableValue<IntData>("TrainingSamplesEnd", null, false).Data = value; } 99 } 100 101 public int ValidationSamplesStart { 102 get { return ProblemInjector.GetVariableValue<IntData>("ValidationSamplesStart", null, false).Data; } 103 set { ProblemInjector.GetVariableValue<IntData>("ValidationSamplesStart", null, false).Data = value; } 104 } 105 106 public int ValidationSamplesEnd { 107 get { return ProblemInjector.GetVariableValue<IntData>("ValidationSamplesEnd", null, false).Data; } 108 set { ProblemInjector.GetVariableValue<IntData>("ValidationSamplesEnd", null, false).Data = value; } 109 } 110 111 public int TestSamplesStart { 112 get { return ProblemInjector.GetVariableValue<IntData>("TestSamplesStart", null, false).Data; } 113 set { ProblemInjector.GetVariableValue<IntData>("TestSamplesStart", null, false).Data = value; } 114 } 115 116 public int TestSamplesEnd { 117 get { return ProblemInjector.GetVariableValue<IntData>("TestSamplesEnd", null, false).Data; } 118 set { ProblemInjector.GetVariableValue<IntData>("TestSamplesEnd", null, false).Data = value; } 79 119 } 80 120
Note: See TracChangeset
for help on using the changeset viewer.