Ejemplo n.º 1
0
        public void LoadFromDataSetFile(string fileName, int maxParallelThreads)
        {
            CSVOperations csv = new CSVOperations();
            FileData      fd  = csv.Read(fileName, maxParallelThreads);

            //Shallow Copy of Data
            _trainingData         = fd.values;// new double[fd.attributeHeaders.Length][];
            _attributeHeaders     = fd.attributeHeaders;
            _indexTargetAttribute = fd.attributeHeaders.Length - 1;
        }
Ejemplo n.º 2
0
        public void CSV_file_read_invalid_2_raises_exception()
        {
            IFileOperations csvOps = new CSVOperations();
            string          path   = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;

            path = path + "\\CSVReadInvalid2Test.csv";
            FileData fd;

            fd = csvOps.Read(path, -1);
        }
Ejemplo n.º 3
0
        public void CSV_file_read()
        {
            IFileOperations csvOps = new CSVOperations();
            string          path   = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;

            path = path + "\\CSVReadTest.csv";
            FileData fd;

            try
            {
                fd = csvOps.Read(path, -1);
            }
            catch
            {
                Assert.Fail();
                return;
            }
            Assert.AreEqual(fd.attributeHeaders.Length, 3);
            Assert.AreEqual(fd.values[0].Length, 31);
        }