Changeset 396 for trunk/sources/HeuristicLab.StructureIdentification
- Timestamp:
- 07/28/08 18:46:02 (17 years ago)
- Location:
- trunk/sources/HeuristicLab.StructureIdentification/Evaluation
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/sources/HeuristicLab.StructureIdentification/Evaluation/CoefficientOfDeterminationEvaluator.cs ¶
r367 r396 49 49 double originalDeviationTotalSumOfSquares = 0.0; 50 50 double targetMean = dataset.GetMean(targetVariable, trainingStart, trainingEnd); 51 functionTree.PrepareEvaluation(dataset);52 51 for(int sample = trainingStart; sample < trainingEnd; sample++) { 53 double estimated = functionTree.Evaluate(sample);52 double estimated = evaluator.Evaluate(sample); 54 53 double original = dataset.GetValue(sample, targetVariable); 55 54 if(!double.IsNaN(original) && !double.IsInfinity(original)) { -
TabularUnified trunk/sources/HeuristicLab.StructureIdentification/Evaluation/EarlyStoppingMeanSquaredErrorEvaluator.cs ¶
r367 r396 60 60 double errorsSquaredSum = 0; 61 61 double targetMean = dataset.GetMean(targetVariable, trainingStart, trainingEnd); 62 functionTree.PrepareEvaluation(dataset);63 62 for(int sample = trainingStart; sample < trainingEnd; sample++) { 64 double estimated = functionTree.Evaluate(sample);63 double estimated = evaluator.Evaluate(sample); 65 64 double original = dataset.GetValue(sample, targetVariable); 66 65 if(double.IsNaN(estimated) || double.IsInfinity(estimated)) { -
TabularUnified trunk/sources/HeuristicLab.StructureIdentification/Evaluation/GPEvaluatorBase.cs ¶
r363 r396 35 35 protected int treeSize; 36 36 protected double totalEvaluatedNodes; 37 protected IEvaluator evaluator; 37 38 38 39 public GPEvaluatorBase() … … 56 57 this.treeSize = scope.GetVariableValue<IntData>("TreeSize", false).Data; 57 58 this.totalEvaluatedNodes = scope.GetVariableValue<DoubleData>("TotalEvaluatedNodes", true).Data; 59 if(evaluator == null) evaluator = functionTree.CreateEvaluator(dataset); 60 evaluator.ResetEvaluator(functionTree); 58 61 double result = Evaluate(scope, functionTree, targetVariable, dataset); 59 62 -
TabularUnified trunk/sources/HeuristicLab.StructureIdentification/Evaluation/MCCEvaluator.cs ¶
r367 r396 58 58 double negative = 0; 59 59 double targetMean = dataset.GetMean(targetVariable, trainingStart, trainingEnd); 60 functionTree.PrepareEvaluation(dataset);61 60 for(int sample = trainingStart; sample < trainingEnd; sample++) { 62 double est = functionTree.Evaluate(sample);61 double est = evaluator.Evaluate(sample); 63 62 double orig = dataset.GetValue(sample, targetVariable); 64 63 if(double.IsNaN(est) || double.IsInfinity(est)) { -
TabularUnified trunk/sources/HeuristicLab.StructureIdentification/Evaluation/MeanAbsolutePercentageErrorEvaluator.cs ¶
r395 r396 47 47 int trainingEnd = GetVariableValue<IntData>("TrainingSamplesEnd", scope, true).Data; 48 48 double errorsSum = 0.0; 49 functionTree.PrepareEvaluation(dataset);50 49 for(int sample = trainingStart; sample < trainingEnd; sample++) { 51 double estimated = functionTree.Evaluate(sample);50 double estimated = evaluator.Evaluate(sample); 52 51 double original = dataset.GetValue(sample, targetVariable); 53 52 if(!double.IsNaN(original) && !double.IsInfinity(original)) { -
TabularUnified trunk/sources/HeuristicLab.StructureIdentification/Evaluation/MeanSquaredErrorEvaluator.cs ¶
r367 r396 59 59 } 60 60 } 61 62 functionTree.PrepareEvaluation(dataset);63 61 for(int sample = trainingStart; sample < trainingEnd; sample++) { 64 double estimated = functionTree.Evaluate(sample);62 double estimated = evaluator.Evaluate(sample); 65 63 double original = dataset.GetValue(sample, targetVariable); 66 64 if(double.IsNaN(estimated) || double.IsInfinity(estimated)) { -
TabularUnified trunk/sources/HeuristicLab.StructureIdentification/Evaluation/SimpleEvaluator.cs ¶
r363 r396 34 34 protected int treeSize; 35 35 protected double totalEvaluatedNodes; 36 private IEvaluator evaluator; 36 37 37 38 public SimpleEvaluator() … … 66 67 } 67 68 values.Clear(); 68 functionTree.PrepareEvaluation(dataset); 69 if(evaluator == null) evaluator = functionTree.CreateEvaluator(dataset); 70 evaluator.ResetEvaluator(functionTree); 69 71 for(int sample = trainingStart; sample < trainingEnd; sample++) { 70 72 ItemList row = new ItemList(); 71 row.Add(new DoubleData( functionTree.Evaluate(sample)));73 row.Add(new DoubleData(evaluator.Evaluate(sample))); 72 74 row.Add(new DoubleData(dataset.GetValue(sample, targetVariable))); 73 75 values.Add(row); -
TabularUnified trunk/sources/HeuristicLab.StructureIdentification/Evaluation/TheilInequalityCoefficientEvaluator.cs ¶
r395 r396 51 51 double estimatedSquaredSum = 0.0; 52 52 double originalSquaredSum = 0.0; 53 functionTree.PrepareEvaluation(dataset);54 53 for(int sample = trainingStart; sample < trainingEnd; sample++) { 55 54 double prevValue = 0.0; 56 55 if(difference) prevValue = dataset.GetValue(sample - 1, targetVariable); 57 double estimatedChange = functionTree.Evaluate(sample) - prevValue;56 double estimatedChange = evaluator.Evaluate(sample) - prevValue; 58 57 double originalChange = dataset.GetValue(sample, targetVariable) - prevValue; 59 58 if(!double.IsNaN(originalChange) && !double.IsInfinity(originalChange)) { -
TabularUnified trunk/sources/HeuristicLab.StructureIdentification/Evaluation/VarianceAccountedForEvaluator.cs ¶
r367 r396 59 59 double[] originalTargetVariableValues = new double[trainingEnd-trainingStart]; 60 60 double targetMean = dataset.GetMean(targetVariable, trainingStart, trainingEnd); 61 functionTree.PrepareEvaluation(dataset);62 61 for(int sample = trainingStart; sample < trainingEnd; sample++) { 63 double estimated = functionTree.Evaluate(sample);62 double estimated = evaluator.Evaluate(sample); 64 63 double original = dataset.GetValue(sample, targetVariable); 65 64 if(!double.IsNaN(original) && !double.IsInfinity(original)) {
Note: See TracChangeset
for help on using the changeset viewer.