コード例 #1
0
        public String GetResourceFile(String filename, ExperimentDataSetFold fold)
        {
            if (folder == null)
            {
                return("");
            }

            var fold_folder = folder.Attach(fold.name);

            filename = filename.ensureEndsWith(".xml");

            String p = fold_folder.findFile(filename, SearchOption.TopDirectoryOnly);

            return(p);
        }
コード例 #2
0
        public String SetResourceFilePath(String filename, ExperimentDataSetFold fold)
        {
            if (folder == null)
            {
                return("");
            }

            var fold_folder = folder.Attach(fold.name);

            filename = filename.ensureEndsWith(".xml");

            String p = fold_folder.pathFor(filename, imbSCI.Data.enums.getWritableFileMode.overwrite);

            return(p);
        }
コード例 #3
0
        ///// <summary>
        ///// Prepares the notes.
        ///// </summary>
        ///// <param name="_rootFolder">The root folder.</param>
        ///// <param name="_experimentDescription">The experiment description.</param>
        ///// <param name="logger">The logger.</param>
        //public void PrepareNotes()
        //{

        //}


        /// <summary>
        /// Prepares the dataset.
        /// </summary>
        /// <param name="dataset">The dataset.</param>
        /// <param name="validationModel">The validation model.</param>
        public void PrepareDataset(IEnumerable <WebSiteDocumentsSet> __dataset, CrossValidationModel validationModel)
        {
            crossValidation = validationModel;
            if (validationModel != null)
            {
                validationModel.Describe(notes);
            }
            else
            {
                validationModel            = new CrossValidationModel();
                validationModel.SingleFold = true;
            }

            truthTable = new ExperimentTruthTable();

            dataset = new ExperimentDataSetFold(__dataset.ToList(), runName);



            // ------------------ creation of Experiment Folds ------------------ //
            if (validationModel != null)
            {
                if (notes != null)
                {
                    notes.logStartPhase("[-] Creating k-fold crossvalidation datasets", "The input dataset with [" + dataset.Count + "] categories, is sliced into k=[" + validationModel.K + "] mutually exclusive folds, of ~equal size");
                }
                folds = new ExperimentDataSetFolds();
                folds.Deploy(validationModel, dataset, notes);
            }
            else
            {
            }

            truthTable.Deploy(dataset, notes);

            /*
             * testReportsByFold = new Dictionary<string, List<classificationReport>>();
             * foreach (var fold in folds)
             * {
             *  testReportsByFold.Add(fold.name, new List<classificationReport>());
             * }*/

            if (notes != null)
            {
                notes.logEndPhase();
            }
        }
コード例 #4
0
        /// <summary>
        /// Gets the resource files.
        /// </summary>
        /// <param name="filenames">The filenames.</param>
        /// <param name="fold">The fold.</param>
        /// <returns></returns>
        public List <String> GetResourceFiles(List <String> filenames, ExperimentDataSetFold fold)
        {
            List <String> output = new List <string>();

            if (folder == null)
            {
                return(output);
            }

            var fold_folder = folder.Attach(fold.name);

            foreach (String fn in filenames)
            {
                var filename = fn.ensureEndsWith(".xml");

                String p = fold_folder.findFile(filename, SearchOption.TopDirectoryOnly);
                if (!p.isNullOrEmpty())
                {
                    output.Add(p);
                }
            }
            return(output);
        }
コード例 #5
0
        public List <String> GetResourceFiles(String filenames, ExperimentDataSetFold fold)
        {
            var fs = filenames.Split(new char[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList();

            return(GetResourceFiles(fs, fold));
        }