Ejemplo n.º 1
0
        public void GenerateBigTestData()
        {
            var sut = new DataPrepper(HelperFunctions.GenerateBigPureData(),
                                      new StockInputsGeneratorFactory(InputsType.Full),
                                      new StockTargetsGeneratorFactory(TargetType.Profit, 50));

            IList <DataSet> trainingData = sut.GetTrainingInputData();

            Approvals.VerifyAll(trainingData, "DataSet", a => string.Join(",", a.Targets) + " and " + string.Join(", ", a.SourceData));
        }
Ejemplo n.º 2
0
        private static DataSet ExtractStockNetwork()
        {
            var ds = _sqlDatabase.ReadData("QTEC").GetData();

            var prepper = new DataPrepper(new PureData(ds),
                                          new StockInputsGeneratorFactory(InputsType.Full),
                                          new StockTargetsGeneratorFactory(TargetType.Profit, 126));

            _dataSets = prepper.GetTrainingInputData();

            return(prepper.UnTargeted.Last());
        }
Ejemplo n.º 3
0
        public void PuttingItAllTogetherForTestData()
        {
            var sut = new DataPrepper(HelperFunctions.GeneratePureData(),
                                      new StockInputsGeneratorFactory(InputsType.Basic, 3),
                                      new StockTargetsGeneratorFactory(TargetType.Profit, 2));

            sut.GetTrainingInputData();

            IList <DataSet> unTargeted = sut.UnTargeted;

            Approvals.VerifyAll(unTargeted, "DataSet", a =>
                                $" targets {string.Join(", ", a.Targets)} inputs {string.Join(", ", a.SourceData)}");
        }
Ejemplo n.º 4
0
        public void InitalCall()
        {
            PureData pureData = new PureData(new List <DataElement>());
            IInputsGeneratorFactory  inputsFactory  = A.Fake <IInputsGeneratorFactory>();
            ITargetsGeneratorFactory targetsFactory = A.Fake <ITargetsGeneratorFactory>();

            A.CallTo(() => inputsFactory.GetInputGenerators(pureData)).Returns(Enumerable.Empty <IInputGenerator>());
            A.CallTo(() => targetsFactory.GetTargetGenerators(pureData)).Returns(Enumerable.Empty <ITargetGenerator>());

            var sut = new DataPrepper(pureData, inputsFactory, targetsFactory);

            IList <DataSet> trainingData = sut.GetTrainingInputData();

            Assert.NotNull(trainingData);
            A.CallTo(() => inputsFactory.GetInputGenerators(pureData)).MustHaveHappened();
            A.CallTo(() => targetsFactory.GetTargetGenerators(pureData)).MustHaveHappened();
        }