QuickRank  v2.0
QuickRank: A C++ suite of Learning to Rank algorithms
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
quickrank::io::Svml Class Reference

This class implements IO on Svml files. More...

#include <svml.h>

Public Member Functions

 Svml ()
 Creates a new Svml IO reader/writer. More...
 
virtual ~Svml ()
 
virtual std::unique_ptr< data::Datasetread_horizontal (const std::string &file)
 Reads the input dataset and returns in horizontal format. More...
 
virtual void write (std::shared_ptr< data::Dataset >, const std::string &file)
 Write the dataset to an output file. More...
 

Private Member Functions

virtual std::ostream & put (std::ostream &os) const
 Prints the data reading time stats. More...
 

Private Attributes

double reading_time_ = 0.0
 
double processing_time_ = 0.0
 
long file_size_ = 0
 

Friends

std::ostream & operator<< (std::ostream &os, const Svml &me)
 The output stream operator. More...
 

Detailed Description

This class implements IO on Svml files.

SVML format is as follows:

<line> .=. <target> qid:<qid> <feature>:<value> <feature>:<value> ... <feature>:<value> # <info>
<target> .=. <float>
<qid> .=. <positive integer>
<feature> .=. <positive integer>
<value> .=. <float>
<info> .=. <string>
Todo:
TODO: handle feature filtering

Constructor & Destructor Documentation

quickrank::io::Svml::Svml ( )
inline

Creates a new Svml IO reader/writer.

Parameters
kThe cut-off threshold.
virtual quickrank::io::Svml::~Svml ( )
inlinevirtual

Member Function Documentation

std::ostream & quickrank::io::Svml::put ( std::ostream &  os) const
privatevirtual

Prints the data reading time stats.

std::unique_ptr< data::Dataset > quickrank::io::Svml::read_horizontal ( const std::string &  file)
virtual

Reads the input dataset and returns in horizontal format.

Parameters
filethe input filename.
Returns
The svml dataset in horizontal format.
void quickrank::io::Svml::write ( std::shared_ptr< data::Dataset dataset,
const std::string &  file 
)
virtual

Write the dataset to an output file.

Parameters
filethe output filename.
Returns
The svml dataset in horizontal format.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Svml me 
)
friend

The output stream operator.

Prints the data reading time stats.

Member Data Documentation

long quickrank::io::Svml::file_size_ = 0
private
double quickrank::io::Svml::processing_time_ = 0.0
private
double quickrank::io::Svml::reading_time_ = 0.0
private

The documentation for this class was generated from the following files: