- Timestamp:
- 04/22/10 18:41:07 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/ISymbolicRegressionEvaluator.cs
r3452 r3491 40 40 IValueLookupParameter<IntValue> SamplesStartParameter { get; } 41 41 IValueLookupParameter<IntValue> SamplesEndParameter { get; } 42 ILookupParameter<DoubleValue> NumberOfEvaluatedNodesParameter { get; }43 42 } 44 43 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionEvaluator.cs
r3462 r3491 46 46 private const string SamplesStartParameterName = "SamplesStart"; 47 47 private const string SamplesEndParameterName = "SamplesEnd"; 48 private const string NumberOfEvaluatedNodexParameterName = "NumberOfEvaluatedNodes";49 48 #region ISymbolicRegressionEvaluator Members 50 49 … … 73 72 } 74 73 75 public ILookupParameter<DoubleValue> NumberOfEvaluatedNodesParameter {76 get { return (ILookupParameter<DoubleValue>)Parameters[NumberOfEvaluatedNodexParameterName]; }77 }78 74 #endregion 79 75 #region properties … … 103 99 Parameters.Add(new ValueLookupParameter<IntValue>(SamplesStartParameterName, "The start index of the dataset partition on which the symbolic regression solution should be evaluated.")); 104 100 Parameters.Add(new ValueLookupParameter<IntValue>(SamplesEndParameterName, "The end index of the dataset partition on which the symbolic regression solution should be evaluated.")); 105 Parameters.Add(new LookupParameter<DoubleValue>(NumberOfEvaluatedNodexParameterName, "The number of evaluated nodes so far (for performance measurements.)"));106 101 } 107 102 108 103 public override IOperation Apply() { 109 DoubleValue numberOfEvaluatedNodes = NumberOfEvaluatedNodesParameter.ActualValue;110 104 QualityParameter.ActualValue = new DoubleValue(Evaluate(SymbolicExpressionTreeInterpreter, SymbolicExpressionTree, RegressionProblemData.Dataset, 111 RegressionProblemData.TargetVariable, SamplesStart, SamplesEnd , numberOfEvaluatedNodes));105 RegressionProblemData.TargetVariable, SamplesStart, SamplesEnd)); 112 106 return null; 113 107 } … … 117 111 Dataset dataset, 118 112 StringValue targetVariable, 119 IntValue samplesStart, IntValue samplesEnd, 120 DoubleValue numberOfEvaluatedNodes); 113 IntValue samplesStart, IntValue samplesEnd); 121 114 } 122 115 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionMeanSquaredErrorEvaluator.cs
r3462 r3491 41 41 [StorableClass] 42 42 public class SymbolicRegressionMeanSquaredErrorEvaluator : SymbolicRegressionEvaluator { 43 protected override double Evaluate(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree solution, Dataset dataset, StringValue targetVariable, IntValue samplesStart, IntValue samplesEnd , DoubleValue numberOfEvaluatedNodes) {43 protected override double Evaluate(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree solution, Dataset dataset, StringValue targetVariable, IntValue samplesStart, IntValue samplesEnd) { 44 44 double mse = Calculate(interpreter, solution, dataset, targetVariable.Value, samplesStart.Value, samplesEnd.Value); 45 numberOfEvaluatedNodes.Value += solution.Size * (samplesEnd.Value - samplesStart.Value);46 45 return mse; 47 46 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblem.cs
r3480 r3491 73 73 get { return (ValueParameter<IntValue>)Parameters["MaxExpressionDepth"]; } 74 74 } 75 public ValueParameter<DoubleValue> NumberOfEvaluatedNodesParameter {76 get { return (ValueParameter<DoubleValue>)Parameters["NumberOfEvaluatedNodes"]; }77 }78 75 public ValueParameter<IntValue> MaxFunctionDefiningBranchesParameter { 79 76 get { return (ValueParameter<IntValue>)Parameters["MaxFunctionDefiningBranches"]; } … … 159 156 Parameters.Add(new ValueParameter<IntValue>("MaxFunctionDefiningBranches", "Maximal number of automatically defined functions.", new IntValue(3))); 160 157 Parameters.Add(new ValueParameter<IntValue>("MaxFunctionArguments", "Maximal number of arguments of automatically defined functions.", new IntValue(3))); 161 Parameters.Add(new ValueParameter<DoubleValue>("NumberOfEvaluatedNodes", "The total number of evaluated function tree nodes (for performance measurements.)", new DoubleValue()));162 158 Parameters.Add(new ValueParameter<ISingleObjectiveSolutionsVisualizer>("Visualizer", "The operator which should be used to visualize symbolic regression solutions.", visualizer)); 163 159 … … 323 319 op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 324 320 op.RegressionProblemDataParameter.ActualName = DataAnalysisProblemDataParameter.Name; 325 op.NumberOfEvaluatedNodesParameter.ActualName = NumberOfEvaluatedNodesParameter.Name;326 321 } 327 322 foreach (SymbolicExpressionTreeCrossover op in Operators.OfType<SymbolicExpressionTreeCrossover>()) {
Note: See TracChangeset
for help on using the changeset viewer.