Changeset 363 for trunk/sources/HeuristicLab.StructureIdentification
- Timestamp:
- 07/04/08 17:30:24 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.StructureIdentification
- Files:
-
- 1 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.StructureIdentification/Evaluation/CoefficientOfDeterminationEvaluator.cs
r155 r363 47 47 double originalDeviationTotalSumOfSquares = 0.0; 48 48 double targetMean = dataset.GetMean(targetVariable); 49 functionTree.PrepareEvaluation(dataset); 49 50 for(int sample = 0; sample < dataset.Rows; sample++) { 50 double estimated = functionTree.Evaluate( dataset,sample);51 double estimated = functionTree.Evaluate(sample); 51 52 double original = dataset.GetValue(sample, targetVariable); 52 53 if(!double.IsNaN(original) && !double.IsInfinity(original)) { -
trunk/sources/HeuristicLab.StructureIdentification/Evaluation/EarlyStoppingMeanSquaredErrorEvaluator.cs
r334 r363 60 60 double errorsSquaredSum = 0; 61 61 double targetMean = dataset.GetMean(targetVariable); 62 functionTree.PrepareEvaluation(dataset); 62 63 for(int sample = trainingStart; sample < trainingEnd; sample++) { 63 double estimated = functionTree.Evaluate( dataset,sample);64 double estimated = functionTree.Evaluate(sample); 64 65 double original = dataset.GetValue(sample, targetVariable); 65 66 if(double.IsNaN(estimated) || double.IsInfinity(estimated)) { -
trunk/sources/HeuristicLab.StructureIdentification/Evaluation/GPEvaluatorBase.cs
r334 r363 57 57 this.totalEvaluatedNodes = scope.GetVariableValue<DoubleData>("TotalEvaluatedNodes", true).Data; 58 58 double result = Evaluate(scope, functionTree, targetVariable, dataset); 59 scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("Quality"), new DoubleData(result))); 59 60 DoubleData quality = GetVariableValue<DoubleData>("Quality", scope, false, false); 61 if(quality == null) { 62 scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("Quality"), new DoubleData(result))); 63 } else { 64 quality.Data = result; 65 } 66 60 67 return null; 61 68 } -
trunk/sources/HeuristicLab.StructureIdentification/Evaluation/MCCEvaluator.cs
r191 r363 54 54 double negative = 0; 55 55 double targetMean = dataset.GetMean(targetVariable); 56 functionTree.PrepareEvaluation(dataset); 56 57 for(int sample = 0; sample < dataset.Rows; sample++) { 57 double est = functionTree.Evaluate( dataset,sample);58 double est = functionTree.Evaluate(sample); 58 59 double orig = dataset.GetValue(sample, targetVariable); 59 60 if(double.IsNaN(est) || double.IsInfinity(est)) { -
trunk/sources/HeuristicLab.StructureIdentification/Evaluation/MeanSquaredErrorEvaluator.cs
r334 r363 60 60 } 61 61 62 functionTree.PrepareEvaluation(dataset); 62 63 for(int sample = trainingStart; sample < trainingEnd; sample++) { 63 double estimated = functionTree.Evaluate( dataset,sample);64 double estimated = functionTree.Evaluate(sample); 64 65 double original = dataset.GetValue(sample, targetVariable); 65 66 if(double.IsNaN(estimated) || double.IsInfinity(estimated)) { -
trunk/sources/HeuristicLab.StructureIdentification/Evaluation/VarianceAccountedForEvaluator.cs
r155 r363 57 57 double[] originalTargetVariableValues = new double[dataset.Rows]; 58 58 double targetMean = dataset.GetMean(targetVariable); 59 functionTree.PrepareEvaluation(dataset); 59 60 for(int sample = 0; sample < dataset.Rows; sample++) { 60 double estimated = functionTree.Evaluate( dataset,sample);61 double estimated = functionTree.Evaluate(sample); 61 62 double original = dataset.GetValue(sample, targetVariable); 62 63 if(!double.IsNaN(original) && !double.IsInfinity(original)) { -
trunk/sources/HeuristicLab.StructureIdentification/HeuristicLab.StructureIdentification.csproj
r358 r363 48 48 </ItemGroup> 49 49 <ItemGroup> 50 <Compile Include="Evaluation\SimpleEvaluator.cs" /> 50 51 <Compile Include="ProbabilisticTreeCreator.cs" /> 51 52 <Compile Include="Evaluation\CoefficientOfDeterminationEvaluator.cs" /> -
trunk/sources/HeuristicLab.StructureIdentification/StructIdProblemInjector.cs
r172 r363 41 41 AddVariableInfo(new VariableInfo("TargetVariable", "TargetVariable", typeof(IntData), VariableKind.New)); 42 42 AddVariable(new Variable("TargetVariable", new IntData())); 43 AddVariableInfo(new VariableInfo("TrainingSamplesStart", "TrainingSamplesStart", typeof(IntData), VariableKind.New)); 44 AddVariable(new Variable("TrainingSamplesStart", new IntData())); 45 AddVariableInfo(new VariableInfo("TrainingSamplesEnd", "TrainingSamplesEnd", typeof(IntData), VariableKind.New)); 46 AddVariable(new Variable("TrainingSamplesEnd", new IntData())); 47 AddVariableInfo(new VariableInfo("ValidationSamplesStart", "ValidationSamplesStart", typeof(IntData), VariableKind.New)); 48 AddVariable(new Variable("ValidationSamplesStart", new IntData())); 49 AddVariableInfo(new VariableInfo("ValidationSamplesEnd", "ValidationSamplesEnd", typeof(IntData), VariableKind.New)); 50 AddVariable(new Variable("ValidationSamplesEnd", new IntData())); 43 51 } 44 52 … … 50 58 scope.AddVariable(new Variable(scope.TranslateName("Dataset"), (IItem)GetVariable("Dataset").Value.Clone())); 51 59 scope.AddVariable(new Variable(scope.TranslateName("TargetVariable"), (IItem)GetVariable("TargetVariable").Value.Clone())); 60 scope.AddVariable(new Variable(scope.TranslateName("TrainingSamplesStart"), (IItem)GetVariable("TrainingSamplesStart").Value.Clone())); 61 scope.AddVariable(new Variable(scope.TranslateName("TrainingSamplesEnd"), (IItem)GetVariable("TrainingSamplesEnd").Value.Clone())); 62 scope.AddVariable(new Variable(scope.TranslateName("ValidationSamplesStart"), (IItem)GetVariable("ValidationSamplesStart").Value.Clone())); 63 scope.AddVariable(new Variable(scope.TranslateName("ValidationSamplesEnd"), (IItem)GetVariable("ValidationSamplesEnd").Value.Clone())); 52 64 return null; 53 65 } -
trunk/sources/HeuristicLab.StructureIdentification/StructIdProblemInjectorView.Designer.cs
r168 r363 51 51 this.variableInfosTabPage = new System.Windows.Forms.TabPage(); 52 52 this.operatorBaseVariableInfosView = new HeuristicLab.Core.OperatorBaseVariableInfosView(); 53 this.tabPage1 = new System.Windows.Forms.TabPage(); 54 this.operatorBaseVariablesView = new HeuristicLab.Core.OperatorBaseVariablesView(); 53 55 this.descriptionTabPage = new System.Windows.Forms.TabPage(); 54 56 this.operatorBaseDescriptionView = new HeuristicLab.Core.OperatorBaseDescriptionView(); … … 57 59 this.dataTabPage.SuspendLayout(); 58 60 this.variableInfosTabPage.SuspendLayout(); 61 this.tabPage1.SuspendLayout(); 59 62 this.descriptionTabPage.SuspendLayout(); 60 63 this.SuspendLayout(); … … 81 84 this.tabControl.Controls.Add(this.dataTabPage); 82 85 this.tabControl.Controls.Add(this.variableInfosTabPage); 86 this.tabControl.Controls.Add(this.tabPage1); 83 87 this.tabControl.Controls.Add(this.descriptionTabPage); 84 88 this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill; … … 122 126 this.operatorBaseVariableInfosView.TabIndex = 0; 123 127 // 128 // tabPage1 129 // 130 this.tabPage1.Controls.Add(this.operatorBaseVariablesView); 131 this.tabPage1.Location = new System.Drawing.Point(4, 22); 132 this.tabPage1.Name = "tabPage1"; 133 this.tabPage1.Padding = new System.Windows.Forms.Padding(3); 134 this.tabPage1.Size = new System.Drawing.Size(499, 425); 135 this.tabPage1.TabIndex = 3; 136 this.tabPage1.Text = "Variables"; 137 this.tabPage1.UseVisualStyleBackColor = true; 138 // 139 // operatorBaseVariablesView 140 // 141 this.operatorBaseVariablesView.Caption = "Operator"; 142 this.operatorBaseVariablesView.Dock = System.Windows.Forms.DockStyle.Fill; 143 this.operatorBaseVariablesView.Location = new System.Drawing.Point(3, 3); 144 this.operatorBaseVariablesView.Name = "operatorBaseVariablesView"; 145 this.operatorBaseVariablesView.Operator = null; 146 this.operatorBaseVariablesView.Size = new System.Drawing.Size(493, 419); 147 this.operatorBaseVariablesView.TabIndex = 0; 148 // 124 149 // descriptionTabPage 125 150 // … … 143 168 this.operatorBaseDescriptionView.TabIndex = 0; 144 169 // 145 // datasetView 170 // datasetView1 146 171 // 147 172 this.datasetView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 148 173 | System.Windows.Forms.AnchorStyles.Left) 149 174 | System.Windows.Forms.AnchorStyles.Right))); 150 this.datasetView.Caption = "View"; 175 this.datasetView.Caption = "Editor"; 176 this.datasetView.Dataset = null; 177 this.datasetView.Filename = null; 151 178 this.datasetView.Location = new System.Drawing.Point(6, 33); 152 this.datasetView.Name = "datasetView ";179 this.datasetView.Name = "datasetView1"; 153 180 this.datasetView.Size = new System.Drawing.Size(487, 386); 154 181 this.datasetView.TabIndex = 7; … … 164 191 this.dataTabPage.ResumeLayout(false); 165 192 this.variableInfosTabPage.ResumeLayout(false); 193 this.tabPage1.ResumeLayout(false); 166 194 this.descriptionTabPage.ResumeLayout(false); 167 195 this.ResumeLayout(false); … … 179 207 private System.Windows.Forms.TabPage descriptionTabPage; 180 208 private HeuristicLab.Core.OperatorBaseDescriptionView operatorBaseDescriptionView; 209 private System.Windows.Forms.TabPage tabPage1; 210 private HeuristicLab.Core.OperatorBaseVariablesView operatorBaseVariablesView; 181 211 private HeuristicLab.DataAnalysis.DatasetView datasetView; 182 212 } -
trunk/sources/HeuristicLab.StructureIdentification/StructIdProblemInjectorView.cs
r274 r363 89 89 if (success) { 90 90 Dataset dataset = (Dataset)StructIdProblemInjector.GetVariable("Dataset").Value; 91 dataset.Rows = parser. TrainingSamplesEnd - parser.TrainingSamplesStart;91 dataset.Rows = parser.Rows; 92 92 dataset.Columns = parser.Columns; 93 93 dataset.VariableNames = parser.VariableNames; … … 95 95 dataset.Samples = new double[dataset.Rows * dataset.Columns]; 96 96 Array.Copy(parser.Samples, dataset.Samples, dataset.Columns * dataset.Rows); 97 97 ((IntData)StructIdProblemInjector.GetVariable("TrainingSamplesStart").Value).Data = parser.TrainingSamplesStart; 98 ((IntData)StructIdProblemInjector.GetVariable("TrainingSamplesEnd").Value).Data = parser.TrainingSamplesEnd; 99 ((IntData)StructIdProblemInjector.GetVariable("ValidationSamplesStart").Value).Data = parser.ValidationSamplesStart; 100 ((IntData)StructIdProblemInjector.GetVariable("ValidationSamplesEnd").Value).Data = parser.ValidationSamplesEnd; 98 101 ((IntData)StructIdProblemInjector.GetVariable("TargetVariable").Value).Data = parser.TargetVariable; 99 102 Refresh();
Note: See TracChangeset
for help on using the changeset viewer.