|
ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
|
Functions | |
| stats::DataPacket | read (std::string const &filename) |
| Read a CSV file into a DataPacket. | |
| stats::DataPacket | read_sorted (std::string const &filename) |
| Read a CSV file and sort rows so that response groups are contiguous. | |
| 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 ppforest2::io::csv::read | ( | std::string const & | filename | ) |
Read a CSV file into a DataPacket.
Assumes the last column is the response variable (group label as string) and all preceding columns are features. Categorical feature columns are automatically detected and integer-encoded. String labels are mapped to contiguous integer codes starting at 0.
| filename | Path to the CSV file. |
| std::runtime_error | If the file is empty or has inconsistent columns. |
| stats::DataPacket ppforest2::io::csv::read_sorted | ( | std::string const & | filename | ) |
Read a CSV file and sort rows so that response groups are contiguous.
Calls read() and then sorts the data if the response vector is not already contiguous, as required by the training routines.
| filename | Path to the CSV file. |
| 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).
| data | The DataPacket to write. |
| filename | Output file path. |