PLSSVM - Parallel Least Squares Support Vector Machine  2.0.0
A Least Squares Support Vector Machine implementation using different backends.
Public Member Functions | Private Attributes | List of all members
plssvm::detail::performance_tracker Class Reference

Store the tracked information during calls to plssvm-train, plssvm-predict, and plssvm-scale. More...

#include <performance_tracker.hpp>

Public Member Functions

 performance_tracker ()
 
 ~performance_tracker ()
 Default destructor. Must be implemented in .cpp file.
 
template<typename T >
void add_tracking_entry (const tracking_entry< T > &entry)
 Add a tracking_entry to this performance tracker. More...
 
void add_tracking_entry (const tracking_entry< std::string > &entry)
 Add a tracking_entry encapsulating a std::string to this performance tracker. More...
 
void add_tracking_entry (const tracking_entry<::plssvm::parameter > &entry)
 Add a tracking_entry encapsulating a plssvm::parameter to this performance tracker. More...
 
void add_tracking_entry (const tracking_entry< cmd::parser_train > &entry)
 Add a tracking_entry encapsulating a plssvm::detail::cmd::parser_train to this performance tracker. More...
 
void add_tracking_entry (const tracking_entry< cmd::parser_predict > &entry)
 Add a tracking_entry encapsulating a plssvm::detail::cmd::parser_predict to this performance tracker. More...
 
void add_tracking_entry (const tracking_entry< cmd::parser_scale > &entry)
 Add a tracking_entry encapsulating a plssvm::detail::cmd::parser_scale to this performance tracker. More...
 
void save (const std::string &filename)
 Write all stored tracking entries to the YAML file filename. More...
 
void save (std::ostream &out)
 Write all stored tracking entries to the output stream out. More...
 
void pause_tracking () noexcept
 Pause the current tracking, i.e., all calls to add_tracking_entry do nothing.
 
void resume_tracking () noexcept
 Resume the tracking, i.e., all calls to add_tracking_entry do track the values again.
 
bool is_tracking () noexcept
 Check whether tracking is currently active or paused. More...
 
const std::unordered_multimap< std::string, std::string > & get_tracking_entries () noexcept
 Return the currently available tracking entries. More...
 

Private Attributes

std::unordered_multimap< std::string, std::string > tracking_statistics {}
 All performance statistics grouped by their specified categories.
 
bool is_tracking_ { true }
 The tracking is enabled by default.
 

Detailed Description

Store the tracked information during calls to plssvm-train, plssvm-predict, and plssvm-scale.

Can be completely disabled during the CMake configuration.

Constructor & Destructor Documentation

◆ performance_tracker()

plssvm::detail::performance_tracker::performance_tracker ( )

@breif Default constructor. Must be implemented in .cpp file.

Member Function Documentation

◆ add_tracking_entry() [1/6]

template<typename T >
void plssvm::detail::performance_tracker::add_tracking_entry ( const tracking_entry< T > &  entry)

Add a tracking_entry to this performance tracker.

Saves a string containing the entry name and value in a map with the entry category as key.

Template Parameters
Tthe type of the value the tracking_entry entry encapsulates
Parameters
[in]entrythe entry to add

◆ add_tracking_entry() [2/6]

void plssvm::detail::performance_tracker::add_tracking_entry ( const tracking_entry< std::string > &  entry)

Add a tracking_entry encapsulating a std::string to this performance tracker.

Saves a string containing the entry name and value in a map with the entry category as key. Adds quotes around the entry's value.

Parameters
[in]entrythe entry to add

◆ add_tracking_entry() [3/6]

void plssvm::detail::performance_tracker::add_tracking_entry ( const tracking_entry<::plssvm::parameter > &  entry)

Add a tracking_entry encapsulating a plssvm::parameter to this performance tracker.

Saves a string containing the entry name and value in a map with the entry category as key. Adds all values stored in the plssvm::parameter as tracking entries.

Parameters
[in]entrythe entry to add

◆ add_tracking_entry() [4/6]

void plssvm::detail::performance_tracker::add_tracking_entry ( const tracking_entry< cmd::parser_train > &  entry)

Add a tracking_entry encapsulating a plssvm::detail::cmd::parser_train to this performance tracker.

Saves a string containing the entry name and value in a map with the entry category as key. Adds all values stored in the plssvm::detail::cmd::parser_train as tracking entries.

Parameters
[in]entrythe entry to add

◆ add_tracking_entry() [5/6]

void plssvm::detail::performance_tracker::add_tracking_entry ( const tracking_entry< cmd::parser_predict > &  entry)

Add a tracking_entry encapsulating a plssvm::detail::cmd::parser_predict to this performance tracker.

Saves a string containing the entry name and value in a map with the entry category as key. Adds all values stored in the plssvm::detail::cmd::parser_predict as tracking entries.

Parameters
[in]entrythe entry to add

◆ add_tracking_entry() [6/6]

void plssvm::detail::performance_tracker::add_tracking_entry ( const tracking_entry< cmd::parser_scale > &  entry)

Add a tracking_entry encapsulating a plssvm::detail::cmd::parser_scale to this performance tracker.

Saves a string containing the entry name and value in a map with the entry category as key. Adds all values stored in the plssvm::detail::cmd::parser_scale as tracking entries.

Parameters
[in]entrythe entry to add

◆ save() [1/2]

void plssvm::detail::performance_tracker::save ( const std::string &  filename)

Write all stored tracking entries to the YAML file filename.

Appends all entries at the end of the file creating a new YAML document. If filename is empty, dumps the tracking entries to std::cout instead.

Parameters
[in]filenamethe file to add the performance tracking results to

◆ save() [2/2]

void plssvm::detail::performance_tracker::save ( std::ostream &  out)

Write all stored tracking entries to the output stream out.

Parameters
[in]outthe output stream to write the performance tracking results to

◆ is_tracking()

bool plssvm::detail::performance_tracker::is_tracking ( )
noexcept

Check whether tracking is currently active or paused.

Returns
true if tracking is enabled, false if it is currently paused ([[nodiscard]])

◆ get_tracking_entries()

const std::unordered_multimap<std::string, std::string>& plssvm::detail::performance_tracker::get_tracking_entries ( )
noexcept

Return the currently available tracking entries.

Returns
the previously added tracking entries ([[nodiscard]])

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