Changeset 4225
- Timestamp:
- 08/16/10 10:03:11 (14 years ago)
- Location:
- branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs
r4202 r4225 152 152 get { return (ILookupParameter<DoubleValue>)Parameters[BestKnownQualityParameterName]; } 153 153 } 154 public ILookupParameter<DoubleValue> CurrentBestValidationQualityParameter { 155 get { return (ILookupParameter<DoubleValue>)Parameters[CurrentBestValidationQualityParameterName]; } 156 } 157 154 158 public ILookupParameter<DataTable> VariableFrequenciesParameter { 155 159 get { return (ILookupParameter<DataTable>)Parameters[VariableFrequenciesParameterName]; } … … 225 229 Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName, "The result collection where the best symbolic regression solution should be stored.")); 226 230 Parameters.Add(new LookupParameter<DoubleValue>(BestKnownQualityParameterName, "The best known (validation) quality achieved on the data set.")); 231 Parameters.Add(new LookupParameter<DoubleValue>(CurrentBestValidationQualityParameterName, "The quality of the best solution (on the validation set) of the current generation.")); 227 232 Parameters.Add(new LookupParameter<DataTable>(VariableFrequenciesParameterName, "The variable frequencies table to use for the calculation of variable impacts")); 228 233 } … … 287 292 IEnumerable<int> trainingRows = Enumerable.Range(trainingStart, trainingEnd - trainingStart); 288 293 IEnumerable<double> originalValues = ProblemData.Dataset.GetEnumeratedVariableValues(targetVariable, trainingRows); 289 IEnumerable<double> estimatedValues = 290 GetBoundedValues(SymbolicExpressionTreeInterpreter.GetSymbolicExpressionTreeValues(bestTree, ProblemData.Dataset, trainingRows), 291 lowerEstimationLimit, upperEstimationLimit); 292 294 IEnumerable<double> estimatedValues = SymbolicExpressionTreeInterpreter.GetSymbolicExpressionTreeValues(bestTree, ProblemData.Dataset, trainingRows); 293 295 294 296 SymbolicRegressionScaledMeanSquaredErrorEvaluator.CalculateScalingParameters(originalValues, estimatedValues, out beta, out alpha); … … 308 310 } 309 311 312 CurrentBestValidationQualityParameter.ActualValue = new DoubleValue(bestQuality); 310 313 311 314 if (!Results.ContainsKey(BestSolutionQualityValuesParameterName)) { … … 321 324 AddValue(validationValues, bestQuality, CurrentBestValidationQualityParameterName, CurrentBestValidationQualityParameterName); 322 325 return base.Apply(); 323 }324 325 private IEnumerable<double> GetBoundedValues(IEnumerable<double> values, double lowerEstimationLimit, double upperEstimationLimit) {326 foreach (double v in values) {327 if (double.IsNaN(v)) yield return upperEstimationLimit;328 else yield return Math.Min(upperEstimationLimit, Math.Max(lowerEstimationLimit, v));329 }330 326 } 331 327 -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SymbolicRegressionPearsonsRSquaredEvaluator.cs
r4202 r4225 39 39 40 40 public override double Evaluate(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, Dataset dataset, string targetVariable, IEnumerable<int> rows) { 41 double mse= Calculate(interpreter, solution, lowerEstimationLimit, upperEstimationLimit, dataset, targetVariable, rows);42 return mse;41 double r2 = Calculate(interpreter, solution, lowerEstimationLimit, upperEstimationLimit, dataset, targetVariable, rows); 42 return r2; 43 43 } 44 44 -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblemBase.cs
r4195 r4225 154 154 : base() { 155 155 SymbolicExpressionTreeCreator creator = new ProbabilisticTreeCreator(); 156 var grammar = new BasicExpressionGrammar();156 var grammar = new FullFunctionalExpressionGrammar(); 157 157 var globalGrammar = new GlobalSymbolicExpressionGrammar(grammar); 158 158 var interpreter = new SimpleArithmeticExpressionInterpreter();
Note: See TracChangeset
for help on using the changeset viewer.