private void Classify()
        {
            C45Controller c45controller = new C45Controller();

            c45controller.DecisionTreeGenerationStarted  += new DecisionTreeGenerationStartedEventHandler(C45Controller_DecisionTreeGenerationStarted);
            c45controller.DecisionTreeGenerationFinished += new DecisionTreeGenerationFinishedEventHandler(C45Controller_DecisionTreeGenerationFinished);
            c45controller.ConsultationStarted            += new ConsultationStartedEventHandler(C45Controller_ConsultationStarted);
            c45controller.ConsultationFinished           += new ConsultationFinishedEventHandler(C45Controller_ConsultationFinished);

            foreach (C45FeatureSet fs in this)
            {
                if (fs.IsMarked)
                {
                    fs.ComputedResult = c45controller.Classification(fs._featureArray);
                    fs.isClassified   = true;

                    this.OnSingleFeatureClassified(
                        this,
                        new C45SingleFeatureSetClassifiedEventArgs(c45controller.GetStatistics()));
                }
            }
            this.OnClassificationComplete(
                this,
                new EventArgs());
        }
        public static C45FeatureSetCollection LoadFSCFromFile(String filename)
        {
            C45Controller controller = new C45Controller();

            if (instance == null)
            {
                instance = controller.GetFSCFromFile(filename);
            }

            return(instance);
        }
        public C45Statistics GetStatistics()
        {
            C45Statistics c45stats = new C45Statistics();

            C45Controller.GetStatistics(ref c45stats._statistics);

            c45stats.TreeItems = c45stats._statistics.iTreeItems;
            c45stats.DecisionTreeGenerationTime = c45stats._statistics.lDecisionTreeGenerationTime;
            c45stats.ConsultationTime           = c45stats._statistics.lConsultationTime;

            return(c45stats);
        }
        public void AddComputedResults()
        {
            C45Controller c45controller = new C45Controller();

            foreach (C45FeatureSet fs in this)
            {
                if (fs.IsMarked)
                {
                    c45controller.AddResult(fs,
                                            fs.ComputedResult.GetBestResult().ResultClassName);
                }
            }
        }
        public void AddUserResults()
        {
            C45Controller c45controller = new C45Controller();

            foreach (C45FeatureSet fs in this)
            {
                if (fs.IsMarked)
                {
                    c45controller.AddResult(
                        fs,
                        fs.UserResult.ClassName);
                }
            }
        }
Esempio n. 6
0
        //static private C45Schema instance = null;
        #endregion

        #region CreateFromFile
        public static C45Schema CreateFromFile(String filename)
        {
            C45Controller controller = new C45Controller();

            return(controller.ParseNamesFile(filename));
        }