Encog.App.Analyst.CSV.Balance.BalanceCSV.Analyze C# (CSharp) Method

Analyze() public method

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.
return void
        public void Analyze(FileInfo inputFile, bool headers,
                            CSVFormat format)
        {
            InputFilename = inputFile;
            ExpectInputHeaders = headers;
            InputFormat = format;

            Analyzed = true;

            PerformBasicCounts();
        }

Usage Example

コード例 #1
0
ファイル: TestBalanceCSV.cs プロジェクト: jongh0/MTree
        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