metrics_with_transform {ldsr}R Documentation

Transform the estimates before calculating metrics

Description

If you already ran the cross-validation on transformed output and now wanted to calculate performance on the back-transformed one, or vice-versa, you don't have to rerun the whole cross-validation, but just need to transform or back-transform the cross-validation Ycv. This function helps you do that.

Usage

metrics_with_transform(cv, transform, lambda = NULL)

Arguments

cv

Cross-validation output as produced by cvLDS or cvPCR

transform

Either "log", "exp", "boxcox" or "inv_boxcox"

lambda

Lambda value used in Box-Cox or inverse Box-Cox

Value

A new cv object wit hthe new metrics

Examples

# Cross-validate with log-transform
cv <- cvPCR(NPannual, NPpc, start.year = 1200, transform = 'log', metric.space = 'transformed')
# Calculate metrics based on back-transformed values
m <- metrics_with_transform(cv, 'exp')

[Package ldsr version 0.0.2 Index]