コード例 #1
0
        /// <summary>Generates reports on precompiled resources for each fold</summary>
        /// <remarks><para>What it will do?</para></remarks>
        /// <param name="word">--</param>
        /// <param name="steps">--</param>
        /// <param name="debug">--</param>
        /// <seealso cref="aceOperationSetExecutorBase"/>
        public void aceOperation_runReportOnResources(
            [Description("--")] String word   = "word",
            [Description("--")] Int32 steps   = 5,
            [Description("--")] Boolean debug = true)
        {
            SetupDocumentSelection setup = docSelection.data.CloneViaXML();

            ProceduralFolderFor <ProcedureCreateScoreSet, SetupDocumentSelection, OperationContext, ExperimentModelExecutionContext> procedures
                = new ProceduralFolderFor <ProcedureCreateScoreSet, SetupDocumentSelection, OperationContext, ExperimentModelExecutionContext>(mainContext.folds, setup, mainContext.notes, parent);


            foreach (var p in procedures)
            {
                p.Open();


                //ExperimentDataSetFoldContextPair<OperationContext> o_pair = new ExperimentDataSetFoldContextPair<OperationContext>(p.fold, new OperationContext());
                //o_pair.context.DeployDataSet(p.fold, output);
                FeatureVectorDictionaryWithDimensions dictWithDim = DocumentRankingExtensions.MergeDSRankings(p.fold_notes.folder, "", output, "*_ranking.xml");

                var t = dictWithDim.Values.MakeTable(dictWithDim.dimensions, "Rankings", p.description, mainContext.truthTable.label_index);

                p.fold_notes.SaveDataTable(t);
                //t.GetReportAndSave(p.fold_notes.folder, imbACE.Core.application.)


                var dictFWT = WeightDictionaryTools.MergeWeightDictionaries(p.fold_notes.folder, "", output, "*_wt.xml");

                var tfw = dictFWT.Values.MakeTable(dictFWT.dimensions, "WeightTable", p.description);

                p.fold_notes.SaveDataTable(tfw);

                p.Close();
            }
        }
コード例 #2
0
        /// <summary>
        /// Combines two or more precompiled document selection ranks
        /// </summary>
        /// <param name="inputNames">comma separated list of DS rank file names, leave empty if search pattern is used</param>
        /// <param name="searchPattern">file search pattern to select source files, leave * if no file search should be performed</param>
        /// <param name="compression">vector dimensions compression operation, i.e. how scores should be combined into single dimension</param>
        /// <param name="outputName">Name of the output.</param>
        /// <param name="doRankingFusion">if set to <c>true</c> [do ranking fusion].</param>
        /// <remarks>
        /// What it will do?
        /// </remarks>
        /// <seealso cref="aceOperationSetExecutorBase" />
        public void aceOperation_makeCombineDSRanks(
            [Description("Space separated list of DS rank file names, leave empty if search pattern is used")] String inputNames = " ",
            [Description("vector dimensions compression operation, i.e. how scores should be combined into single dimension")] operation compression = operation.avg,
            [Description("Name of output Document Selection Rank file. Leave * to assign name as combination of input files")] String outputName     = "*",
            [Description("If true, it will perform ranking fusion instead of simple score fusion")] Boolean doRankingFusion = true,
            [Description("file search pattern to select source files, leave * if no file search should be performed")] String searchPattern = "*"
            )
        {
            SetupDocumentSelection setup = docSelection.data.CloneViaXML();

            ProceduralFolderFor <ProcedureCreateScoreSet, SetupDocumentSelection, OperationContext, ExperimentModelExecutionContext> procedures
                = new ProceduralFolderFor <ProcedureCreateScoreSet, SetupDocumentSelection, OperationContext, ExperimentModelExecutionContext>(mainContext.folds, setup, mainContext.notes, parent);

            outputName = DocumentSelectResult.CheckAndMakeFilename(outputName);

            foreach (var p in procedures)
            {
                p.Open();


                DocumentSelectResult resultOut = new DocumentSelectResult();

                var fl = mainContext.resourceProvider.GetResourceFiles(inputNames, p.fold);

                List <DocumentSelectResult> results = DocumentRankingExtensions.LoadDSRankings(fl, p.notes);

                resultOut = results.Fusion(compression, doRankingFusion, true, p.notes);

                String pt = mainContext.resourceProvider.SetResourceFilePath(outputName, p.fold);

                resultOut.saveObjectToXML(pt);

                p.Close();
            }
        }
コード例 #3
0
        /// <summary>
        /// Creates document ranking score table that afterwards may be consumed by document selection procedure
        /// </summary>
        /// <param name="loadConfig">The load configuration.</param>
        /// <param name="outputName">Name of the output.</param>
        /// <param name="skipIfExists">if set to <c>true</c> [skip if exists].</param>
        /// <remarks>
        /// It will deploy current document selector, evaluate folds and create the ranking tables?
        /// </remarks>
        /// <seealso cref="aceOperationSetExecutorBase" />
        public void aceOperation_runCreateDSRanks(
            [Description("--")] String loadConfig    = "*",
            [Description("--")] String outputName    = "*",
            [Description("--")] Boolean skipIfExists = true,
            [Description("--")]  String description  = " ")
        {
            if (loadConfig != "*")
            {
                docSelection.aceOperation_runLoad(loadConfig, true);
            }
            SetupDocumentSelection setup = docSelection.data.CloneViaXML();

            setup.descriptionAppendix.Add(description);
            setup.LearnFrom(mainContext.procedureCommons);

            if (outputName != "*")
            {
                setup.OutputFilename = outputName;
            }
            setup.skipIfExisting = skipIfExists;

            //setup.reportOptions = mainContext.reportOptions;

            ProceduralFolderFor <ProcedureCreateScoreSet, SetupDocumentSelection, OperationContext, ExperimentModelExecutionContext> procedures
                = new ProceduralFolderFor <ProcedureCreateScoreSet, SetupDocumentSelection, OperationContext, ExperimentModelExecutionContext>(mainContext.folds, setup, mainContext.notes, parent);

            proceduralStack.Push(procedures);

            // contextSet = procedures.Execute(mainContext.ParallelThreads, output, contextSet, mainContext);
        }