Changeset 16786 for branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Problems.DynamicalSystemsModelling
- Timestamp:
- 04/15/19 22:04:10 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Problems.DynamicalSystemsModelling/3.3/Problem.cs
r16785 r16786 773 773 774 774 #region produce classical solutions to allow visualization with PDP 775 for (int treeIdx = 0; treeIdx < t rees.Length; treeIdx++) {775 for (int treeIdx = 0; treeIdx < targetVars.Length; treeIdx++) { 776 776 var t = (ISymbolicExpressionTree)trees[treeIdx].Clone(); 777 777 var name = targetVars.Concat(latentVariables).ElementAt(treeIdx); // whatever 778 778 var model = new SymbolicRegressionModel(name + "_diff", t, new SymbolicDataAnalysisExpressionTreeLinearInterpreter()); 779 779 var solutionDataset = ((Dataset)problemData.Dataset).ToModifiable(); 780 if (treeIdx < targetVars.Length) { 781 var absValues = solutionDataset.GetDoubleValues(name).ToArray(); 782 solutionDataset.AddVariable(name + "_diff", absValues.Skip(1).Zip(absValues, (v1, v0) => v1 - v0).Concat(new double[] { 0.0 }).ToList()); 783 } 780 var absValues = solutionDataset.GetDoubleValues(name).ToArray(); 781 solutionDataset.AddVariable(name + "_diff", absValues.Skip(1).Zip(absValues, (v1, v0) => v1 - v0).Concat(new double[] { 0.0 }).ToList()); 784 782 var solutionProblemData = new RegressionProblemData(solutionDataset, problemData.AllowedInputVariables, name + "_diff"); 785 783 var solution = model.CreateRegressionSolution(solutionProblemData);
Note: See TracChangeset
for help on using the changeset viewer.