Changeset 14015
- Timestamp:
- 07/07/16 12:51:31 (8 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/RegressionTreeModel.cs
r14000 r14015 170 170 if (node.VarName == TreeNode.NO_VARIABLE) 171 171 return node.Val; 172 if (columnCache[nodeIdx] == null ) {172 if (columnCache[nodeIdx] == null || double.IsNaN(columnCache[nodeIdx][row])) { 173 173 if (node.WeightLeft.IsAlmost(-1.0)) throw new InvalidOperationException("Cannot calculate partial dependence for trees loaded from older versions of HeuristicLab."); 174 174 // weighted average for partial dependence plot (recursive here because we need to calculate both sub-trees) -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/MctsSymbolicRegression/ExpressionEvaluator.cs
r13652 r14015 89 89 90 90 // pred must be allocated by the caller 91 // if adjustOffsetForLogAndExp is set to true we determine c in log(c + f(x)) to make sure that c + f(x) is positive 92 public void Exec(byte[] code, double[][] vars, double[] consts, double[] pred, bool adjustOffsetForLogAndExp = false) { 91 // if adjustParameters is set to true we determine parameters in function to make sure that the function output is valid 92 // e.g. in log(c + f(x)) to make sure that c + f(x) is positive 93 public void Exec(byte[] code, double[][] vars, double[] consts, double[] pred, bool adjustParameters = false) { 93 94 Contract.Assert(pred != null && pred.Length >= vLen); 94 95 int topOfStack = -1; … … 153 154 } 154 155 case (byte)OpCodes.Log: { 155 if (adjust OffsetForLogAndExp) {156 if (adjustParameters) { 156 157 // here we assume that the last used parameter is c in log(f(x) + c) 157 158 // this must match actions for producing code in the automaton! … … 174 175 } 175 176 case (byte)OpCodes.Exp: { 176 if (adjust OffsetForLogAndExp) {177 if (adjustParameters) { 177 178 // here we assume that the last used parameter is c in exp(f(x) * c) 178 179 // this must match actions for producing code in the automaton!
Note: See TracChangeset
for help on using the changeset viewer.