metrics_with_transform: Transform the estimates before calculating metrics

Description Usage Arguments Value Examples

View source: R/utils.R

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

1

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

1
2
3
4
# 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')

ldsr documentation built on May 4, 2020, 5:06 p.m.