Changeset 2373 for trunk/sources
- Timestamp:
- 09/21/09 14:49:53 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.SupportVectorMachines/3.2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.SupportVectorMachines/3.2/Predictor.cs
r2347 r2373 41 41 private string targetVariable; 42 42 private int minTimeOffset; 43 public int MinTimeOffset { 44 get { return minTimeOffset; } 45 } 43 46 private int maxTimeOffset; 47 public int MaxTimeOffset { 48 get { return maxTimeOffset; } 49 } 44 50 45 51 public Predictor() : base() { } // for persistence -
trunk/sources/HeuristicLab.SupportVectorMachines/3.2/PredictorBuilder.cs
r2328 r2373 39 39 AddVariableInfo(new VariableInfo("TrainingSamplesStart", "Start index of the training set", typeof(IntData), VariableKind.In)); 40 40 AddVariableInfo(new VariableInfo("TrainingSamplesEnd", "End index of the training set", typeof(IntData), VariableKind.In)); 41 AddVariableInfo(new VariableInfo("MaxTimeOffset", "(optional) highest allowed time offset value", typeof(IntData), VariableKind.In)); 42 AddVariableInfo(new VariableInfo("MinTimeOffset", "(optional) lowest allowed time offset value", typeof(IntData), VariableKind.In)); 41 43 AddVariableInfo(new VariableInfo("PunishmentFactor", "The punishment factor limits the range of predicted values", typeof(DoubleData), VariableKind.In)); 42 44 AddVariableInfo(new VariableInfo("Predictor", "The predictor can be used to generate estimated values", typeof(IPredictor), VariableKind.New)); … … 53 55 int start = GetVariableValue<IntData>("TrainingSamplesStart", scope, true).Data; 54 56 int end = GetVariableValue<IntData>("TrainingSamplesEnd", scope, true).Data; 57 IntData maxTimeOffsetData = GetVariableValue<IntData>("MaxTimeOffset", scope, true, false); 58 int maxTimeOffset = maxTimeOffsetData == null ? 0 : maxTimeOffsetData.Data; 59 IntData minTimeOffsetData = GetVariableValue<IntData>("MinTimeOffset", scope, true, false); 60 int minTimeOffset = minTimeOffsetData == null ? 0 : minTimeOffsetData.Data; 55 61 double punishmentFactor = GetVariableValue<DoubleData>("PunishmentFactor", scope, true).Data; 56 62 … … 63 69 double range = ds.GetRange(targetVariable, start, end); 64 70 65 Predictor predictor = new Predictor(model, targetVariableName, variableNames );71 Predictor predictor = new Predictor(model, targetVariableName, variableNames, minTimeOffset, maxTimeOffset); 66 72 predictor.LowerPredictionLimit = mean - punishmentFactor * range; 67 73 predictor.UpperPredictionLimit = mean + punishmentFactor * range; -
trunk/sources/HeuristicLab.SupportVectorMachines/3.2/PredictorView.Designer.cs
r2327 r2373 49 49 this.upperLimitTextbox = new System.Windows.Forms.TextBox(); 50 50 this.upperPredictionLimit = new System.Windows.Forms.Label(); 51 this.maxTimeOffsetTextBox = new System.Windows.Forms.TextBox(); 52 this.maxTimeOffsetLabel = new System.Windows.Forms.Label(); 53 this.minTimeOffsetTextBox = new System.Windows.Forms.TextBox(); 54 this.minTimeOffsetLabel = new System.Windows.Forms.Label(); 51 55 this.SuspendLayout(); 52 56 // … … 54 58 // 55 59 this.lowerPredictionLimit.AutoSize = true; 56 this.lowerPredictionLimit.Location = new System.Drawing.Point(3, 1 37);60 this.lowerPredictionLimit.Location = new System.Drawing.Point(3, 189); 57 61 this.lowerPredictionLimit.Name = "lowerPredictionLimit"; 58 62 this.lowerPredictionLimit.Size = new System.Drawing.Size(113, 13); … … 62 66 // lowerLimitTextbox 63 67 // 64 this.lowerLimitTextbox.Location = new System.Drawing.Point(144, 1 34);68 this.lowerLimitTextbox.Location = new System.Drawing.Point(144, 186); 65 69 this.lowerLimitTextbox.Name = "lowerLimitTextbox"; 66 70 this.lowerLimitTextbox.ReadOnly = true; … … 70 74 // upperLimitTextbox 71 75 // 72 this.upperLimitTextbox.Location = new System.Drawing.Point(144, 160);76 this.upperLimitTextbox.Location = new System.Drawing.Point(144, 212); 73 77 this.upperLimitTextbox.Name = "upperLimitTextbox"; 74 78 this.upperLimitTextbox.ReadOnly = true; … … 79 83 // 80 84 this.upperPredictionLimit.AutoSize = true; 81 this.upperPredictionLimit.Location = new System.Drawing.Point(3, 163);85 this.upperPredictionLimit.Location = new System.Drawing.Point(3, 215); 82 86 this.upperPredictionLimit.Name = "upperPredictionLimit"; 83 87 this.upperPredictionLimit.Size = new System.Drawing.Size(113, 13); … … 85 89 this.upperPredictionLimit.Text = "Upper Prediction Limit:"; 86 90 // 91 // maxTimeOffsetTextBox 92 // 93 this.maxTimeOffsetTextBox.Location = new System.Drawing.Point(144, 134); 94 this.maxTimeOffsetTextBox.Name = "maxTimeOffsetTextBox"; 95 this.maxTimeOffsetTextBox.ReadOnly = true; 96 this.maxTimeOffsetTextBox.Size = new System.Drawing.Size(100, 20); 97 this.maxTimeOffsetTextBox.TabIndex = 18; 98 // 99 // maxTimeOffsetLabel 100 // 101 this.maxTimeOffsetLabel.AutoSize = true; 102 this.maxTimeOffsetLabel.Location = new System.Drawing.Point(3, 137); 103 this.maxTimeOffsetLabel.Name = "maxTimeOffsetLabel"; 104 this.maxTimeOffsetLabel.Size = new System.Drawing.Size(81, 13); 105 this.maxTimeOffsetLabel.TabIndex = 17; 106 this.maxTimeOffsetLabel.Text = "Max time offset:"; 107 // 108 // minTimeOffsetTextBox 109 // 110 this.minTimeOffsetTextBox.Location = new System.Drawing.Point(144, 160); 111 this.minTimeOffsetTextBox.Name = "minTimeOffsetTextBox"; 112 this.minTimeOffsetTextBox.ReadOnly = true; 113 this.minTimeOffsetTextBox.Size = new System.Drawing.Size(100, 20); 114 this.minTimeOffsetTextBox.TabIndex = 20; 115 // 116 // minTimeOffsetLabel 117 // 118 this.minTimeOffsetLabel.AutoSize = true; 119 this.minTimeOffsetLabel.Location = new System.Drawing.Point(3, 163); 120 this.minTimeOffsetLabel.Name = "minTimeOffsetLabel"; 121 this.minTimeOffsetLabel.Size = new System.Drawing.Size(78, 13); 122 this.minTimeOffsetLabel.TabIndex = 19; 123 this.minTimeOffsetLabel.Text = "Min time offset:"; 124 // 87 125 // PredictorView 88 126 // 89 127 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 90 128 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 129 this.Controls.Add(this.minTimeOffsetTextBox); 130 this.Controls.Add(this.minTimeOffsetLabel); 131 this.Controls.Add(this.maxTimeOffsetTextBox); 132 this.Controls.Add(this.maxTimeOffsetLabel); 91 133 this.Controls.Add(this.upperLimitTextbox); 92 134 this.Controls.Add(this.upperPredictionLimit); … … 94 136 this.Controls.Add(this.lowerPredictionLimit); 95 137 this.Name = "PredictorView"; 96 this.Size = new System.Drawing.Size(2 91, 193);138 this.Size = new System.Drawing.Size(252, 240); 97 139 this.Controls.SetChildIndex(this.lowerPredictionLimit, 0); 98 140 this.Controls.SetChildIndex(this.lowerLimitTextbox, 0); 99 141 this.Controls.SetChildIndex(this.upperPredictionLimit, 0); 100 142 this.Controls.SetChildIndex(this.upperLimitTextbox, 0); 143 this.Controls.SetChildIndex(this.maxTimeOffsetLabel, 0); 144 this.Controls.SetChildIndex(this.maxTimeOffsetTextBox, 0); 145 this.Controls.SetChildIndex(this.minTimeOffsetLabel, 0); 146 this.Controls.SetChildIndex(this.minTimeOffsetTextBox, 0); 101 147 this.ResumeLayout(false); 102 148 this.PerformLayout(); … … 110 156 private System.Windows.Forms.TextBox upperLimitTextbox; 111 157 private System.Windows.Forms.Label upperPredictionLimit; 158 private System.Windows.Forms.TextBox maxTimeOffsetTextBox; 159 private System.Windows.Forms.Label maxTimeOffsetLabel; 160 private System.Windows.Forms.TextBox minTimeOffsetTextBox; 161 private System.Windows.Forms.Label minTimeOffsetLabel; 112 162 113 163 } -
trunk/sources/HeuristicLab.SupportVectorMachines/3.2/PredictorView.cs
r2327 r2373 34 34 private Predictor predictor; 35 35 36 public PredictorView() : base() { 36 public PredictorView() 37 : base() { 37 38 InitializeComponent(); 38 } 39 } 39 40 40 41 public PredictorView(Predictor predictor) … … 43 44 this.predictor = predictor; 44 45 UpdateControls(); 45 } 46 47 protected override void UpdateControls() { 48 base.UpdateControls(); 49 lowerLimitTextbox.Text = predictor.LowerPredictionLimit.ToString(); 50 upperLimitTextbox.Text = predictor.UpperPredictionLimit.ToString(); 46 lowerLimitTextbox.DataBindings.Add(new Binding("Text", predictor, "LowerPredictionLimit")); 47 upperLimitTextbox.DataBindings.Add(new Binding("Text", predictor, "UpperPredictionLimit")); 48 maxTimeOffsetTextBox.DataBindings.Add(new Binding("Text", predictor, "MaxTimeOffset")); 49 minTimeOffsetTextBox.DataBindings.Add(new Binding("Text", predictor, "MinTimeOffset")); 51 50 } 52 51 }
Note: See TracChangeset
for help on using the changeset viewer.