Пример #1
0
        private NeuralNetworkPredictionsReport MakePredictionRecordingResult(
            NeuralNetworkPredictionsReport report,
            BankTransaction transaction)
        {
            logger.LogInformation($"Predicting new transaction. Current report: {report}");

            var networkPrediction = networkAccessor.TargetNetwork
                                    .PredictionFor(transaction.ToNetworkInputData(),
                                                   ParallelOptionsExtensions.UnrestrictedMultiThreadedOptions);

            if (IsCorrectPrediction(networkPrediction, transaction.Class))
            {
                return(NeuralNetworkPredictionsReport.UpdateFor(
                           report,
                           transaction.Class,
                           predictionWasCorrect: true));
            }

            return(NeuralNetworkPredictionsReport.UpdateFor(
                       report,
                       transaction.Class,
                       predictionWasCorrect: false));
        }
Пример #2
0
 public NeuralNetworkPredictionsReport RunPredictions()
 {
     return(dataProvider.TestingData
            .Aggregate(NeuralNetworkPredictionsReport.EmptyReport(), MakePredictionRecordingResult));
 }