Changeset 14776 for branches/PerformanceComparison/HeuristicLab.Algorithms.MemPR/3.3/Binary/SolutionModel
- Timestamp:
- 03/22/17 16:52:36 (8 years ago)
- Location:
- branches/PerformanceComparison/HeuristicLab.Algorithms.MemPR/3.3/Binary/SolutionModel/Univariate
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison/HeuristicLab.Algorithms.MemPR/3.3/Binary/SolutionModel/Univariate/BiasedModelTrainer.cs
r14563 r14776 26 26 using HeuristicLab.Data; 27 27 using HeuristicLab.Encodings.BinaryVectorEncoding; 28 using HeuristicLab.Encodings.BinaryVectorEncoding.SolutionModel; 28 29 using HeuristicLab.Optimization; 29 30 using HeuristicLab.Parameters; … … 31 32 32 33 namespace HeuristicLab.Algorithms.MemPR.Binary.SolutionModel.Univariate { 34 public enum ModelBiasOptions { Rank, Fitness } 35 33 36 [Item("Biased Univariate Model Trainer (binary)", "", ExcludeGenericTypeInfo = true)] 34 37 [StorableClass] … … 60 63 61 64 public void TrainModel(TContext context) { 62 context.Model = Trainer.TrainBiased(ModelBias, context.Random, context.Maximization, context.Population.Select(x => x.Solution), context.Population.Select(x => x.Fitness)); 65 var biasType = modelBiasParameter.Value.Value; 66 switch (biasType) { 67 case ModelBiasOptions.Fitness: 68 context.Model = UnivariateModelTrainer.TrainWithFitnessBias(context.Random, context.Maximization, 69 context.Population.Select(x => x.Solution), 70 context.Population.Select(x => x.Fitness)); 71 break; 72 case ModelBiasOptions.Rank: 73 context.Model = UnivariateModelTrainer.TrainWithRankBias(context.Random, context.Maximization, 74 context.Population.Select(x => x.Solution), 75 context.Population.Select(x => x.Fitness)); 76 break; 77 } 63 78 } 64 79 } -
branches/PerformanceComparison/HeuristicLab.Algorithms.MemPR/3.3/Binary/SolutionModel/Univariate/UnbiasedModelTrainer.cs
r14563 r14776 25 25 using HeuristicLab.Core; 26 26 using HeuristicLab.Encodings.BinaryVectorEncoding; 27 using HeuristicLab.Encodings.BinaryVectorEncoding.SolutionModel; 27 28 using HeuristicLab.Optimization; 28 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 49 50 50 51 public void TrainModel(TContext context) { 51 context.Model = Trainer.TrainUnbiased(context.Random, context.Population.Select(x => x.Solution));52 context.Model = UnivariateModelTrainer.TrainUnbiased(context.Random, context.Population.Select(x => x.Solution)); 52 53 } 53 54 }
Note: See TracChangeset
for help on using the changeset viewer.