predict.pprf_classification: Predicts labels or vote proportions from a pprf model...

View source: R/pprf.R

predict.pprf_classificationR Documentation

Predicts labels or vote proportions from a pprf model (classification mode).

Description

Predicts labels or vote proportions from a pprf model (classification mode).

Usage

## S3 method for class 'pprf_classification'
predict(object, new_data = NULL, type = NULL, ...)

Arguments

object

A pprf_classification model.

new_data

A data frame or matrix of new observations. If NULL, the first positional argument in ... is used for backward compatibility.

type

The type of prediction: "class" (default) returns a factor of predicted labels, "prob" returns a data frame of vote proportions.

...

For backward compatibility, the first positional argument is treated as new_data when new_data is NULL.

Value

If type = "class", a factor of predicted labels. If type = "prob", a data frame with one column per group, each row summing to 1.

See Also

pprf, predict.pprf_regression

Examples

model <- pprf(Species ~ ., data = iris)
predict(model, iris)
predict(model, iris, type = "prob")

ppforest2 documentation built on July 21, 2026, 9:07 a.m.