Package 'perpetual'

Title: PerpetualBooster
Description: A self-generalizing gradient boosting machine that doesn't need hyperparameter optimization.
Authors: Mutlu Simsek [aut, cre], Serkan Korkmaz [aut], Pieter Pel [aut]
Maintainer: Mutlu Simsek <[email protected]>
License: Apache License (== 2.0)
Version: 2.1.0
Built: 2026-06-04 06:35:48 UTC
Source: https://github.com/perpetual-ml/perpetual

Help Index


Train a PerpetualBooster model

Description

Perpetual is a self-generalizing gradient boosting machine that doesn't need hyperparameter optimization. It automatically finds the best configuration based on the provided budget.

Usage

perpetual(
  x,
  y,
  objective = "LogLoss",
  budget = NULL,
  iteration_limit = NULL,
  stopping_rounds = NULL,
  max_bin = NULL,
  num_threads = NULL,
  missing = NULL,
  allow_missing_splits = NULL,
  create_missing_branch = NULL,
  missing_node_treatment = NULL,
  log_iterations = NULL,
  quantile = NULL,
  reset = NULL,
  timeout = NULL,
  memory_limit = NULL,
  seed = NULL,
  calibration_method = NULL,
  save_node_stats = NULL,
  ...
)

Arguments

x

A matrix or data.frame of features.

y

A vector of targets (numeric for regression, factor/integer for classification).

objective

A string specifying the objective function. Default is "LogLoss".

budget

A numeric value ensuring the training time does not exceed this budget (in normalized units).

iteration_limit

An integer limit on the number of iterations.

stopping_rounds

An integer for early stopping.

max_bin

Integer, max number of bins for histograms.

num_threads

Integer, number of threads to use.

missing

Value to consider as missing data. Default is NaN.

allow_missing_splits

Boolean.

create_missing_branch

Boolean. Whether to create a separate branch for missing values (ternary trees).

missing_node_treatment

String. How to handle weights for missing nodes if create_missing_branch is True. Options: "None", "AssignToParent", "AverageLeafWeight", "AverageNodeWeight".

log_iterations

Integer.

quantile

Numeric.

reset

Boolean.

timeout

Numeric.

memory_limit

Numeric.

seed

Integer seed for reproducibility.

calibration_method

String specifying the calibration method for prediction intervals. Options: "WeightVariance", "MinMax", "GRP", "Conformal".

save_node_stats

Boolean. Whether to save node statistics (required for some calibration methods and importance types).

...

Additional arguments.

Value

A PerpetualBooster object.


Get the base score of the model

Description

Get the base score of the model

Usage

perpetual_base_score(model)

Arguments

model

A PerpetualBooster object.

Value

Numeric, base score.


Calibrate a PerpetualBooster model

Description

Calibrate a PerpetualBooster model

Usage

perpetual_calibrate(model, x, y, x_cal, y_cal, alpha, method = NULL)

Arguments

model

A PerpetualBooster object.

x

Validation features.

y

Validation targets.

x_cal

Calibration features.

y_cal

Calibration targets.

alpha

Calibration parameter.

method

String specifying the calibration method to use. If NULL, uses the method configured in the model.


Get feature importance

Description

Get feature importance

Usage

perpetual_importance(model, method = "gain", normalize = TRUE)

Arguments

model

A PerpetualBooster object.

method

String, method for importance (e.g. "gain").

normalize

Boolean.

Value

A named vector of importances.


Load a PerpetualBooster model

Description

Load a PerpetualBooster model

Usage

perpetual_load(path)

Arguments

path

String, path to the saved model.

Value

A PerpetualBooster object.


Get the number of trees in the model

Description

Get the number of trees in the model

Usage

perpetual_n_trees(model)

Arguments

model

A PerpetualBooster object.

Value

Integer, number of trees.


Save a PerpetualBooster model

Description

Save a PerpetualBooster model

Usage

perpetual_save(model, path)

Arguments

model

A PerpetualBooster object.

path

String, path to save the model.


Dump model to JSON string

Description

Dump model to JSON string

Usage

perpetual_to_json(model)

Arguments

model

A PerpetualBooster object.

Value

String, JSON representation of the model.


PerpetualBooster

Description

PerpetualBooster object for creating and loading models.

Usage

PerpetualBooster

Format

An object of class list of length 2.


Predict using a PerpetualBooster model

Description

Predict using a PerpetualBooster model

Usage

## S3 method for class 'PerpetualBooster'
predict(
  object,
  newdata,
  type = c("class", "prob", "raw", "contribution", "interval"),
  method = "average",
  ...
)

Arguments

object

A PerpetualBooster object.

newdata

A matrix or data.frame of new data to predict on.

type

Type of prediction: "class", "prob", "raw", "contribution", or "interval".

method

Method for prediction contributions. Default "average".

...

Additional arguments.

Value

A vector or matrix of predictions.


Print PerpetualBooster

Description

Print PerpetualBooster

Usage

## S3 method for class 'PerpetualBooster'
print(x, ...)

Arguments

x

A PerpetualBooster object.

...

Additional arguments.