predict_pathofmpred_object: Apply a user-created PathoFMPred object

View source: R/predict.R

predict_pathofmpred_objectR Documentation

Apply a user-created PathoFMPred object

Description

This function applies an object returned by [create_pathofmpred_object()]. It is the supported inference route for locally constructed TITAN objects and for future foundation-model representations that are not distributed by the package. Repeated feature rows are pooled using the aggregation rule recorded when the object was created, unless 'aggregation' is supplied.

Usage

predict_pathofmpred_object(
  object,
  features,
  patient_id = NULL,
  id_column = NULL,
  outcome_type = c("continuous", "binary"),
  endpoints = NULL,
  aggregation = NULL,
  warn_ood = TRUE
)

Arguments

object

A 'PathoFMPredObject' or the path to an '.rds' file containing one.

features

A data frame or matrix containing the named features used to fit 'object'. An identifier column may be selected with 'id_column'.

patient_id

Optional identifier per feature row. Use either 'patient_id' or 'id_column', not both. Repeated identifiers are pooled.

id_column

Optional identifier-column name in 'features'.

outcome_type

One or both of 'continuous' and 'binary'.

endpoints

Optional endpoint names to apply.

aggregation

Optional 'mean' or 'median' override. By default the object's model-development aggregation is used.

warn_ood

Warn when more than 5 percent of dimensions are outside the fitted training range.

Value

A long data frame with one row per patient and fitted endpoint. Binary outputs include the original event-class label. Scores are uncalibrated and are not probabilities.


PathoFMPred documentation built on Nov. 12, 2026, 5:10 p.m.