Changeset 18006 for branches/3087_Ceres_Integration/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression
- Timestamp:
- 07/13/21 10:55:09 (3 years ago)
- Location:
- branches/3087_Ceres_Integration
- Files:
-
- 9 edited
- 6 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3087_Ceres_Integration
- Property svn:mergeinfo changed
-
branches/3087_Ceres_Integration/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression
- Property svn:mergeinfo changed
-
branches/3087_Ceres_Integration/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
- Property svn:mergeinfo changed
-
branches/3087_Ceres_Integration/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj
r16658 r18006 99 99 </PropertyGroup> 100 100 <ItemGroup> 101 <Reference Include="ALGLIB-3. 7.0, Version=3.7.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">101 <Reference Include="ALGLIB-3.17.0, Version=3.17.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 102 102 <SpecificVersion>False</SpecificVersion> 103 <HintPath>..\..\bin\ALGLIB-3. 7.0.dll</HintPath>103 <HintPath>..\..\bin\ALGLIB-3.17.0.dll</HintPath> 104 104 <Private>False</Private> 105 105 </Reference> … … 119 119 </ItemGroup> 120 120 <ItemGroup> 121 <Compile Include="Interfaces\IMultiObjectiveConstraintsEvaluator.cs" /> 122 <Compile Include="MultiObjective\NMSEMultiObjectiveConstraintsEvaluator.cs" /> 121 123 <Compile Include="MultiObjective\PearsonRSquaredNestedTreeSizeEvaluator.cs" /> 122 124 <Compile Include="MultiObjective\PearsonRSquaredNumberOfVariablesEvaluator.cs" /> 123 125 <Compile Include="MultiObjective\PearsonRSquaredAverageSimilarityEvaluator.cs" /> 124 126 <Compile Include="MultiObjective\PearsonRSquaredTreeComplexityEvaluator.cs" /> 127 <Compile Include="MultiObjective\ShapeConstrainedRegressionMultiObjectiveProblem.cs" /> 125 128 <Compile Include="MultiObjective\SymbolicRegressionMultiObjectiveValidationBestSolutionAnalyzer.cs" /> 126 129 <Compile Include="Plugin.cs" /> 130 <Compile Include="ShapeConstraintsAnalyzer.cs" /> 127 131 <Compile Include="SingleObjective\ConstantOptimizationAnalyzer.cs" /> 132 <Compile Include="SingleObjective\Evaluators\NMSESingleObjectiveConstraintsEvaluator.cs" /> 128 133 <Compile Include="SingleObjective\Evaluators\SymbolicRegressionMeanRelativeErrorEvaluator.cs" /> 134 <Compile Include="SingleObjective\ShapeConstrainedRegressionSingleObjectiveProblem.cs" /> 129 135 <Compile Include="SingleObjective\SymbolicRegressionSolutionsAnalyzer.cs" /> 130 136 <Compile Include="SymbolicRegressionPhenotypicDiversityAnalyzer.cs" /> -
branches/3087_Ceres_Integration/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveProblem.cs
r17180 r18006 60 60 public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicRegressionMultiObjectiveProblem(this, cloner); } 61 61 62 public SymbolicRegressionMultiObjectiveProblem() 63 : base(new RegressionProblemData(), new SymbolicRegressionMultiObjectivePearsonRSquaredTreeSizeEvaluator(), new SymbolicDataAnalysisExpressionTreeCreator()) { 62 public SymbolicRegressionMultiObjectiveProblem() : this(new RegressionProblemData(), new SymbolicRegressionMultiObjectivePearsonRSquaredTreeSizeEvaluator(), new SymbolicDataAnalysisExpressionTreeCreator()) { } 63 public SymbolicRegressionMultiObjectiveProblem(IRegressionProblemData problemData, ISymbolicRegressionMultiObjectiveEvaluator evaluator, ISymbolicDataAnalysisSolutionCreator solutionCreator) 64 : base(problemData, evaluator, solutionCreator) { 64 65 Parameters.Add(new FixedValueParameter<DoubleLimit>(EstimationLimitsParameterName, EstimationLimitsParameterDescription)); 65 66 -
branches/3087_Ceres_Integration/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/Plugin.cs.frame
r17184 r18006 28 28 [Plugin("HeuristicLab.Problems.DataAnalysis.Symbolic.Regression","Provides classes to perform symbolic regression (single- or multiobjective).", "3.4.12.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.dll", PluginFileType.Assembly)] 30 [PluginDependency("HeuristicLab.ALGLIB", "3. 7.0")]30 [PluginDependency("HeuristicLab.ALGLIB", "3.17.0")] 31 31 [PluginDependency("HeuristicLab.Analysis", "3.3")] 32 32 [PluginDependency("HeuristicLab.Common", "3.3")] -
branches/3087_Ceres_Integration/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionConstantOptimizationEvaluator.cs
r17180 r18006 209 209 bool updateConstantsInTree = true, Action<double[], double, object> iterationCallback = null, EvaluationsCounter counter = null) { 210 210 211 // numeric constants in the tree become variables for constant opt212 // variables in the tree become parameters (fixed values) for constant opt213 // for each parameter (variable in the original tree) we store the211 // Numeric constants in the tree become variables for parameter optimization. 212 // Variables in the tree become parameters (fixed values) for parameter optimization. 213 // For each parameter (variable in the original tree) we store the 214 214 // variable name, variable value (for factor vars) and lag as a DataForVariable object. 215 215 // A dictionary is used to find parameters … … 221 221 if (!TreeToAutoDiffTermConverter.TryConvertToAutoDiff(tree, updateVariableWeights, applyLinearScaling, out parameters, out initialConstants, out func, out func_grad)) 222 222 throw new NotSupportedException("Could not optimize constants of symbolic expression tree due to not supported symbols used in the tree."); 223 if (parameters.Count == 0) return 0.0; // gkronber:constant expressions always have a R² of 0.0223 if (parameters.Count == 0) return 0.0; // constant expressions always have a R² of 0.0 224 224 var parameterEntries = parameters.ToArray(); // order of entries must be the same for x 225 225 226 // extract inital constants226 // extract inital constants 227 227 double[] c; 228 228 if (applyLinearScaling) { … … 270 270 try { 271 271 alglib.lsfitcreatefg(x, y, c, n, m, k, false, out state); 272 alglib.lsfitsetcond(state, 0.0, 0.0,maxIterations);272 alglib.lsfitsetcond(state, 0.0, maxIterations); 273 273 alglib.lsfitsetxrep(state, iterationCallback != null); 274 //alglib.lsfitsetgradientcheck(state, 0.001);275 274 alglib.lsfitfit(state, function_cx_1_func, function_cx_1_grad, xrep, rowEvaluationsCounter); 276 275 alglib.lsfitresults(state, out retVal, out c, out rep); … … 285 284 286 285 //retVal == -7 => constant optimization failed due to wrong gradient 287 if (retVal != -7) { 286 // -8 => optimizer detected NAN / INF in the target 287 // function and/ or gradient 288 if (retVal != -7 && retVal != -8) { 288 289 if (applyLinearScaling) { 289 290 var tmp = new double[c.Length - 2]; … … 309 310 VariableTreeNodeBase variableTreeNodeBase = node as VariableTreeNodeBase; 310 311 FactorVariableTreeNode factorVarTreeNode = node as FactorVariableTreeNode; 311 if (constantTreeNode != null) 312 if (constantTreeNode != null) { 313 if (constantTreeNode.Parent.Symbol is Power 314 && constantTreeNode.Parent.GetSubtree(1) == constantTreeNode) continue; // exponents in powers are not optimizated (see TreeToAutoDiffTermConverter) 312 315 constantTreeNode.Value = constants[i++]; 313 else if (updateVariableWeights && variableTreeNodeBase != null)316 } else if (updateVariableWeights && variableTreeNodeBase != null) 314 317 variableTreeNodeBase.Weight = constants[i++]; 315 318 else if (factorVarTreeNode != null) { -
branches/3087_Ceres_Integration/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs
r17180 r18006 56 56 public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicRegressionSingleObjectiveProblem(this, cloner); } 57 57 58 public SymbolicRegressionSingleObjectiveProblem() 59 : base(new RegressionProblemData(), new SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator(), new SymbolicDataAnalysisExpressionTreeCreator()) { 58 public SymbolicRegressionSingleObjectiveProblem() : this(new RegressionProblemData(), new SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator(), new SymbolicDataAnalysisExpressionTreeCreator()) { 59 } 60 public SymbolicRegressionSingleObjectiveProblem(IRegressionProblemData problemData, ISymbolicRegressionSingleObjectiveEvaluator evaluator, ISymbolicDataAnalysisSolutionCreator solutionCreator) : 61 base(problemData, evaluator, solutionCreator) { 62 60 63 Parameters.Add(new FixedValueParameter<DoubleLimit>(EstimationLimitsParameterName, EstimationLimitsParameterDescription)); 61 64 … … 91 94 changed = true; 92 95 } 96 97 if (!Operators.OfType<ShapeConstraintsAnalyzer>().Any()) { 98 Operators.Add(new ShapeConstraintsAnalyzer()); 99 changed = true; 100 } 93 101 if (changed) { 94 102 ParameterizeOperators(); … … 113 121 Operators.Add(new SymbolicRegressionSolutionsAnalyzer()); 114 122 Operators.Add(new SymbolicExpressionTreePhenotypicSimilarityCalculator()); 123 Operators.Add(new ShapeConstraintsAnalyzer()); 115 124 Operators.Add(new SymbolicRegressionPhenotypicDiversityAnalyzer(Operators.OfType<SymbolicExpressionTreePhenotypicSimilarityCalculator>()) { DiversityResultName = "Phenotypic Diversity" }); 116 125 ParameterizeOperators(); -
branches/3087_Ceres_Integration/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolution.cs
r17579 r18006 109 109 Add(new Result(ModelBoundsResultName, "Results concerning the derivation of symbolic regression solution", value)); 110 110 } 111 112 111 } 113 112 }
Note: See TracChangeset
for help on using the changeset viewer.