Esempio n. 1
0
        static void Main(string[] args)
        {
            var patientClasses  = DataReader.LoadCsv("Data/csvResult.dat");
            var patientFeatures = DataReader.LoadCsv("Data/csvFeatures.dat");

            ContinousFeaturesRanges.Buckets = 10;
            int[]           featuresIds = null;// new[] { 4, 5, 6, 20 };
            IList <Patient> patients    = PatientCreator.Create(patientClasses, patientFeatures, featuresIds);

            var crossDataAlgorithm = new CrossDataAlgorithm(patients, 5);

            foreach (var confusionMatrixData in crossDataAlgorithm.ConfusionMatrixDatas)
            {
                ConfusionMatrixCreator.ShowConfusionMatrix(confusionMatrixData);
            }
        }
Esempio n. 2
0
        public void ConfusionMatrixCreator_TrueClassPatient_ConfusionMatrix()
        {
            IList <Patient> patients = new List <Patient>
            {
                new Patient(Classification.Normal, null)
                {
                    BayesClassification = Classification.Normal,
                }
            };


            var cmc   = new ConfusionMatrixCreator();
            var confM = cmc.CreateConfusionMatrix(patients, 1, Group.A);

            Assert.Equal(1, confM.ConfusionMatrix[0, 0]);
        }
Esempio n. 3
0
        public CrossDataAlgorithm(IList <Patient> patients, int repetitions)
        {
            ConfusionMatrixDatas   = new List <ConfusionMatrixData>();
            ConfusionMatrixCreator = new ConfusionMatrixCreator();

            PatientsGroupsList = new List <PatientsGroups>();
            for (int i = 0; i < repetitions; i++)
            {
                PatientsGroupsList.Add(new PatientsGroups(patients));
            }

            _actualRandomNmb = 0;
            foreach (var patientsGroups in PatientsGroupsList)
            {
                _actualRandomNmb++;
                DoubleCrossValidation(patientsGroups);
            }
        }