Example #1
0
        public bool buildSVMCorpus(string filename)
        {
            string trainDataPath = filename + "TrainSVM.txt";

            if (File.Exists(trainDataPath))
            {
                _prob = ProblemHelper.ReadProblem(trainDataPath);
                _test = ProblemHelper.ScaleProblem(_prob);
                svm   = new C_SVC(_test, KernelHelper.LinearKernel(), C);
                ProblemHelper.WriteProblem(filename + "output.txt", _test);
                fileExistance = true;
            }
            return(fileExistance);
        }
        /// <summary>
        ///Test pour WriteProblem
        ///</summary>
        //[TestMethod()]
        public void WriteProblemTest()
        {
            string full_test_path = System.IO.Path.Combine(base_path, TEST_FILE);
            var    prob           = ProblemHelper.ReadProblem(full_test_path);

            string full_write_path = System.IO.Path.Combine(base_path, WRITE_FILE);

            if (File.Exists(full_write_path))
            {
                File.Delete(full_write_path);
            }

            ProblemHelper.WriteProblem(full_write_path, prob);
            Assert.IsTrue(File.Exists(full_write_path));
            File.Delete(full_write_path); // cleaunp after test succeeded
        }