Esempio n. 1
0
File: Run.cs Progetto: wintonpc/Quqe
 public Run(ProtoRun protoRun, ProtoChromosome protoChrom, string symbol, DateTime startDate, DateTime endDate, double validationPct)
     : base(protoRun.Database)
 {
     ProtoChromosome = protoChrom;
     ProtoRun        = protoRun;
     Symbol          = symbol;
     StartDate       = startDate;
     EndDate         = endDate;
     ValidationPct   = validationPct;
     Database.Store(this);
 }
Esempio n. 2
0
        public static Run Evolve(ProtoRun protoRun, IGenTrainer trainer, DataSet trainingSet, DataSet validationSet,
                                 string symbol = null, DateTime startDate = default(DateTime), DateTime endDate = default(DateTime), double validationPct = 0,
                                 Action <int, int, int> onGenerationProgress = null,
                                 Action <Generation> onGenerationComplete    = null)
        {
            var run = new Run(protoRun, protoRun.ProtoChromosome, null, startDate, endDate, validationPct);
            var gen = Initialization.MakeInitialGeneration(trainingSet, run, trainer);

            while (true)
            {
                var evaluated = Evaluate(gen, validationSet);
                onGenerationComplete(gen);
                if (gen.Order == protoRun.NumGenerations - 1)
                {
                    return(run);
                }

                gen = Train(trainer, trainingSet, run, gen.Order + 1, onGenerationProgress,
                            Mutate(run,
                                   Combine(protoRun.MixturesPerGeneration,
                                           Select(protoRun.SelectionSize,
                                                  evaluated))));
            }
        }
Esempio n. 3
0
File: Run.cs Progetto: wintonpc/Quqe
 public Run(ProtoRun protoRun, ProtoChromosome protoChrom)
     : this(protoRun, protoChrom, null, DateTime.MinValue, DateTime.MinValue, 0)
 {
 }