- Timestamp:
- 06/10/09 19:05:34 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/SimpleEvaluator.cs
r1891 r2041 33 33 public SimpleEvaluator() 34 34 : base() { 35 AddVariableInfo(new VariableInfo("Values", "T he values of the target variable as predicted by the model and the original value of the target variable", typeof(ItemList), VariableKind.New | VariableKind.Out));35 AddVariableInfo(new VariableInfo("Values", "Target vs. predicted values", typeof(DoubleMatrixData), VariableKind.New | VariableKind.Out)); 36 36 } 37 37 38 38 public override void Evaluate(IScope scope, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) { 39 ItemList values = GetVariableValue<ItemList>("Values", scope, false, false);39 DoubleMatrixData values = GetVariableValue<DoubleMatrixData>("Values", scope, false, false); 40 40 if (values == null) { 41 values = new ItemList();41 values = new DoubleMatrixData(); 42 42 IVariableInfo info = GetVariableInfo("Values"); 43 43 if (info.Local) … … 46 46 scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName(info.FormalName), values)); 47 47 } 48 values.Clear(); 48 49 double[,] v = new double[end - start, 2]; 49 50 50 51 for (int sample = start; sample < end; sample++) { 51 ItemList row = new ItemList();52 52 double estimated = evaluator.Evaluate(sample); 53 53 double original = dataset.GetValue(sample, targetVariable); … … 55 55 dataset.SetValue(sample, targetVariable, estimated); 56 56 } 57 row.Add(new DoubleData(estimated)); 58 row.Add(new DoubleData(original)); 59 values.Add(row); 57 v[sample - start, 0] = original; 58 v[sample - start, 1] = estimated; 60 59 } 60 values.Data = v; 61 61 } 62 62 }
Note: See TracChangeset
for help on using the changeset viewer.