Changeset 200 for trunk/sources
- Timestamp:
- 04/28/08 09:16:33 (17 years ago)
- Location:
- trunk/sources/HeuristicLab.StructureIdentification/Evaluation
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.StructureIdentification/Evaluation/EarlyStoppingMeanSquaredErrorEvaluator.cs
r155 r200 63 63 64 64 // check the limit and stop as soon as we hit the limit 65 if(errorsSquaredSum / dataset.Rows >= qualityLimit) 66 return errorsSquaredSum / (sample+1); // return estimated MSE (when the remaining errors are on average the same) 65 if(errorsSquaredSum / dataset.Rows >= qualityLimit) { 66 scope.GetVariableValue<DoubleData>("TotalEvaluatedNodes", true).Data = totalEvaluatedNodes + treeSize * sample+1; 67 return errorsSquaredSum / (sample + 1); // return estimated MSE (when the remaining errors are on average the same) 68 } 67 69 } 68 70 errorsSquaredSum /= dataset.Rows; … … 70 72 errorsSquaredSum = double.MaxValue; 71 73 } 74 scope.GetVariableValue<DoubleData>("TotalEvaluatedNodes", true).Data = totalEvaluatedNodes + treeSize * dataset.Rows; 72 75 return errorsSquaredSum; 73 76 } -
trunk/sources/HeuristicLab.StructureIdentification/Evaluation/GPEvaluatorBase.cs
r155 r200 33 33 public abstract class GPEvaluatorBase : OperatorBase { 34 34 protected double maximumPunishment; 35 protected int treeSize; 36 protected double totalEvaluatedNodes; 35 37 36 38 public GPEvaluatorBase() 37 39 : base() { 38 40 AddVariableInfo(new VariableInfo("FunctionTree", "The function tree that should be evaluated", typeof(IFunctionTree), VariableKind.In)); 41 AddVariableInfo(new VariableInfo("TreeSize", "Size (number of nodes) of the tree to evaluate", typeof(IntData), VariableKind.In)); 39 42 AddVariableInfo(new VariableInfo("Dataset", "Dataset with all samples on which to apply the function", typeof(Dataset), VariableKind.In)); 40 43 AddVariableInfo(new VariableInfo("TargetVariable", "Index of the column of the dataset that holds the target variable", typeof(IntData), VariableKind.In)); 41 44 AddVariableInfo(new VariableInfo("PunishmentFactor", "Punishment factor for invalid estimations", typeof(DoubleData), VariableKind.In)); 45 AddVariableInfo(new VariableInfo("TotalEvaluatedNodes", "Number of evaluated nodes", typeof(DoubleData), VariableKind.In | VariableKind.Out)); 42 46 AddVariableInfo(new VariableInfo("Quality", "The evaluated quality of the model", typeof(DoubleData), VariableKind.New)); 43 47 } … … 48 52 IFunctionTree functionTree = GetVariableValue<IFunctionTree>("FunctionTree", scope, true); 49 53 this.maximumPunishment = GetVariableValue<DoubleData>("PunishmentFactor", scope, true).Data * dataset.GetRange(targetVariable); 54 this.treeSize = scope.GetVariableValue<IntData>("TreeSize", false).Data; 55 this.totalEvaluatedNodes = scope.GetVariableValue<DoubleData>("TotalEvaluatedNodes", true).Data; 50 56 51 57 double result = Evaluate(scope, functionTree, targetVariable, dataset); -
trunk/sources/HeuristicLab.StructureIdentification/Evaluation/MeanSquaredErrorEvaluator.cs
r155 r200 64 64 errorsSquaredSum = double.MaxValue; 65 65 } 66 scope.GetVariableValue<DoubleData>("TotalEvaluatedNodes", true).Data = totalEvaluatedNodes + treeSize * dataset.Rows; 66 67 return errorsSquaredSum; 67 68 }
Note: See TracChangeset
for help on using the changeset viewer.