C# Class Accord.IO.SparseReader

Reader for data files containing samples in libsvm's sparse format.
Inheritance: IDisposable
Show file Open project: accord-net/framework Class Usage Examples

Public Methods

Method Description
Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

ReadDense ( ) : double>.Tuple

Reads a sample from the file and returns it as a dense vector, together with its associated output value.

ReadDense ( int count ) : double[]>.Tuple

Reads count samples from the file and returns them as a Sparse{T} sparse vector, together with their associated output values.

ReadDenseToEnd ( ) : double[]>.Tuple

Reads all samples from the file and returns them as a dense vector, together with their associated output values.

ReadLine ( ) : string>.Tuple

Reads one line from the feature file, returning the array of values for the sparse vector and its corresponding label.

ReadSparse ( ) : double>.Tuple

Reads a sample from the file and returns it as a Sparse{T} sparse vector, together with its associated output value.

ReadSparse ( int count ) : double[]>.Tuple[]

Reads count samples from the file and returns them as a Sparse{T} sparse vector, together with their associated output values.

ReadSparseToEnd ( ) : double[]>.Tuple[]

Reads all samples from the file and returns them as a Sparse{T} sparse vector, together with their associated output values.

SparseReader ( Stream stream ) : Accord.Math

Initializes a new instance of the SparseReader class.

SparseReader ( Stream stream, Encoding encoding ) : Accord.Math

Initializes a new instance of the SparseReader class.

SparseReader ( Stream stream, Encoding encoding, int sampleSize ) : Accord.Math

Initializes a new instance of the SparseReader class.

SparseReader ( Stream stream, int sampleSize ) : Accord.Math

Initializes a new instance of the SparseReader class.

SparseReader ( StreamReader reader ) : Accord.Math

Initializes a new instance of the SparseReader class.

SparseReader ( StreamReader reader, int sampleSize ) : Accord.Math

Initializes a new instance of the SparseReader class.

SparseReader ( String path, Encoding encoding ) : Accord.Math

Initializes a new instance of the SparseReader class.

SparseReader ( String path, Encoding encoding, int sampleSize ) : Accord.Math

Initializes a new instance of the SparseReader class.

SparseReader ( string path ) : Accord.Math

Initializes a new instance of the SparseReader class.

SparseReader ( string path, int sampleSize ) : Accord.Math

Initializes a new instance of the SparseReader class.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Releases unmanaged and - optionally - managed resources

Private Methods

Method Description
guessSampleSize ( ) : int

Method Details

Dispose() public method

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
return void

Dispose() protected method

Releases unmanaged and - optionally - managed resources
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged /// resources; false to release only unmanaged resources.
return void

ReadDense() public method

Reads a sample from the file and returns it as a dense vector, together with its associated output value.
public ReadDense ( ) : double>.Tuple
return double>.Tuple

ReadDense() public method

Reads count samples from the file and returns them as a Sparse{T} sparse vector, together with their associated output values.
public ReadDense ( int count ) : double[]>.Tuple
count int The number of samples to read.
return double[]>.Tuple

ReadDenseToEnd() public method

Reads all samples from the file and returns them as a dense vector, together with their associated output values.
public ReadDenseToEnd ( ) : double[]>.Tuple
return double[]>.Tuple

ReadLine() public method

Reads one line from the feature file, returning the array of values for the sparse vector and its corresponding label.
public ReadLine ( ) : string>.Tuple
return string>.Tuple

ReadSparse() public method

Reads a sample from the file and returns it as a Sparse{T} sparse vector, together with its associated output value.
public ReadSparse ( ) : double>.Tuple
return double>.Tuple

ReadSparse() public method

Reads count samples from the file and returns them as a Sparse{T} sparse vector, together with their associated output values.
public ReadSparse ( int count ) : double[]>.Tuple[]
count int The number of samples to read.
return double[]>.Tuple[]

ReadSparseToEnd() public method

Reads all samples from the file and returns them as a Sparse{T} sparse vector, together with their associated output values.
public ReadSparseToEnd ( ) : double[]>.Tuple[]
return double[]>.Tuple[]

SparseReader() public method

Initializes a new instance of the SparseReader class.
public SparseReader ( Stream stream ) : Accord.Math
stream Stream The file stream to be read.
return Accord.Math

SparseReader() public method

Initializes a new instance of the SparseReader class.
public SparseReader ( Stream stream, Encoding encoding ) : Accord.Math
stream Stream The file stream to be read.
encoding System.Text.Encoding The character encoding to use.
return Accord.Math

SparseReader() public method

Initializes a new instance of the SparseReader class.
public SparseReader ( Stream stream, Encoding encoding, int sampleSize ) : Accord.Math
stream Stream The file stream to be read.
encoding System.Text.Encoding The character encoding to use.
sampleSize int The size of the feature vectors stored in the file.
return Accord.Math

SparseReader() public method

Initializes a new instance of the SparseReader class.
public SparseReader ( Stream stream, int sampleSize ) : Accord.Math
stream Stream The file stream to be read.
sampleSize int The size of the feature vectors stored in the file.
return Accord.Math

SparseReader() public method

Initializes a new instance of the SparseReader class.
public SparseReader ( StreamReader reader ) : Accord.Math
reader System.IO.StreamReader A StreamReader containing the file to be read.
return Accord.Math

SparseReader() public method

Initializes a new instance of the SparseReader class.
public SparseReader ( StreamReader reader, int sampleSize ) : Accord.Math
reader System.IO.StreamReader A StreamReader containing the file to be read.
sampleSize int The size of the feature vectors stored in the file.
return Accord.Math

SparseReader() public method

Initializes a new instance of the SparseReader class.
public SparseReader ( String path, Encoding encoding ) : Accord.Math
path String The complete file path to be read.
encoding System.Text.Encoding The character encoding to use.
return Accord.Math

SparseReader() public method

Initializes a new instance of the SparseReader class.
public SparseReader ( String path, Encoding encoding, int sampleSize ) : Accord.Math
path String The complete file path to be read.
encoding System.Text.Encoding The character encoding to use.
sampleSize int The size of the feature vectors stored in the file.
return Accord.Math

SparseReader() public method

Initializes a new instance of the SparseReader class.
public SparseReader ( string path ) : Accord.Math
path string The complete file path to be read.
return Accord.Math

SparseReader() public method

Initializes a new instance of the SparseReader class.
public SparseReader ( string path, int sampleSize ) : Accord.Math
path string The complete file path to be read.
sampleSize int The size of the feature vectors stored in the file.
return Accord.Math