15#include <unordered_set>
95 requires(std::is_floating_point_v<T>)
114 template <
typename T>
136 template <
typename T>
159 template <
typename T>
160 requires(std::is_floating_point_v<T>)
211 std::filesystem::path _path;
215 static std::map<size_t, std::unordered_set<std::string>>
220 const std::map<
size_t, std::unordered_set<std::string>> &
lookups_map);
229 using std::runtime_error::runtime_error;
A container for managing training, evaluation, and test data splits.
static LoggerConsole & instance()
Access the singleton instance.
Abstract base class for logging subsystems.
Exceptions concerning txeo::MatrixIO.
A class to read file data to matrix and to write file data to a matrix.
MatrixIO(const std::filesystem::path &path, char separator=',', txeo::Logger &logger=txeo::LoggerConsole::instance())
Constructs MatrixIO object.
void write_text_file(const txeo::Matrix< T > &matrix, size_t precision) const
Writes a floating-point matrix with specified precision to a text file.
void write_text_file(const txeo::Matrix< T > &matrix) const
Writes a matrix to a text file.
std::filesystem::path path() const
static void write_textfile(const txeo::Matrix< T > &matrix, const std::filesystem::path &path, char separator=',')
Writes a matrix to a text file.
static txeo::MatrixIO one_hot_encode_text_file(const std::filesystem::path &source_path, char separator, bool has_header, const std::filesystem::path &target_path, txeo::Logger &logger=txeo::LoggerConsole::instance())
Performs one-hot encoding in all non-numeric columns in a text file and writes the result to a target...
txeo::Matrix< T > read_text_file(bool has_header=false) const
Returns a matrix with elements read from a text file.
static txeo::Matrix< T > read_textfile(const std::filesystem::path &path, char separator=',', bool has_header=false)
Returns a matrix with elements read from a text file.
static void write_textfile(const txeo::Matrix< T > &matrix, size_t precision, const std::filesystem::path &path, char separator=',')
Writes a floating-point matrix with specified precision to a text file.