Changeset 482 for trunk/sources/HeuristicLab.StructureIdentification/Evaluation/MeanSquaredErrorEvaluator.cs
- Timestamp:
- 08/10/08 12:44:27 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.StructureIdentification/Evaluation/MeanSquaredErrorEvaluator.cs
r480 r482 32 32 namespace HeuristicLab.StructureIdentification { 33 33 public class MeanSquaredErrorEvaluator : GPEvaluatorBase { 34 protected DoubleData mse; 34 35 public override string Description { 35 36 get { … … 41 42 public MeanSquaredErrorEvaluator() 42 43 : base() { 44 AddVariableInfo(new VariableInfo("MSE", "The mean squared error of the model", typeof(DoubleData), VariableKind.New)); 43 45 } 44 46 45 public override double Evaluate(int start, int end) { 47 public override IOperation Apply(IScope scope) { 48 mse = GetVariableValue<DoubleData>("MSE", scope, false, false); 49 if(mse == null) { 50 mse = new DoubleData(); 51 scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("MSE"), mse)); 52 } 53 54 return base.Apply(scope); 55 } 56 57 public override void Evaluate(int start, int end) { 46 58 double errorsSquaredSum = 0; 47 59 for(int sample = start; sample < end; sample++) { … … 59 71 errorsSquaredSum = double.MaxValue; 60 72 } 61 returnerrorsSquaredSum;73 mse.Data = errorsSquaredSum; 62 74 } 63 75 }
Note: See TracChangeset
for help on using the changeset viewer.