knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(rtichoke)

Naming Convention

library(magrittr)

tibble::tribble(
  ~"Output", ~"Predictions and Outcomes", ~"Performance Data",
  "Performance Data", "`prepare_performance_data()`", "",
  "ROC", "`create_roc_curve()`", "`plot_roc_curve()`",
  "Lift", "`create_lift_curve()`", "`plot_lift_curve()`",
  "Gains", "`create_gains_curve()`", "`plot_gains_curve()`",
  "Precision Recall", "`create_precision_recall_curve()`", "`plot_precision_recall_curve()`",
  "Decision", "`create_decision_curve()`", "`plot_decision_curve()`",
  "Calibration", "`create_calibration_curve()`", "",
  "Performance Table", "`create_performance_table()`", "`render_performance_table()`",
  "Summary Report", "`create_summary_report()`", ""
) %>%
  gt::gt(rowname_col = "Output") %>%
  gt::fmt_markdown(columns = c("Predictions and Outcomes", "Performance Data")) %>%
  gt::tab_style(
    style = list(
      gt::cell_text(weight = "bold")
    ),
    locations = gt::cells_column_labels(dplyr::everything())
  ) %>%
  gt::opt_table_lines(extent = "default") %>%
  gt::tab_options(
    column_labels.border.top.color = "white",
    column_labels.border.top.width = gt::px(3),
    column_labels.border.bottom.color = "black",
    table_body.hlines.color = "white",
    table.border.bottom.color = "white",
    table.border.bottom.width = gt::px(3)
  )

Curves based on Performance Metrics

tibble::tribble(
  ~"Curve", ~"Sens", ~"Spec", ~"PPV", ~"PPCR", ~"Lift", ~"NB", ~"P. Thr",
  "ROC", "y", "x", " ", " ", " ", " ", " ",
  "Lift", " ", " ", " ", "x", "y", " ", " ",
  "Gains", "y", " ", " ", "x", " ", " ", " ",
  "Precision Recall", "x", " ", "y", " ", " ", " ", " ",
  "Decision", " ", " ", " ", " ", " ", "y", "x"
) %>%
  gt::gt(rowname_col = "Curve") %>%
  #
  # gt::fmt_markdown(columns = c("Sens", "Spec", "PPV", "PPCR", "Lift", "NB", "P. Thr")) %>%
  #
  # gt::fmt_markdown(columns = everything()) %>%
  gt::tab_style(
    style = list(
      gt::cell_text(weight = "bold")
    ),
    locations = gt::cells_column_labels(dplyr::everything())
  ) %>%
  gt::opt_table_lines(extent = "default") %>%
  gt::tab_options(
    column_labels.border.top.color = "white",
    column_labels.border.top.width = gt::px(3),
    column_labels.border.bottom.color = "black",
    table_body.hlines.color = "white",
    table.border.bottom.color = "white",
    table.border.bottom.width = gt::px(3)
  ) %>%
  gt::cols_align(
    columns = dplyr::everything(),
    align = "center"
  )


uriahf/rtichoke documentation built on Nov. 22, 2023, 1:30 a.m.