/// <summary>
        /// Deploys the specified v case coll.
        /// </summary>
        /// <param name="vCaseColl">The v case coll.</param>
        /// <param name="validationCase">The validation case.</param>
        /// <param name="subjects">The subjects.</param>
        /// <param name="classes">The classes.</param>
        public void deploy(validationCaseCollection vCaseColl, kFoldValidationCase _validationCase, IEnumerable <IPipelineTaskSubject> subjects, DocumentSetClasses classes)
        {
            lock (deployLock)
            {
                validation     = vCaseColl;
                validationCase = _validationCase;

                Thread.Sleep(100);

                var sites = subjects.ToSubjectTokenType <pipelineTaskMCSiteSubject>().ToList();
                // var sitesCopy = sites.ToList();

                sites = vCaseColl.FilterSites(sites);

                foreach (pipelineTaskMCSiteSubject site in sites)
                {
                    DocumentSetCase sCase = new DocumentSetCase();
                    sCase.subject = site;
                    sCase.data    = new WebClassifierResultSet(classes, validationCase.context, validationCase.extractor.settings);

                    Add(sCase);
                }
            }
        }
Exemple #2
0
        ///// <summary>
        ///// Report on kFold case
        ///// </summary>
        ///// <returns></returns>
        //public Dictionary<IWebPostClassifier, DocumentSetCaseCollectionReport> GetCaseReport()
        //{
        //    Dictionary<IWebPostClassifier, DocumentSetCaseCollectionReport> reports = new Dictionary<IWebPostClassifier, DocumentSetCaseCollectionReport>();

        //    foreach (var classifier in validationCase.context.setup.classifiers)
        //    {

        //        DocumentSetCaseCollectionReport output = new DocumentSetCaseCollectionReport(validationCase.name + "_" + classifier.name + "_" + );

        //        output.kFoldCase = ;
        //        output.Classifier = classifier.name;

        //        classificationEvalMetricSet metrics = GetMetrics(classifier);

        //        foreach (KeyValuePair<int, DocumentSetCaseCollection> pair in this)
        //        {
        //            String className = pair.Value.validation.className;
        //            foreach (var setCase in pair.Value)
        //            {
        //                var assocClass = setCase.data[classifier].selected;

        //                if (assocClass != null)
        //                {

        //                    if (pair.Value.rightClassID == assocClass.classID)
        //                    {
        //                        output.Correct++;
        //                    }
        //                    else
        //                    {
        //                        output.Wrong++;
        //                    }

        //                }
        //                output.Targets++;
        //            }
        //        }


        //        output.Precision = metrics.GetPrecision();
        //        output.Recall = metrics.GetRecall();
        //        output.F1measure = metrics.GetF1();
        //        reports.Add(classifier, output);

        //    }

        //    return reports;

        //}


        public DocumentSetCaseCollectionSet(kFoldValidationCase _validationCase, DocumentSetClasses documentSetClasses)
        {
            classCollection = documentSetClasses;
            validationCase  = _validationCase;
        }