- Timestamp:
- 10/18/18 16:16:31 (6 years ago)
- Location:
- branches/2915-AbsoluteSymbol
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2915-AbsoluteSymbol
- Property svn:mergeinfo changed
-
branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
/branches/2839_HiveProjectManagement/HeuristicLab.Algorithms.DataAnalysis (added) merged: 16057,16092 /trunk/HeuristicLab.Algorithms.DataAnalysis (added) merged: 16071,16086,16117,16168
- Property svn:mergeinfo changed
-
branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4
- Property svn:mergeinfo changed
-
branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/GBM/GradientBoostingRegressionAlgorithm.cs
r15769 r16240 210 210 protected override void Run(CancellationToken cancellationToken) { 211 211 // Set up the algorithm 212 if (SetSeedRandomly) Seed = new System.Random().Next();212 if (SetSeedRandomly) Seed = RandomSeedGenerator.GetSeed(); 213 213 var rand = new MersenneTwister((uint)Seed); 214 214 -
branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithm.cs
r15583 r16240 186 186 protected override void Run(CancellationToken cancellationToken) { 187 187 // Set up the algorithm 188 if (SetSeedRandomly) Seed = new System.Random().Next();188 if (SetSeedRandomly) Seed = Random.RandomSeedGenerator.GetSeed(); 189 189 190 190 // Set up the results display -
branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/NearestNeighbour/NearestNeighbourModel.cs
r15786 r16240 130 130 // automatic determination of weights (all features should have variance = 1) 131 131 this.weights = this.allowedInputVariables 132 .Select(name => 1.0 / dataset.GetDoubleValues(name, rows).StandardDeviationPop()) 132 .Select(name => { 133 var pop = dataset.GetDoubleValues(name, rows).StandardDeviationPop(); 134 return pop.IsAlmost(0) ? 1.0 : 1.0/pop; 135 }) 133 136 .Concat(new double[] { 1.0 }) // no scaling for target variable 134 137 .ToArray(); -
branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleModel.cs
r15739 r16240 36 36 public sealed class NeuralNetworkEnsembleModel : ClassificationModel, INeuralNetworkEnsembleModel { 37 37 38 private object mlpEnsembleLocker = new object(); 38 39 private alglib.mlpensemble mlpEnsemble; 39 public alglib.mlpensemble MultiLayerPerceptronEnsemble {40 get { return mlpEnsemble; }41 set {42 if (value != mlpEnsemble) {43 if (value == null) throw new ArgumentNullException();44 mlpEnsemble = value;45 OnChanged(EventArgs.Empty);46 }47 }48 }49 40 50 41 public override IEnumerable<string> VariablesUsedForPrediction { … … 103 94 } 104 95 // mlpeprocess writes data in mlpEnsemble and is therefore not thread-safe 105 lock (mlpEnsemble ) {96 lock (mlpEnsembleLocker) { 106 97 alglib.mlpeprocess(mlpEnsemble, x, ref y); 107 98 } … … 123 114 } 124 115 // mlpeprocess writes data in mlpEnsemble and is therefore not thread-safe 125 lock (mlpEnsemble ) {116 lock (mlpEnsembleLocker) { 126 117 alglib.mlpeprocess(mlpEnsemble, x, ref y); 127 118 } … … 145 136 return new NeuralNetworkEnsembleClassificationSolution(this, new ClassificationEnsembleProblemData(problemData)); 146 137 } 147 148 #region events 149 public event EventHandler Changed; 150 private void OnChanged(EventArgs e) { 151 var handlers = Changed; 152 if (handlers != null) 153 handlers(this, e); 154 } 155 #endregion 156 138 157 139 #region persistence 158 140 [Storable] -
branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkModel.cs
r15739 r16240 36 36 public sealed class NeuralNetworkModel : ClassificationModel, INeuralNetworkModel { 37 37 38 private object mlpLocker = new object(); 38 39 private alglib.multilayerperceptron multiLayerPerceptron; 39 public alglib.multilayerperceptron MultiLayerPerceptron {40 get { return multiLayerPerceptron; }41 set {42 if (value != multiLayerPerceptron) {43 if (value == null) throw new ArgumentNullException();44 multiLayerPerceptron = value;45 OnChanged(EventArgs.Empty);46 }47 }48 }49 40 50 41 public override IEnumerable<string> VariablesUsedForPrediction { … … 107 98 } 108 99 // NOTE: mlpprocess changes data in multiLayerPerceptron and is therefore not thread-save! 109 lock (m ultiLayerPerceptron) {100 lock (mlpLocker) { 110 101 alglib.mlpprocess(multiLayerPerceptron, x, ref y); 111 102 } … … 127 118 } 128 119 // NOTE: mlpprocess changes data in multiLayerPerceptron and is therefore not thread-save! 129 lock (m ultiLayerPerceptron) {120 lock (mlpLocker) { 130 121 alglib.mlpprocess(multiLayerPerceptron, x, ref y); 131 122 } … … 150 141 } 151 142 152 #region events153 public event EventHandler Changed;154 private void OnChanged(EventArgs e) {155 var handlers = Changed;156 if (handlers != null)157 handlers(this, e);158 }159 #endregion160 161 143 #region persistence 162 144 [Storable] -
branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/NonlinearRegression/NonlinearRegression.cs
r15583 r16240 186 186 qualityTable.Rows.Add(testRMSERow); 187 187 Results.Add(new Result(qualityTable.Name, qualityTable.Name + " for all restarts", qualityTable)); 188 if (SetSeedRandomly) Seed = (new System.Random()).Next();188 if (SetSeedRandomly) Seed = RandomSeedGenerator.GetSeed(); 189 189 var rand = new MersenneTwister((uint)Seed); 190 190 bestSolution = CreateRegressionSolution(Problem.ProblemData, ModelStructure, Iterations, ApplyLinearScaling, rand); -
branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestClassification.cs
r15583 r16240 135 135 protected override void Run(CancellationToken cancellationToken) { 136 136 double rmsError, relClassificationError, outOfBagRmsError, outOfBagRelClassificationError; 137 if (SetSeedRandomly) Seed = new System.Random().Next();137 if (SetSeedRandomly) Seed = Random.RandomSeedGenerator.GetSeed(); 138 138 139 139 var model = CreateRandomForestClassificationModel(Problem.ProblemData, NumberOfTrees, R, M, Seed, out rmsError, out relClassificationError, out outOfBagRmsError, out outOfBagRelClassificationError); -
branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestRegression.cs
r15583 r16240 134 134 protected override void Run(CancellationToken cancellationToken) { 135 135 double rmsError, avgRelError, outOfBagRmsError, outOfBagAvgRelError; 136 if (SetSeedRandomly) Seed = new System.Random().Next();136 if (SetSeedRandomly) Seed = Random.RandomSeedGenerator.GetSeed(); 137 137 var model = CreateRandomForestRegressionModel(Problem.ProblemData, NumberOfTrees, R, M, Seed, 138 138 out rmsError, out avgRelError, out outOfBagRmsError, out outOfBagAvgRelError); -
branches/2915-AbsoluteSymbol/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/TSNEAlgorithm.cs
r15583 r16240 275 275 if (wdist != null) wdist.Initialize(problemData); 276 276 if (state == null) { 277 if (SetSeedRandomly) Seed = new System.Random().Next();277 if (SetSeedRandomly) Seed = RandomSeedGenerator.GetSeed(); 278 278 var random = new MersenneTwister((uint)Seed); 279 279 var dataset = problemData.Dataset;
Note: See TracChangeset
for help on using the changeset viewer.