Changeset 6878 for branches/GeneralizedQAP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective
- Timestamp:
- 10/05/11 21:55:55 (13 years ago)
- Location:
- branches/GeneralizedQAP
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GeneralizedQAP
- Property svn:ignore
-
old new 1 *.docstates 2 *.psess 1 3 *.resharper 2 4 *.suo 5 *.vsp 3 6 Google.ProtocolBuffers-0.9.1.dll 7 HeuristicLab 3.3.5.1.ReSharper.user 8 HeuristicLab 3.3.6.0.ReSharper.user 4 9 HeuristicLab.4.5.resharper.user 5 10 HeuristicLab.resharper.user … … 8 13 _ReSharper.HeuristicLab 9 14 _ReSharper.HeuristicLab 3.3 15 _ReSharper.HeuristicLab.ExtLibs 16 bin 10 17 protoc.exe 11 HeuristicLab 3.3.5.1.ReSharper.user 12 *.psess 13 *.vsp 14 *.docstates 18 HeuristicLab.ExtLibs.6.0.ReSharper.user
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/GeneralizedQAP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
- Property svn:ignore
-
old new 4 4 obj 5 5 *.vs10x 6 Plugin.cs
-
- Property svn:ignore
-
branches/GeneralizedQAP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveMeanSquaredErrorEvaluator.cs
r5942 r6878 56 56 public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IRegressionProblemData problemData, IEnumerable<int> rows) { 57 57 IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows); 58 IEnumerable<double> originalValues = problemData.Dataset.Get EnumeratedVariableValues(problemData.TargetVariable, rows);58 IEnumerable<double> originalValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows); 59 59 IEnumerable<double> boundedEstimationValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit); 60 60 OnlineCalculatorError errorState; -
branches/GeneralizedQAP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveOverfittingAnalyzer.cs
r5907 r6878 79 79 80 80 double[] trainingQuality = QualityParameter.ActualValue.Select(x => x.Value).ToArray(); 81 var problemData = ProblemDataParameter.ActualValue; 82 var evaluator = EvaluatorParameter.ActualValue; 81 83 // evaluate on validation partition 82 IExecutionContext childContext = (IExecutionContext)ExecutionContext.CreateChildOperation(EvaluatorParameter.ActualValue); 83 double[] validationQuality = (from tree in SymbolicExpressionTree 84 select EvaluatorParameter.ActualValue.Evaluate(childContext, tree, ProblemDataParameter.ActualValue, rows)) 85 .ToArray(); 84 IExecutionContext childContext = (IExecutionContext)ExecutionContext.CreateChildOperation(evaluator); 85 double[] validationQuality = SymbolicExpressionTree 86 .AsParallel() 87 .Select(t => evaluator.Evaluate(childContext, t, problemData, rows)) 88 .ToArray(); 86 89 double r = 0.0; 87 90 try { -
branches/GeneralizedQAP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator.cs
r5942 r6878 56 56 public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IRegressionProblemData problemData, IEnumerable<int> rows) { 57 57 IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows); 58 IEnumerable<double> originalValues = problemData.Dataset.Get EnumeratedVariableValues(problemData.TargetVariable, rows);58 IEnumerable<double> originalValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows); 59 59 OnlineCalculatorError errorState; 60 60 double r2 = OnlinePearsonsRSquaredCalculator.Calculate(estimatedValues, originalValues, out errorState); -
branches/GeneralizedQAP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs
r5854 r6878 62 62 MaximumSymbolicExpressionTreeLength.Value = InitialMaximumTreeLength; 63 63 64 SymbolicExpressionTreeGrammarParameter.ValueChanged += (o, e) => ConfigureGrammarSymbols(); 65 66 ConfigureGrammarSymbols(); 64 67 InitializeOperators(); 65 68 UpdateEstimationLimits(); 69 } 70 71 private void ConfigureGrammarSymbols() { 72 var grammar = SymbolicExpressionTreeGrammar as TypeCoherentExpressionGrammar; 73 if (grammar != null) grammar.ConfigureAsDefaultRegressionGrammar(); 66 74 } 67 75 … … 74 82 75 83 private void UpdateEstimationLimits() { 76 if (ProblemData.Training Partition.Start < ProblemData.TrainingPartition.End) {77 var targetValues = ProblemData.Dataset.Get VariableValues(ProblemData.TargetVariable, ProblemData.TrainingPartition.Start, ProblemData.TrainingPartition.End);84 if (ProblemData.TrainingIndizes.Any()) { 85 var targetValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).ToList(); 78 86 var mean = targetValues.Average(); 79 87 var range = targetValues.Max() - targetValues.Min(); 80 88 EstimationLimits.Upper = mean + PunishmentFactor * range; 81 89 EstimationLimits.Lower = mean - PunishmentFactor * range; 90 } else { 91 EstimationLimits.Upper = double.MaxValue; 92 EstimationLimits.Lower = double.MinValue; 82 93 } 83 94 }
Note: See TracChangeset
for help on using the changeset viewer.