PLSSVM - Parallel Least Squares Support Vector Machine
2.0.0
A Least Squares Support Vector Machine implementation using different backends.
|
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. | |
Store the tracked information during calls to plssvm-train
, plssvm-predict
, and plssvm-scale
.
Can be completely disabled during the CMake configuration.
plssvm::detail::performance_tracker::performance_tracker | ( | ) |
@breif Default constructor. Must be implemented in .cpp file.
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.
T | the type of the value the tracking_entry entry encapsulates |
[in] | entry | the entry to add |
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.
[in] | entry | the entry to add |
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.
[in] | entry | the entry to add |
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.
[in] | entry | the entry to add |
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.
[in] | entry | the entry to add |
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.
[in] | entry | the entry to add |
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.
[in] | filename | the file to add the performance tracking results to |
void plssvm::detail::performance_tracker::save | ( | std::ostream & | out | ) |
Write all stored tracking entries to the output stream out
.
[in] | out | the output stream to write the performance tracking results to |
|
noexcept |
Check whether tracking is currently active or paused.
true
if tracking is enabled, false
if it is currently paused ([[nodiscard]]
)
|
noexcept |
Return the currently available tracking entries.
[[nodiscard]]
)