|
ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
|
File I/O utilities, JSON and CSV reading/writing. More...
#include "stats/DataPacket.hpp"#include "utils/Invariant.hpp"#include <nlohmann/json.hpp>#include <string>Go to the source code of this file.
Classes | |
| struct | ppforest2::io::csv::FeatureSet |
| Result of parsing a feature-only CSV (no response column). More... | |
Namespaces | |
| namespace | ppforest2 |
| Binarization strategies for multiclass-to-binary reduction. | |
| namespace | ppforest2::io |
| namespace | ppforest2::io::csv |
| namespace | ppforest2::io::json |
| namespace | ppforest2::io::text |
Typedefs | |
| using | ppforest2::io::ErrorHandler = void (*)(bool, std::string const&) |
Functions | |
| void | ppforest2::io::check_dir_not_exists (std::string const &path) |
| Exit with an error if a directory already exists at the given path. | |
| void | ppforest2::io::check_file_exists (std::string const &path) |
| Exit with an error if a file does not exist at the given path. | |
| void | ppforest2::io::check_file_not_exists (std::string const &path) |
| Exit with an error if a file already exists at the given path. | |
| std::string | ppforest2::io::json::ensure_extension (std::string const &path) |
| Ensure a file path ends with the ".json" extension. | |
| stats::DataPacket | ppforest2::io::csv::read (std::string const &filename) |
| Read a CSV file into a DataPacket. | |
| FeatureSet | ppforest2::io::csv::read_features_from_string (std::string const &content) |
| Parse a feature-only CSV from an in-memory string. | |
| nlohmann::json | ppforest2::io::json::read_file (std::string const &path, ErrorHandler on_error=invariant) |
| Read a JSON file and parse its contents. | |
| stats::DataPacket | ppforest2::io::csv::read_sorted (std::string const &filename) |
| Read a CSV file and sort rows ascending by the response column. | |
| void | ppforest2::io::csv::write (stats::DataPacket const &data, std::string const &filename) |
| Write a DataPacket to a CSV file (features followed by label, no header). | |
| void | ppforest2::io::json::write_file (nlohmann::json const &data, std::string const &path, ErrorHandler on_error=invariant) |
| Write a JSON object to a file (pretty-printed with indent 2). | |
| void | ppforest2::io::text::write_file (std::string const &content, std::string const &path, ErrorHandler on_error=invariant) |
| Write a string to a file. | |
File I/O utilities, JSON and CSV reading/writing.