Encog.App.Analyst.CSV.Balance.BalanceCSV.Analyze C# (CSharp) 메소드

Analyze() 공개 메소드

Analyze the data. This counts the records and prepares the data to be processed.
public Analyze ( FileInfo inputFile, bool headers, CSVFormat format ) : void
inputFile System.IO.FileInfo The input file to process.
headers bool True, if headers are present.
format Encog.Util.CSV.CSVFormat The format of the CSV file.
리턴 void
        public void Analyze(FileInfo inputFile, bool headers,
                            CSVFormat format)
        {
            InputFilename = inputFile;
            ExpectInputHeaders = headers;
            InputFormat = format;

            Analyzed = true;

            PerformBasicCounts();
        }

Usage Example

예제 #1
0
        public void TestBalanceCSVHeaders()
        {
            GenerateTestFile(true);
            var norm = new BalanceCSV();
            norm.Analyze(InputName, true, CSVFormat.English);
            norm.Process(OutputName, 1, 2);

            var tr = new StreamReader(OutputName.ToString());

            Assert.AreEqual("\"a\",\"b\"", tr.ReadLine());
            Assert.AreEqual("one,1", tr.ReadLine());
            Assert.AreEqual("two,1", tr.ReadLine());
            Assert.AreEqual("four,2", tr.ReadLine());
            Assert.AreEqual("five,2", tr.ReadLine());
            Assert.AreEqual("six,3", tr.ReadLine());
            Assert.AreEqual(2, norm.Counts["1"]);
            Assert.AreEqual(2, norm.Counts["2"]);
            Assert.AreEqual(1, norm.Counts["3"]);
            tr.Close();

            InputName.Delete();
            OutputName.Delete();
        }
All Usage Examples Of Encog.App.Analyst.CSV.Balance.BalanceCSV::Analyze