Description Usage Arguments Value See Also Examples
View source: R/modelPerformance_Report.R
modelPerformance_Report produces a flexdashboard 
report based on a mt_modelPerformance object.
1 2  | modelPerformance_Report(x, projectLabel = "Model Performance",
  outFile = "./modelPerformance_Report.html", tempDir = ".tempDir")
 | 
x | 
 
  | 
projectLabel | 
 character string; descriptive header for report  | 
outFile | 
 character string; file path/name for saving report (*.html)  | 
tempDir | 
 character string; temporary directory path  | 
No object is returned. The report is saved to the specified location.
modelPerformance, flex_dashboard
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40  | # pull in sample scored data frame
x <- modelSampleScored
str(x)
head(x)
# binary target
# create mt_modelPerformance object
# note that "v" and the "variableImportance..." parms are optional
# in case you do not have a validation set or do not know/care about the variable importance
z <- modelPerformance(
    y = x$TargetFlag,
    yhat = x$pTargetFlag,
    v = x$ValidateFlag
)
modelPerformance_Report(z)
# continuous target
z <- modelPerformance(
    y = x[x$TargetFlag, ]$TargetValue,
    yhat = x[x$TargetFlag, ]$pTargetValue,
    v = x[x$TargetFlag, ]$ValidateFlag,
    gainsChartBarGraph.yType = "dlr",
    gainsChartBarGraph.yDigits = 0
)
modelPerformance_Report(z)
# combined target (with arbitrary variable importance parms)
z <- modelPerformance(
    y = x$TargetFlag,
    yhat = x$pTargetFlag*x$pTargetValue,
    y2 = x$TargetValue,
    v = x$ValidateFlag,
    variableImportanceGraph.x = c(
        "Days Since Last Transaction",
        "Average Order Value",
        "Signed Up Online",
        "Number of Transactions",
        "Tenure",
        "Multi-Category Flag"
    ),
    variableImportanceGraph.y = c(.18, .4, .04, .25, .12, .01)
)
modelPerformance_Report(z)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.