Beispiel #1
0
        public ConfusionMatrix(PicesTrainingConfigManaged _config,
                               PicesClassList _classifierClasses,            /**< List of classes in origianl Classifier before reduction due to training level. */
                               TrainingModel2 _trainingModel,
                               String _modelName,
                               String _groundTruthRootDir,
                               uint _trainLevel,
                               uint _predLevel
                               )
        {
            config             = _config;
            trainingModel      = _trainingModel;
            groundTruthRootDir = _groundTruthRootDir;
            trainLevel         = _trainLevel;
            predLevel          = _predLevel;
            classifierClasses  = _classifierClasses;

            if (config != null)
            {
                otherClass = config.OtherClass();
            }

            InitializeComponent();
            classes = new PicesClassList();
            classes.Clear();

            ModelName.Text   = _modelName;
            GroundTruth.Text = _groundTruthRootDir;
        }
        } /* InitializeTrainAndPredLevelFields */

        private void  ValidateTrainingModel()
        {
            if (string.IsNullOrEmpty(TrainingModelSelected.Text))
            {
                return;
            }

            trainingModelName  = TrainingModelSelected.Text;
            curSelModel        = new PicesTrainingConfigManaged(trainingModelName, runLog);
            trainingModelValid = curSelModel.Valid();
            if (!trainingModelValid)
            {
                String alarmMsg = "Error Loading Configuration File";
                alarmMsg += "\n\n";
                alarmMsg += curSelModel.LoadLogStream();

                MessageBox.Show(this, alarmMsg, "Could not load Config file", MessageBoxButtons.OK);
            }
            else
            {
                otherClass = curSelModel.OtherClass();
                if (crossValidation)
                {
                    GroundTruth.Text = "F:\\Pices\\SavedImages\\Cruise-WB0812_Station-DWH";
                }
                //GroundTruth.Text = curSelModel.RootDir ();

                origClassifierClasses = curSelModel.ExtractClassList();
                InitializeTrainAndPredLevelFields();
            }
        } /* ValidateTrainingModel */