public double Train(TrainingData data)
        {
            var localError = data.Output - Evaluate(data);

            if (localError == 0)
            {
                return(localError);
            }

            weightX += learningRate * localError * data.InputX;
            weightY += learningRate * localError * data.InputY;
            weightB += learningRate * localError * 1;

            return(localError);
        }
        public IEnumerable <TrainingData> NormalizeSchedulingTrainingData(
            params SchedulingTrainingData[] schedulingTrainingDatas)
        {
            ealiestDeliveryDifference = schedulingTrainingDatas.OrderBy(std => std.Latness.Ticks).First().Latness;
            latestDeliveryDifference  = schedulingTrainingDatas.OrderByDescending(std => std.Latness.Ticks).First().Latness;

            minimumOverproduction = schedulingTrainingDatas.OrderBy(std => std.Overproduction).First().Overproduction;
            maximumOverproduction = schedulingTrainingDatas.OrderByDescending(std => std.Overproduction).First().Overproduction;

            var trainingDatas = new List <TrainingData>();

            foreach (var schedulingTrainingData in schedulingTrainingDatas)
            {
                var data         = GetData(schedulingTrainingData);
                var trainingData = new TrainingData(data.InputX, data.InputY, schedulingTrainingData.isValid ? 1 : -1);

                trainingDatas.Add(trainingData);
            }

            return(trainingDatas);
        }