Skip to contents

Trivially wraps ptk_zerosum to project on a feature, usually the output of a benchmark model.

Usage

projection_on_feature(x, y, val_error_fun, feature, ...)

Arguments

x

data as a numeric matrix object (rows=samples). The zero-sum regression requires data on the log scale, i.e. x should be log-transformed data.

y

Named list with entries

  • "bin", a named numeric one-column matrix, binary response to be used for training,

  • "cox", a named numeric two-column matrix to be used for training, time to event and event (0 = censoring, 1 = event) in first and second column, respectively.

  • "true", a named numeric one-column matrix, binary response to be used for calculating the CV error.

val_error_fun

Function used to calculate the error of independently validated predictions. Must take two numeric vector of equal length: y and y_hat, the true and predicted outcomes, respectively, and return a numeric scalar; the lower, the better the model. See error_rate() or neg_roc_auc() for examples.

feature

character. Project on this feature.

...

can be used for adjusting internal parameters

Value

A ptk_zerosum S3 object with the val_predict attribute set to the predictions on the "train" cohort. The benchmark usually has not been trained on this train cohort such that val_predict are predictions on independent data.