Changeset 6784 for branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression
- Timestamp:
- 09/16/11 12:00:36 (13 years ago)
- Location:
- branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveMeanSquaredErrorTreeSizeEvaluator.cs
r5942 r6784 54 54 public static double[] Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IRegressionProblemData problemData, IEnumerable<int> rows) { 55 55 IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows); 56 IEnumerable<double> originalValues = problemData.Dataset.Get EnumeratedVariableValues(problemData.TargetVariable, rows);56 IEnumerable<double> originalValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows); 57 57 IEnumerable<double> boundedEstimationValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit); 58 58 OnlineCalculatorError errorState; -
branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectivePearsonRSquaredTreeSizeEvaluator.cs
r5942 r6784 54 54 public static double[] Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IRegressionProblemData problemData, IEnumerable<int> rows) { 55 55 IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows); 56 IEnumerable<double> originalValues = problemData.Dataset.Get EnumeratedVariableValues(problemData.TargetVariable, rows);56 IEnumerable<double> originalValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows); 57 57 OnlineCalculatorError errorState; 58 58 double r2 = OnlinePearsonsRSquaredCalculator.Calculate(estimatedValues, originalValues, out errorState); -
branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveProblem.cs
r6782 r6784 80 80 81 81 private void UpdateEstimationLimits() { 82 if (ProblemData.Training Partition.Start < ProblemData.TrainingPartition.End) {83 var targetValues = ProblemData.Dataset.Get VariableValues(ProblemData.TargetVariable, ProblemData.TrainingPartition.Start, ProblemData.TrainingPartition.End);82 if (ProblemData.TrainingIndizes.Any()) { 83 var targetValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).ToList(); 84 84 var mean = targetValues.Average(); 85 85 var range = targetValues.Max() - targetValues.Min(); 86 86 EstimationLimits.Upper = mean + PunishmentFactor * range; 87 87 EstimationLimits.Lower = mean - PunishmentFactor * range; 88 } else { 89 EstimationLimits.Upper = double.MaxValue; 90 EstimationLimits.Lower = double.MinValue; 88 91 } 89 92 } -
branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveMeanSquaredErrorEvaluator.cs
r5942 r6784 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/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveOverfittingAnalyzer.cs
r5907 r6784 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/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator.cs
r5942 r6784 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/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs
r6782 r6784 77 77 78 78 private void UpdateEstimationLimits() { 79 if (ProblemData.Training Partition.Start < ProblemData.TrainingPartition.End) {80 var targetValues = ProblemData.Dataset.Get VariableValues(ProblemData.TargetVariable, ProblemData.TrainingPartition.Start, ProblemData.TrainingPartition.End);79 if (ProblemData.TrainingIndizes.Any()) { 80 var targetValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).ToList(); 81 81 var mean = targetValues.Average(); 82 82 var range = targetValues.Max() - targetValues.Min(); 83 83 EstimationLimits.Upper = mean + PunishmentFactor * range; 84 84 EstimationLimits.Lower = mean - PunishmentFactor * range; 85 } else { 86 EstimationLimits.Upper = double.MaxValue; 87 EstimationLimits.Lower = double.MinValue; 85 88 } 86 89 } -
branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionModel.cs
r6618 r6784 73 73 var rows = problemData.TrainingIndizes; 74 74 var estimatedValues = model.Interpreter.GetSymbolicExpressionTreeValues(model.SymbolicExpressionTree, dataset, rows); 75 var targetValues = dataset.Get EnumeratedVariableValues(targetVariable, rows);75 var targetValues = dataset.GetDoubleValues(targetVariable, rows); 76 76 double alpha; 77 77 double beta;
Note: See TracChangeset
for help on using the changeset viewer.