Changeset 14316
 Timestamp:
 09/29/16 17:16:44 (8 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/NonlinearRegression/NonlinearRegression.cs
r14258 r14316 21 21 22 22 using System; 23 using System.Collections.Generic;24 23 using System.Linq; 25 24 using HeuristicLab.Common; 26 25 using HeuristicLab.Core; 27 26 using HeuristicLab.Data; 27 using HeuristicLab.Optimization; 28 28 using HeuristicLab.Parameters; 29 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;30 using HeuristicLab.Optimization;31 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 30 using HeuristicLab.Problems.DataAnalysis; … … 130 128 if (SetSeedRandomly) Seed = (new System.Random()).Next(); 131 129 var rand = new MersenneTwister((uint)Seed); 132 IRegressionSolution bestSolution = null; 130 131 var bestSolution = CreateRegressionSolution(Problem.ProblemData, ModelStructure, Iterations, rand); 133 132 for (int r = 0; r < Restarts; r++) { 134 133 var solution = CreateRegressionSolution(Problem.ProblemData, ModelStructure, Iterations, rand); 135 if ( bestSolution == null solution.TrainingRootMeanSquaredError < bestSolution.TrainingRootMeanSquaredError) {134 if (solution.TrainingRootMeanSquaredError < bestSolution.TrainingRootMeanSquaredError) { 136 135 bestSolution = solution; 137 136 } … … 149 148 /// The starting point for the numeric constants is initialized randomly if a random number generator is specified (~N(0,1)). Otherwise the user specified constants are 150 149 /// used as a starting point. 151 /// </summary> 150 /// </summary> 152 151 /// <param name="problemData">Training and test data</param> 153 152 /// <param name="modelStructure">The function as infix expression</param>
Note: See TracChangeset
for help on using the changeset viewer.