|
ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
|
Namespaces | |
| namespace | csv |
| namespace | json |
| namespace | layout |
| Column-driven table formatting with ANSI-safe alignment. | |
| namespace | style |
| TTY-aware ANSI colored output utilities. | |
Classes | |
| struct | ConfigDisplayHints |
| Optional display hints for print_configuration. More... | |
| struct | ModelStats |
| Aggregated statistics across multiple training iterations. More... | |
| struct | Output |
| Quiet-aware, indentation-aware output context. More... | |
| class | TempDir |
| RAII temporary directory with automatic cleanup. More... | |
| class | TempFile |
| RAII temporary file with automatic cleanup. More... | |
Functions | |
| 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. | |
| template<typename F> | |
| auto | measure_time_ms (F &&f) |
| Measure the wall-clock execution time of a callable in milliseconds. | |
| std::string | now_iso8601 () |
| Return the current local time as an ISO 8601 string (YYYY-MM-DDTHH:MM:SS). | |
| void | print_configuration (Output &out, nlohmann::json const &config, ConfigDisplayHints const &hints={}) |
| Print model configuration table from a JSON config object. | |
| void | print_confusion_matrix (Output &out, stats::ConfusionMatrix const &cm, std::string const &title="Confusion Matrix", std::vector< std::string > const &group_names={}) |
| Print a formatted confusion matrix to stdout. | |
| void | print_data_summary (Output &out, nlohmann::json const &meta) |
| Print a data summary table from a JSON meta object. | |
| void | print_results (Output &out, ModelStats const &stats) |
| Print evaluation results (timing, errors, memory) to stdout. | |
| void | print_summary (Output &out, nlohmann::json const &model_data, ConfigDisplayHints const &hints={}) |
| Display a full model summary from its JSON representation. | |
| void | print_variable_importance (Output &out, VariableImportance const &vi, std::vector< std::string > const &feature_names={}, int max_rows=20) |
| Print a ranked variable importance table to stdout. | |
| void ppforest2::io::check_dir_not_exists | ( | std::string const & | path | ) |
Exit with an error if a directory already exists at the given path.
| path | The directory path to check. |
| void ppforest2::io::check_file_not_exists | ( | std::string const & | path | ) |
Exit with an error if a file already exists at the given path.
| path | The file path to check. |
| auto ppforest2::io::measure_time_ms | ( | F && | f | ) |
Measure the wall-clock execution time of a callable in milliseconds.
| F | A callable (lambda, function pointer, std::function, etc.) |
| f | The callable to time. |
|
inline |
Return the current local time as an ISO 8601 string (YYYY-MM-DDTHH:MM:SS).
| void ppforest2::io::print_configuration | ( | Output & | out, |
| nlohmann::json const & | config, | ||
| ConfigDisplayHints const & | hints = {} ) |
Print model configuration table from a JSON config object.
| out | Output context. |
| config | The config JSON (trees, lambda, seed, threads, vars, data). |
| hints | Optional display hints for richer output (defaults, percentages). |
| void ppforest2::io::print_confusion_matrix | ( | Output & | out, |
| stats::ConfusionMatrix const & | cm, | ||
| std::string const & | title = "Confusion Matrix", | ||
| std::vector< std::string > const & | group_names = {} ) |
Print a formatted confusion matrix to stdout.
Displays the confusion matrix with group labels, diagonal highlighting, and per-group error rates.
| out | Output context. |
| cm | The confusion matrix to print. |
| void ppforest2::io::print_data_summary | ( | Output & | out, |
| nlohmann::json const & | meta ) |
Print a data summary table from a JSON meta object.
Shows observations, features, groups, and group names.
| out | Output context. |
| meta | The meta JSON (observations, features, groups). |
| void ppforest2::io::print_results | ( | Output & | out, |
| ModelStats const & | stats ) |
Print evaluation results (timing, errors, memory) to stdout.
| stats | The aggregated model statistics. |
| void ppforest2::io::print_summary | ( | Output & | out, |
| nlohmann::json const & | model_data, | ||
| ConfigDisplayHints const & | hints = {} ) |
Display a full model summary from its JSON representation.
Shows configuration, data summary, training/OOB confusion matrices, degenerate warnings, timing, and variable importance. Used by both run_train (after training) and run_summarize (from file).
| void ppforest2::io::print_variable_importance | ( | Output & | out, |
| VariableImportance const & | vi, | ||
| std::vector< std::string > const & | feature_names = {}, | ||
| int | max_rows = 20 ) |
Print a ranked variable importance table to stdout.
Columns: rank, variable name, sigma (scale), VI2 (projections), VI3 (weighted), VI1 (permuted). Rows are sorted by VI2 descending. The VI1 column is omitted when its vector is empty. At most max_rows rows are printed.
| out | Output context. |
| vi | Variable importance results. |
| max_rows | Maximum number of rows to print (0 = all). |