create_pathofmpred_object: Build a portable PathoFMPred model collection

View source: R/create_object.R

create_pathofmpred_objectR Documentation

Build a portable PathoFMPred model collection

Description

Feature and outcome tables are linked only through 'id_column'. Outcome IDs must be unique. Feature IDs may repeat, for example when a patient has more than one slide, and are pooled before model development.

Usage

create_pathofmpred_object(
  feature_table,
  outcome_table,
  id_column,
  aggregation = c("mean", "median"),
  foundation_model = "custom",
  feature_columns = NULL,
  outcome_columns = NULL,
  outcome_types = NULL,
  positive_class = NULL,
  control = pathofmpred_control(),
  output_file = NULL
)

Arguments

feature_table

Data frame, matrix, or CSV path containing identifiers and numeric foundation-model features.

outcome_table

Data frame or CSV path containing one unique row per identifier and one or more outcomes.

id_column

Name of the identifier column present in both tables.

aggregation

How repeated feature rows are pooled: 'mean' or 'median'.

foundation_model

Label stored in the resulting object.

feature_columns

Optional numeric feature columns. By default all columns except 'id_column' are used.

outcome_columns

Optional outcomes to fit. By default all columns except 'id_column' are considered.

outcome_types

Optional named character vector containing 'continuous' or 'binary'. Otherwise numeric two-level outcomes are binary and other numeric outcomes are continuous.

positive_class

Event-class label for binary outcomes. Supply either one value when fitting a single binary outcome or a named character vector keyed by endpoint. Zero/one and FALSE/TRUE outcomes default to one and TRUE; all other binary labels require an explicit value.

control

Settings created by [pathofmpred_control()].

output_file

Optional '.rds' destination.

Value

A 'PathoFMPredObject' containing fitted models, a registry, nested-CV summaries, and a linkage/missingness audit.


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