10#include <nlohmann/json.hpp>
47 void write_file(nlohmann::json
const& data, std::string
const& path);
void write(stats::DataPacket const &data, std::string const &filename)
Write a DataPacket to a CSV file (features followed by label, no header).
stats::DataPacket read_sorted(std::string const &filename)
Read a CSV file and sort rows so that response groups are contiguous.
stats::DataPacket read(std::string const &filename)
Read a CSV file into a DataPacket.
nlohmann::json read_file(std::string const &path)
Read a JSON file and parse its contents.
std::string ensure_extension(std::string const &path)
Ensure a file path ends with the ".json" extension.
void write_file(nlohmann::json const &data, std::string const &path)
Write a JSON object to a file (pretty-printed with indent 2).
void check_dir_not_exists(std::string const &path)
Exit with an error if a directory already exists at the given path.
void check_file_not_exists(std::string const &path)
Exit with an error if a file already exists at the given path.
Bundled dataset: features, responses, and group labels.
Definition DataPacket.hpp:18