C# Class Encog.App.Analyst.CSV.Balance.BalanceCSV

Balance a CSV file. This utility is useful when you have several an unbalanced training set. You may have a large number of one particular class, and many fewer elements of other classes. This can hinder many Machine Learning methods. This class can be used to balance the data. Obviously this class cannot generate data. You must request how many items you want per class. Some classes will have lower than this number if they were already below the specified amount. Any class above this amount will be trimmed to that amount.
Inheritance: Encog.App.Analyst.CSV.Basic.BasicFile
Exibir arquivo Open project: encog/encog-silverlight-core Class Usage Examples

Public Methods

Method Description
Analyze ( FileInfo inputFile, bool headers, CSVFormat format ) : void

Analyze the data. This counts the records and prepares the data to be processed.

DumpCounts ( ) : String

Return a string that lists the counts per class.

Process ( FileInfo outputFile, int targetField, int countPer ) : void

Process and balance the data.

Method Details

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

DumpCounts() public method

Return a string that lists the counts per class.
public DumpCounts ( ) : String
return String

Process() public method

Process and balance the data.
public Process ( FileInfo outputFile, int targetField, int countPer ) : void
outputFile System.IO.FileInfo The output file to write data to.
targetField int
countPer int The desired count per class.
return void