Beispiel #1
0
 /// <summary>
 /// Initializes a new instance from an existing one (copy constructor).
 /// </summary>
 /// <param name="original">The original <see cref="UniformDistributedRandom"/> instance which is used to initialize the new instance.</param>
 /// <param name="cloner">A <see cref="Cloner"/> which is used to track all already cloned objects in order to avoid cycles.</param>
 private UniformDistributedRandom(UniformDistributedRandom original, Cloner cloner)
     : base(original, cloner)
 {
     uniform = cloner.Clone(original.uniform);
     min     = original.min;
     max     = original.max;
 }
 public override IEnumerable<IDataDescriptor> GetDataDescriptors() {
   var sizes = new int[] { 50, 100, 200 };
   var pp = new double[] { 0.1, 0.25, 0.5 };
   var noiseRatios = new double[] { 0.01, 0.05, 0.1, 0.2 };
   var mt = new MersenneTwister();
   var xGenerator = new NormalDistributedRandom(mt, 0, 1);
   var weightGenerator = new UniformDistributedRandom(mt, 0, 10);
   return (from size in sizes
           from p in pp
           from noiseRatio in noiseRatios
           select new FeatureSelection(size, p, noiseRatio, xGenerator, weightGenerator))
           .Cast<IDataDescriptor>()
           .ToList();
 }
Beispiel #3
0
 /// <summary>
 /// Generates a new double random number.
 /// </summary>
 /// <returns>A double random number.</returns>
 public double NextDouble()
 {
     return(UniformDistributedRandom.NextDouble(uniform, min, max));
 }
 /// <summary>
 /// Initializes a new instance from an existing one (copy constructor).
 /// </summary>
 /// <param name="original">The original <see cref="UniformDistributedRandom"/> instance which is used to initialize the new instance.</param>
 /// <param name="cloner">A <see cref="Cloner"/> which is used to track all already cloned objects in order to avoid cycles.</param>
 private UniformDistributedRandom(UniformDistributedRandom original, Cloner cloner)
   : base(original, cloner) {
   uniform = cloner.Clone(original.uniform);
   min = original.min;
   max = original.max;
 }