Changeset 2578 for trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/SimpleEvaluator.cs
- Timestamp:
- 01/02/10 18:10:15 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/SimpleEvaluator.cs
r2577 r2578 23 23 using HeuristicLab.Data; 24 24 using HeuristicLab.DataAnalysis; 25 using HeuristicLab.GP.Interfaces; 26 using HeuristicLab.Modeling; 27 using System.Linq; 25 28 26 29 namespace HeuristicLab.GP.StructureIdentification { … … 31 34 } 32 35 33 public override void Evaluate(IScope scope, I TreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end) {36 public override void Evaluate(IScope scope, IFunctionTree tree, ITreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end) { 34 37 DoubleMatrixData values = GetVariableValue<DoubleMatrixData>("Values", scope, false, false); 35 38 if (values == null) { … … 42 45 } 43 46 44 double[,] v = new double[end - start, 2]; 45 46 for (int sample = start; sample < end; sample++) { 47 double estimated = evaluator.Evaluate(sample); 48 double original = dataset.GetValue(sample, targetVariable); 49 50 v[sample - start, 0] = original; 51 v[sample - start, 1] = estimated; 52 } 47 double[,] v = Matrix<double>.Create( 48 dataset.GetVariableValues(targetVariable, start, end), 49 evaluator.Evaluate(dataset, tree, Enumerable.Range(start, end - start)).ToArray()); 53 50 values.Data = v; 54 51 }
Note: See TracChangeset
for help on using the changeset viewer.