Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/19/10 18:49:17 (14 years ago)
Author:
gkronber
Message:

Removed max. and min. time offset constraints as algorithm parameters and from all engines. The time constraints were added to the relevant terminal symbols (variable & differential) instead. The time offset constraint can be changed by editing the symbols in the function library. #880 (Max and min time offsets for variable symbols are not set correctly by FunctionLibraryInjectors)

Location:
trunk/sources/HeuristicLab.CEDMA.Server/3.3
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherView.Designer.cs

    r2824 r2843  
    2424    /// </summary>
    2525    private void InitializeComponent() {
     26      this.components = new System.ComponentModel.Container();
    2627      this.targetVariableList = new System.Windows.Forms.CheckedListBox();
    2728      this.inputVariableList = new System.Windows.Forms.CheckedListBox();
     
    3031      this.splitContainer = new System.Windows.Forms.SplitContainer();
    3132      this.learningTaskGroupBox = new System.Windows.Forms.GroupBox();
     33      this.editEngineButton = new System.Windows.Forms.Button();
    3234      this.setAlgorithmDefault = new System.Windows.Forms.Button();
    3335      this.autoregressiveLabel = new System.Windows.Forms.Label();
    3436      this.classificationRadioButton = new System.Windows.Forms.RadioButton();
    3537      this.algorithmsListBox = new System.Windows.Forms.CheckedListBox();
    36       this.minTimeOffsetLabel = new System.Windows.Forms.Label();
    37       this.minTimeOffsetTextBox = new System.Windows.Forms.TextBox();
    38       this.maxTimeOffsetLabel = new System.Windows.Forms.Label();
    3938      this.regressionRadioButton = new System.Windows.Forms.RadioButton();
    40       this.maxTimeOffsetTextBox = new System.Windows.Forms.TextBox();
    4139      this.timeSeriesRadioButton = new System.Windows.Forms.RadioButton();
    4240      this.autoregressiveCheckBox = new System.Windows.Forms.CheckBox();
     
    5250      this.testLabel = new System.Windows.Forms.Label();
    5351      this.setAllButton = new System.Windows.Forms.Button();
    54       this.editEngineButton = new System.Windows.Forms.Button();
     52      this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
    5553      this.splitContainer.Panel1.SuspendLayout();
    5654      this.splitContainer.Panel2.SuspendLayout();
     
    5856      this.learningTaskGroupBox.SuspendLayout();
    5957      this.partitioningGroupBox.SuspendLayout();
     58      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    6059      this.SuspendLayout();
    6160      //
     
    136135      this.learningTaskGroupBox.Controls.Add(this.classificationRadioButton);
    137136      this.learningTaskGroupBox.Controls.Add(this.algorithmsListBox);
    138       this.learningTaskGroupBox.Controls.Add(this.minTimeOffsetLabel);
    139       this.learningTaskGroupBox.Controls.Add(this.minTimeOffsetTextBox);
    140       this.learningTaskGroupBox.Controls.Add(this.maxTimeOffsetLabel);
    141137      this.learningTaskGroupBox.Controls.Add(this.regressionRadioButton);
    142       this.learningTaskGroupBox.Controls.Add(this.maxTimeOffsetTextBox);
    143138      this.learningTaskGroupBox.Controls.Add(this.timeSeriesRadioButton);
    144139      this.learningTaskGroupBox.Controls.Add(this.autoregressiveCheckBox);
     
    146141      this.learningTaskGroupBox.Location = new System.Drawing.Point(6, 236);
    147142      this.learningTaskGroupBox.Name = "learningTaskGroupBox";
    148       this.learningTaskGroupBox.Size = new System.Drawing.Size(343, 321);
     143      this.learningTaskGroupBox.Size = new System.Drawing.Size(343, 341);
    149144      this.learningTaskGroupBox.TabIndex = 36;
    150145      this.learningTaskGroupBox.TabStop = false;
    151146      this.learningTaskGroupBox.Text = "Learning task";
    152147      //
     148      // editEngineButton
     149      //
     150      this.editEngineButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     151      this.editEngineButton.Location = new System.Drawing.Point(108, 312);
     152      this.editEngineButton.Name = "editEngineButton";
     153      this.editEngineButton.Size = new System.Drawing.Size(75, 23);
     154      this.editEngineButton.TabIndex = 37;
     155      this.editEngineButton.Text = "Edit engine";
     156      this.editEngineButton.UseVisualStyleBackColor = true;
     157      this.editEngineButton.Click += new System.EventHandler(this.editEngineButton_Click);
     158      //
    153159      // setAlgorithmDefault
    154160      //
    155161      this.setAlgorithmDefault.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    156       this.setAlgorithmDefault.Location = new System.Drawing.Point(6, 292);
     162      this.setAlgorithmDefault.Location = new System.Drawing.Point(6, 312);
    157163      this.setAlgorithmDefault.Name = "setAlgorithmDefault";
    158164      this.setAlgorithmDefault.Size = new System.Drawing.Size(96, 23);
     
    191197      this.algorithmsListBox.FormattingEnabled = true;
    192198      this.algorithmsListBox.HorizontalScrollbar = true;
    193       this.algorithmsListBox.Location = new System.Drawing.Point(6, 155);
     199      this.algorithmsListBox.Location = new System.Drawing.Point(6, 110);
    194200      this.algorithmsListBox.Name = "algorithmsListBox";
    195       this.algorithmsListBox.Size = new System.Drawing.Size(331, 124);
     201      this.algorithmsListBox.Size = new System.Drawing.Size(331, 184);
    196202      this.algorithmsListBox.TabIndex = 4;
    197203      this.algorithmsListBox.SelectedIndexChanged += new System.EventHandler(this.algorithmsListBox_SelectedIndexChanged);
    198204      this.algorithmsListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.algorithmsListBox_ItemCheck);
    199       //
    200       // minTimeOffsetLabel
    201       //
    202       this.minTimeOffsetLabel.AutoSize = true;
    203       this.minTimeOffsetLabel.Enabled = false;
    204       this.minTimeOffsetLabel.Location = new System.Drawing.Point(38, 106);
    205       this.minTimeOffsetLabel.Name = "minTimeOffsetLabel";
    206       this.minTimeOffsetLabel.Size = new System.Drawing.Size(87, 13);
    207       this.minTimeOffsetLabel.TabIndex = 31;
    208       this.minTimeOffsetLabel.Text = "Min. Time Offset:";
    209       //
    210       // minTimeOffsetTextBox
    211       //
    212       this.minTimeOffsetTextBox.Enabled = false;
    213       this.minTimeOffsetTextBox.Location = new System.Drawing.Point(131, 103);
    214       this.minTimeOffsetTextBox.Name = "minTimeOffsetTextBox";
    215       this.minTimeOffsetTextBox.Size = new System.Drawing.Size(96, 20);
    216       this.minTimeOffsetTextBox.TabIndex = 32;
    217       this.minTimeOffsetTextBox.Validated += new System.EventHandler(this.timeOffsetTextBox_Validated);
    218       this.minTimeOffsetTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.timeOffsetTextBox_Validating);
    219       //
    220       // maxTimeOffsetLabel
    221       //
    222       this.maxTimeOffsetLabel.AutoSize = true;
    223       this.maxTimeOffsetLabel.Enabled = false;
    224       this.maxTimeOffsetLabel.Location = new System.Drawing.Point(35, 132);
    225       this.maxTimeOffsetLabel.Name = "maxTimeOffsetLabel";
    226       this.maxTimeOffsetLabel.Size = new System.Drawing.Size(90, 13);
    227       this.maxTimeOffsetLabel.TabIndex = 33;
    228       this.maxTimeOffsetLabel.Text = "Max. Time Offset:";
    229205      //
    230206      // regressionRadioButton
     
    238214      this.regressionRadioButton.UseVisualStyleBackColor = true;
    239215      this.regressionRadioButton.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChanged);
    240       //
    241       // maxTimeOffsetTextBox
    242       //
    243       this.maxTimeOffsetTextBox.Enabled = false;
    244       this.maxTimeOffsetTextBox.Location = new System.Drawing.Point(131, 129);
    245       this.maxTimeOffsetTextBox.Name = "maxTimeOffsetTextBox";
    246       this.maxTimeOffsetTextBox.Size = new System.Drawing.Size(96, 20);
    247       this.maxTimeOffsetTextBox.TabIndex = 34;
    248       this.maxTimeOffsetTextBox.Validated += new System.EventHandler(this.timeOffsetTextBox_Validated);
    249       this.maxTimeOffsetTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.timeOffsetTextBox_Validating);
    250216      //
    251217      // timeSeriesRadioButton
     
    285251      this.partitioningGroupBox.Controls.Add(this.testLabel);
    286252      this.partitioningGroupBox.Enabled = false;
    287       this.partitioningGroupBox.Location = new System.Drawing.Point(6, 563);
     253      this.partitioningGroupBox.Location = new System.Drawing.Point(6, 583);
    288254      this.partitioningGroupBox.Name = "partitioningGroupBox";
    289       this.partitioningGroupBox.Size = new System.Drawing.Size(343, 122);
     255      this.partitioningGroupBox.Size = new System.Drawing.Size(343, 102);
    290256      this.partitioningGroupBox.TabIndex = 26;
    291257      this.partitioningGroupBox.TabStop = false;
     
    294260      // validationSamplesEndTextBox
    295261      //
    296       this.validationSamplesEndTextBox.Location = new System.Drawing.Point(221, 43);
     262      this.validationSamplesEndTextBox.Location = new System.Drawing.Point(222, 45);
    297263      this.validationSamplesEndTextBox.Name = "validationSamplesEndTextBox";
    298264      this.validationSamplesEndTextBox.Size = new System.Drawing.Size(96, 20);
     
    304270      //
    305271      this.trainingLabel.AutoSize = true;
    306       this.trainingLabel.Location = new System.Drawing.Point(13, 20);
     272      this.trainingLabel.Location = new System.Drawing.Point(14, 22);
    307273      this.trainingLabel.Name = "trainingLabel";
    308274      this.trainingLabel.Size = new System.Drawing.Size(89, 13);
     
    312278      // trainingSamplesStartTextBox
    313279      //
    314       this.trainingSamplesStartTextBox.Location = new System.Drawing.Point(119, 17);
     280      this.trainingSamplesStartTextBox.Location = new System.Drawing.Point(120, 19);
    315281      this.trainingSamplesStartTextBox.Name = "trainingSamplesStartTextBox";
    316282      this.trainingSamplesStartTextBox.Size = new System.Drawing.Size(96, 20);
     
    321287      // trainingSamplesEndTextBox
    322288      //
    323       this.trainingSamplesEndTextBox.Location = new System.Drawing.Point(221, 17);
     289      this.trainingSamplesEndTextBox.Location = new System.Drawing.Point(222, 19);
    324290      this.trainingSamplesEndTextBox.Name = "trainingSamplesEndTextBox";
    325291      this.trainingSamplesEndTextBox.Size = new System.Drawing.Size(96, 20);
     
    331297      //
    332298      this.validationLabel.AutoSize = true;
    333       this.validationLabel.Location = new System.Drawing.Point(5, 46);
     299      this.validationLabel.Location = new System.Drawing.Point(6, 48);
    334300      this.validationLabel.Name = "validationLabel";
    335301      this.validationLabel.Size = new System.Drawing.Size(97, 13);
     
    339305      // testSamplesEndTextBox
    340306      //
    341       this.testSamplesEndTextBox.Location = new System.Drawing.Point(221, 68);
     307      this.testSamplesEndTextBox.Location = new System.Drawing.Point(222, 70);
    342308      this.testSamplesEndTextBox.Name = "testSamplesEndTextBox";
    343309      this.testSamplesEndTextBox.Size = new System.Drawing.Size(96, 20);
     
    348314      // validationSamplesStartTextBox
    349315      //
    350       this.validationSamplesStartTextBox.Location = new System.Drawing.Point(119, 43);
     316      this.validationSamplesStartTextBox.Location = new System.Drawing.Point(120, 45);
    351317      this.validationSamplesStartTextBox.Name = "validationSamplesStartTextBox";
    352318      this.validationSamplesStartTextBox.Size = new System.Drawing.Size(96, 20);
     
    357323      // testSamplesStartTextBox
    358324      //
    359       this.testSamplesStartTextBox.Location = new System.Drawing.Point(119, 68);
     325      this.testSamplesStartTextBox.Location = new System.Drawing.Point(120, 70);
    360326      this.testSamplesStartTextBox.Name = "testSamplesStartTextBox";
    361327      this.testSamplesStartTextBox.Size = new System.Drawing.Size(96, 20);
     
    367333      //
    368334      this.testLabel.AutoSize = true;
    369       this.testLabel.Location = new System.Drawing.Point(30, 71);
     335      this.testLabel.Location = new System.Drawing.Point(31, 73);
    370336      this.testLabel.Name = "testLabel";
    371337      this.testLabel.Size = new System.Drawing.Size(72, 13);
     
    384350      this.setAllButton.Click += new System.EventHandler(this.setAllButton_Click);
    385351      //
    386       // editEngineButton
    387       //
    388       this.editEngineButton.Location = new System.Drawing.Point(108, 292);
    389       this.editEngineButton.Name = "editEngineButton";
    390       this.editEngineButton.Size = new System.Drawing.Size(75, 23);
    391       this.editEngineButton.TabIndex = 37;
    392       this.editEngineButton.Text = "Edit engine";
    393       this.editEngineButton.UseVisualStyleBackColor = true;
    394       this.editEngineButton.Click += new System.EventHandler(this.editEngineButton_Click);
     352      // errorProvider
     353      //
     354      this.errorProvider.ContainerControl = this;
    395355      //
    396356      // DispatcherView
     
    410370      this.partitioningGroupBox.ResumeLayout(false);
    411371      this.partitioningGroupBox.PerformLayout();
     372      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    412373      this.ResumeLayout(false);
    413374
     
    436397    private System.Windows.Forms.Label autoregressiveLabel;
    437398    private System.Windows.Forms.RadioButton classificationRadioButton;
    438     private System.Windows.Forms.Label minTimeOffsetLabel;
    439     private System.Windows.Forms.TextBox minTimeOffsetTextBox;
    440     private System.Windows.Forms.Label maxTimeOffsetLabel;
    441399    private System.Windows.Forms.RadioButton regressionRadioButton;
    442     private System.Windows.Forms.TextBox maxTimeOffsetTextBox;
    443400    private System.Windows.Forms.RadioButton timeSeriesRadioButton;
    444401    private System.Windows.Forms.CheckBox autoregressiveCheckBox;
    445402    private System.Windows.Forms.Button setAlgorithmDefault;
    446403    private System.Windows.Forms.Button editEngineButton;
     404    private System.Windows.Forms.ErrorProvider errorProvider;
    447405  }
    448406}
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherView.cs

    r2824 r2843  
    102102      testSamplesStartTextBox.Text = selectedSpec.TestSamplesStart.ToString();
    103103      testSamplesEndTextBox.Text = selectedSpec.TestSamplesEnd.ToString();
    104       minTimeOffsetTextBox.Text = selectedSpec.MinTimeOffset.ToString();
    105       maxTimeOffsetTextBox.Text = selectedSpec.MaxTimeOffset.ToString();
    106104      autoregressiveCheckBox.Checked = selectedSpec.AutoRegressive;
    107105    }
     
    136134          ProblemSpecification spec = dispatcher.GetProblemSpecification(targetVar);
    137135          spec.LearningTask = selectedSpec.LearningTask;
    138           spec.MinTimeOffset = selectedSpec.MinTimeOffset;
    139           spec.MaxTimeOffset = selectedSpec.MaxTimeOffset;
    140136          spec.AutoRegressive = selectedSpec.AutoRegressive;
    141137          var curAllowedAlgos = dispatcher.GetAllowedAlgorithms(targetVar).ToList();
     
    157153
    158154    private void radioButton_CheckedChanged(object sender, EventArgs e) {
    159       minTimeOffsetLabel.Enabled = timeSeriesRadioButton.Checked;
    160       minTimeOffsetTextBox.Enabled = timeSeriesRadioButton.Checked;
    161       maxTimeOffsetLabel.Enabled = timeSeriesRadioButton.Checked;
    162       maxTimeOffsetTextBox.Enabled = timeSeriesRadioButton.Checked;
    163155      autoregressiveCheckBox.Enabled = timeSeriesRadioButton.Checked;
    164156      autoregressiveLabel.Enabled = timeSeriesRadioButton.Checked;
     
    171163      }
    172164      UpdateAlgorithms();
    173     }
    174 
    175     private void timeOffsetTextBox_Validating(object sender, CancelEventArgs e) {
    176       int min, max;
    177       e.Cancel = !int.TryParse(minTimeOffsetTextBox.Text, out min);
    178       e.Cancel = !int.TryParse(maxTimeOffsetTextBox.Text, out max);
    179       e.Cancel = min > max;
    180     }
    181 
    182     private void timeOffsetTextBox_Validated(object sender, EventArgs e) {
    183       selectedSpec.MinTimeOffset = int.Parse(minTimeOffsetTextBox.Text);
    184       selectedSpec.MaxTimeOffset = int.Parse(maxTimeOffsetTextBox.Text);
    185165    }
    186166
     
    255235      editEngineButton.Enabled = algorithmsListBox.SelectedItems.Count > 0;
    256236    }
    257 
    258237  }
    259238}
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherView.resx

    r2088 r2843  
    118118    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
    119119  </resheader>
     120  <metadata name="errorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     121    <value>17, 17</value>
     122  </metadata>
    120123</root>
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/ProblemSpecification.cs

    r2422 r2843  
    8383    }
    8484
    85     public int MaxTimeOffset { get; set; }
    86     public int MinTimeOffset { get; set; }
    87 
    8885    public bool AutoRegressive { get; set; }
    8986
     
    108105      LearningTask = original.LearningTask;
    109106      TargetVariable = original.TargetVariable;
    110       MinTimeOffset = original.MinTimeOffset;
    111       MaxTimeOffset = original.MaxTimeOffset;
    112107      AutoRegressive = original.AutoRegressive;
    113108      TrainingSamplesStart = original.TrainingSamplesStart;
     
    134129      return
    135130        other.LearningTask == LearningTask &&
    136         other.MinTimeOffset == MinTimeOffset &&
    137         other.MaxTimeOffset == MaxTimeOffset &&
    138131        other.AutoRegressive == AutoRegressive &&
    139132        other.TargetVariable == TargetVariable &&
     
    156149        LearningTask.GetHashCode() |
    157150        TargetVariable.GetHashCode() |
    158         MinTimeOffset.GetHashCode() |
    159         MaxTimeOffset.GetHashCode() |
    160151        AutoRegressive.GetHashCode() |
    161152        TrainingSamplesStart.GetHashCode() |
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/SimpleDispatcher.cs

    r2825 r2843  
    106106    private object locker = new object();
    107107
     108
     109    public double TrainingSetPercentageSize {
     110      get;
     111      set;
     112    }
     113
     114    public int SkippedRowsBeginning {
     115      get;
     116      set;
     117    }
     118
     119    public int SkippedRowsEnd {
     120      get;
     121      set;
     122    }
     123
    108124    public SimpleDispatcher(IModelingDatabase database, Dataset dataset) {
    109125      this.dataset = dataset;
     
    117133      finishedAndDispatchedRuns = new Dictionary<string, List<AlgorithmConfiguration>>();
    118134
    119      
     135
    120136      defaultAlgorithms = ApplicationManager.Manager.GetInstances<HeuristicLab.Modeling.IAlgorithm>().ToArray();
     137
     138      TrainingSetPercentageSize = 0.5;
     139      SkippedRowsBeginning = 2;
    121140
    122141      // PopulateFinishedRuns();
     
    190209
    191210      if (spec.LearningTask == LearningTask.TimeSeries) {
    192         ITimeSeriesAlgorithm timeSeriesAlgo = (ITimeSeriesAlgorithm)algo;
    193         timeSeriesAlgo.MinTimeOffset = spec.MinTimeOffset;
    194         timeSeriesAlgo.MaxTimeOffset = spec.MaxTimeOffset;
    195         timeSeriesAlgo.TrainingSamplesStart = spec.TrainingSamplesStart - spec.MinTimeOffset + 1; // first possible index is 1 because of differential symbol
     211        algo.TrainingSamplesStart = spec.TrainingSamplesStart + 1; // first possible index is 1 because of differential symbol
    196212        if (spec.AutoRegressive) {
    197213          allowedFeatures.Add(spec.TargetVariable);
     
    255271        if (!(double.IsNaN(x) || double.IsInfinity(x))) break;
    256272      }
     273      firstValueIndex += SkippedRowsBeginning;
    257274      // find index of last correct target value
    258275      int lastValueIndex;
     
    261278        if (!(double.IsNaN(x) || double.IsInfinity(x))) break;
    262279      }
     280      lastValueIndex -= SkippedRowsEnd;
    263281
    264282      int validTargetRange = lastValueIndex - firstValueIndex;
    265283      spec.TrainingSamplesStart = firstValueIndex;
    266       spec.TrainingSamplesEnd = firstValueIndex + (int)Math.Floor(validTargetRange * 0.5);
     284      spec.TrainingSamplesEnd = firstValueIndex + (int)Math.Floor(validTargetRange * TrainingSetPercentageSize);
    267285      spec.ValidationSamplesStart = spec.TrainingSamplesEnd;
    268       spec.ValidationSamplesEnd = firstValueIndex + (int)Math.Floor(validTargetRange * 0.75);
     286      spec.ValidationSamplesEnd = spec.TrainingSamplesEnd + (int)Math.Floor(validTargetRange * (1 - TrainingSetPercentageSize) / 2.0);
    269287      spec.TestSamplesStart = spec.ValidationSamplesEnd;
    270288      spec.TestSamplesEnd = lastValueIndex;
Note: See TracChangeset for help on using the changeset viewer.