Changeset 6784 for branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification
- Timestamp:
- 09/16/11 12:00:36 (13 years ago)
- Location:
- branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveMeanSquaredErrorTreeSizeEvaluator.cs
r5942 r6784 54 54 public static double[] Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IClassificationProblemData 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.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectivePearsonRSquaredTreeSizeEvaluator.cs
r5942 r6784 33 33 public static double[] Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IClassificationProblemData problemData, IEnumerable<int> rows) { 34 34 IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows); 35 IEnumerable<double> originalValues = problemData.Dataset.Get EnumeratedVariableValues(problemData.TargetVariable, rows);35 IEnumerable<double> originalValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows); 36 36 OnlineCalculatorError errorState; 37 37 double r2 = OnlinePearsonsRSquaredCalculator.Calculate(estimatedValues, originalValues, out errorState); -
branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveProblem.cs
r6782 r6784 76 76 77 77 private void UpdateEstimationLimits() { 78 if (ProblemData.Training Partition.Start < ProblemData.TrainingPartition.End) {79 var targetValues = ProblemData.Dataset.Get VariableValues(ProblemData.TargetVariable, ProblemData.TrainingPartition.Start, ProblemData.TrainingPartition.End);78 if (ProblemData.TrainingIndizes.Any()) { 79 var targetValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).ToList(); 80 80 var mean = targetValues.Average(); 81 81 var range = targetValues.Max() - targetValues.Min(); 82 82 EstimationLimits.Upper = mean + PunishmentFactor * range; 83 83 EstimationLimits.Lower = mean - PunishmentFactor * range; 84 } else { 85 EstimationLimits.Upper = double.MaxValue; 86 EstimationLimits.Lower = double.MinValue; 84 87 } 85 88 } -
branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveBoundedMeanSquaredErrorEvaluator.cs
r5906 r6784 54 54 public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IClassificationProblemData 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 -
branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveMeanSquaredErrorEvaluator.cs
r5942 r6784 54 54 public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IClassificationProblemData 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.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveOverfittingAnalyzer.cs
r5907 r6784 76 76 public override IOperation Apply() { 77 77 double[] trainingQuality = QualityParameter.ActualValue.Select(x => x.Value).ToArray(); 78 var problemData = ProblemDataParameter.ActualValue; 79 var evaluator = EvaluatorParameter.ActualValue; 78 80 // evaluate on validation partition 79 81 IEnumerable<int> rows = GenerateRowsToEvaluate(); 80 82 if (!rows.Any()) return base.Apply(); 81 82 IExecutionContext childContext = (IExecutionContext)ExecutionContext.CreateChildOperation(EvaluatorParameter.ActualValue);83 double[] validationQuality = (from tree in SymbolicExpressionTree84 select EvaluatorParameter.ActualValue.Evaluate(childContext, tree, ProblemDataParameter.ActualValue, rows))85 83 IExecutionContext childContext = (IExecutionContext)ExecutionContext.CreateChildOperation(evaluator); 84 double[] validationQuality = SymbolicExpressionTree 85 .AsParallel() 86 .Select(t => evaluator.Evaluate(childContext, t, problemData, rows)) 87 .ToArray(); 86 88 double r = 0.0; 87 89 try { -
branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectivePearsonRSquaredEvaluator.cs
r5942 r6784 54 54 public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IClassificationProblemData 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.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveProblem.cs
r6782 r6784 75 75 76 76 private void UpdateEstimationLimits() { 77 if (ProblemData.Training Partition.Start < ProblemData.TrainingPartition.End) {78 var targetValues = ProblemData.Dataset.Get VariableValues(ProblemData.TargetVariable, ProblemData.TrainingPartition.Start, ProblemData.TrainingPartition.End);77 if (ProblemData.TrainingIndizes.Any()) { 78 var targetValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).ToList(); 79 79 var mean = targetValues.Average(); 80 80 var range = targetValues.Max() - targetValues.Min(); 81 81 EstimationLimits.Upper = mean + PunishmentFactor * range; 82 82 EstimationLimits.Lower = mean - PunishmentFactor * range; 83 } else { 84 EstimationLimits.Upper = double.MaxValue; 85 EstimationLimits.Lower = double.MinValue; 83 86 } 84 87 } -
branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationModel.cs
r6618 r6784 127 127 var rows = problemData.TrainingIndizes; 128 128 var estimatedValues = model.Interpreter.GetSymbolicExpressionTreeValues(model.SymbolicExpressionTree, dataset, rows); 129 var targetValues = dataset.Get EnumeratedVariableValues(targetVariable, rows);129 var targetValues = dataset.GetDoubleValues(targetVariable, rows); 130 130 double alpha; 131 131 double beta;
Note: See TracChangeset
for help on using the changeset viewer.