oob_error(),
oob_predictions(), permuted_importance() and
weighted_importance() used the wrong out-of-bag
observations, because each tree’s bootstrap sample referred to the rows
after they were sorted for training. The OOB error was too low as a
result. The bootstrap samples now refer to the rows in the order
given.model$x, model$y,
fitted() and residuals() follow the order of
the training rows. They used to be sorted by the response, so
fitted() did not line up with the data.predict() errors when new_data has a
different number of columns from the training data. It used to return
predictions computed from mismatched columns.predict() errors when new_data contains
NA, NaN or infinite values. A data frame row
with a missing value used to be dropped silently, so fewer predictions
than rows were returned.pptr() and pprf() error on missing values
in data passed through the formula interface, as they
already did for the matrix interface. Rows with missing values used to
be dropped silently.pptr() and pprf() error on infinite values
in the features.predict() keep every group of
the model as a factor level, including groups that are not
predicted.stop_min_size(), stop_min_variance() and
stop_max_depth() error with a clear message when their
argument is not a single value of the right type, instead of R’s “the
condition has length > 1” or silently truncating a non-integer.predict() accepts a data frame without the response
column for models trained through the formula interface.pptr() and pprf() reject empty data and
list columns with explicit messages.save_json() appends .json to a path
without that suffix, and returns the path it wrote.summary() detects standardized data with a tolerance.pprf(), predict() and the other functions that
pass a forest to C++ faster for forests of many small trees.citation("ppforest2") cites the package and the two
papers describing the method, and ?ppforest2 documents the
package.DESCRIPTION lists the authors of the bundled
nlohmann/json and PCG code as copyright holders, and
inst/COPYRIGHTS gives their copyright and license.summary() on a classification tree or forest now
reports a per-class error rate alongside each confusion matrix, and
prints the overall error rate above the matrix rather than below it. A
class with no observations in the data is shown as - rather
than nan% — this happens when the model predicts a class
that never appears as an actual label, for example when predicting on a
subset of the data.ppforest2.text_edge,
ppforest2.text_tick, ppforest2.text_leaf,
ppforest2.text_proj), and ppforest2.text_scale
multiplies all of them at once for rendering the plot large..00429 / -.0391 / .0259 / .0335 rendered as
.00 / .04 / .03 / .03, merging the two petal terms and
dropping sepal length to zero.pptr() and pprf() no longer abort with the
internal error
Grouping::init: partition must be rooted at row 0 when the
response’s class blocks are contiguous but ordered by decreasing factor
level (for example a two-class factor whose first row is its second
level, or the bundled crab dataset with default
alphabetical levels). The classification path now sorts the response
into ascending group-id order whenever it is not already, matching the
regression path and the command-line tool.hardware_concurrency() may report 0, and a non-positive
OpenMP thread count is undefined behavior.Eigen::indexing::all instead
of Eigen::all, which Eigen 5 no longer accepts as an index,
so the package builds with the upcoming RcppEigen release based on Eigen
5 as well as with the current one based on Eigen 3.4.0.-Wdeprecated-declarations warning reported by
CRAN’s macOS/M1mac additional check (Apple clang 21, macOS 26 SDK). The
newer libc++ deprecates
std::char_traits<unsigned char>, which the vendored
nlohmann/json instantiates through its binary output/stream adapters
(std::basic_string<std::uint8_t> /
std::basic_ostream<std::uint8_t>). ppforest2 does not
use the nlohmann/json binary formats, so the vendored
json.hpp is now bracketed with a _Pragma guard
that suppresses the deprecation. _Pragma (unlike
#pragma) is not flagged by R CMD check’s
pragma check. The guard is applied by make r-vendor-deps
(scripts/vendor-guard-json.sh).Makevars instead of CMake, with no network access or
downloaded dependencies at install time. Eigen is provided by RcppEigen;
nlohmann/json and pcg headers are vendored under
inst/include. This makes the package installable on CRAN’s
offline build machines.EIGEN_NO_AUTOMATIC_RESIZING on all platforms and
EIGEN_DONT_VECTORIZE on Windows.-Wall -Wextra -pedantic).EIGEN_VERSION_AT_LEAST(3, 4, 0) guard
fails the build with a clear message if an incompatible Eigen is
supplied via RcppEigen.make r-vendor-deps re-vendors the committed json/pcg
headers after a version bump.DESCRIPTION uses Authors@R and cites the
projection-pursuit tree and forest references with DOIs.\donttest
with requireNamespace() guards instead of
\dontrun, so they run under --run-donttest
when the suggested packages are available.cran-comments.md. The package passes
R CMD check --as-cran with no errors or warnings; remaining
notes (new submission, cosmetic pragmas in the vendored nlohmann/json
headers) are documented for the reviewer.pptr() and pprf() with formula and matrix
interfaces. Returned models carry an S3 class vector identifying both
model type and mode
(e.g. c("pprf_classification", "pprf", "ppmodel")).predict() returns group labels
(type = "class") or vote proportions
(type = "prob") for classification.oob_error(),
oob_predictions(), oob_samples(),
bag_samples(), permuted_importance(),
weighted_importance() — compute from the training data
stored on the model on first access and memoize in an environment cache,
so training is fast and repeated access is free.
oob_error() is NA_real_ and
oob_predictions() returns a factor with NA for
rows with no OOB tree.summary() displays training and OOB confusion
matrices.save_json() and load_json() for model
persistence. Optional metrics fields use a uniform
null-or-value representation so downstream tooling can
distinguish “computed but empty” from other shapes without
special-casing.pp_tree() and
pp_rand_forest() model specifications.datasets::iris from base R for iris examples.)Regression support is included but untested in production workloads. API surface and defaults may change in future releases.
y is numeric (not a
factor). predict() returns a numeric vector
(type = "response").grouping_by_cutpoint(),
leaf_mean_response(), stop_min_size(),
stop_min_variance(), stop_any(). Training
quantile-slices the continuous response into groups and fits
mean-response leaves.summary() displays MSE / MAE / R² for regression
models, computed for training and out-of-bag predictions; forest OOB
error is reported as MSE. oob_predictions() returns a
numeric vector with NA_real_ for rows with no OOB
tree.save_json() / load_json() preserve
regression mode; parsnip pp_tree() /
pp_rand_forest() accept
mode = "regression".california_housing (20,433 ×
9, predict median_house_value). For smaller regression
examples use datasets::mtcars from base R.