tradeModelSummary: Calculates performance across resamples

Description Usage Arguments Value References Examples

View source: R/machineLearning.R

Description

Given two numeric vectors, obs and pred, of data, the performance is calculated.

Usage

1
tradeModelSummary(data, lev = NULL, model = NULL)

Arguments

data

Data.frame. Required. A data frame with columns, obs and pred, for the observed and predicted outcomes. For metrics that rely on class probabilities, such as twoClassSummary, columns should also include predicted probabilities for each class. See the classProbs argument to R CRAN package caret function trainControl.

lev

Character vector of factors levels for the response. In regression cases, this would be NULL. . Default is NULL.

model

String. Default is NULL. Required. A character string for the model name (as taken from the method argument of train).

Value

profit

References

Zachary Mayer, Time series cross-validation 5, January 24, 2013 https://www.r-bloggers.com/2013/01/time-series-cross-validation-5/

Examples

1
2
3
4
5
6
7
8
## Not run: 
options(tradeModelSummaryDots = list(signal.threshold = c(0,0)))

model <- caret::train(dat[,-1], dat[,1], metric="profit", maximize=TRUE,
  trControl = caret::trainControl(summaryFunction = tradeModelSummary)
)

## End(Not run)

AndreMikulec/econModel documentation built on June 30, 2021, 9:48 a.m.