From 984c329316e18ccd821d7c0bf93bcae9f4a7e17e Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Sun, 22 Sep 2019 13:14:40 +0800 Subject: [PATCH] data.table Depends->Imports --- .gitignore | 4 ++++ DESCRIPTION | 7 +++---- NAMESPACE | 3 ++- R/classifier_plots.R | 6 +++++- man/accuracy_plot.Rd | 1 - man/calculate_auc.Rd | 1 - man/calibration_plot.Rd | 1 - man/classifierplots.Rd | 3 --- man/classifierplots_folder.Rd | 4 ++-- man/density_plot.Rd | 1 - man/example_predictions.Rd | 1 - man/lift_plot.Rd | 1 - man/notation_key_plot.Rd | 1 - man/positives_plot.Rd | 1 - man/precision_plot.Rd | 1 - man/propensity_plot.Rd | 1 - man/recall_plot.Rd | 1 - man/roc_plot.Rd | 1 - man/sigmoid.Rd | 1 - 19 files changed, 16 insertions(+), 24 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a318814 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +# produced my R CMD facilities +*.Rcheck +*.tar.gz + diff --git a/DESCRIPTION b/DESCRIPTION index f6a9832..a61cae5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -12,10 +12,9 @@ Description: Debug your binary classifiers faster and easier! Depends: R (>= 3.1), - ggplot2 (>= 2.2), - data.table (>= 1.10), + ggplot2 (>= 2.2) Imports: - Rcpp (>= 0.12), + data.table (>= 1.10), grid, ROCR, caret, @@ -30,4 +29,4 @@ Encoding: UTF-8 BugReports: https://github.com/ambiata/classifierplots/issues URL: https://github.com/ambiata/classifierplots LazyData: true -RoxygenNote: 5.0.1 +RoxygenNote: 6.1.1 diff --git a/NAMESPACE b/NAMESPACE index 491cc32..7505f1e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -13,11 +13,12 @@ export(propensity_plot) export(recall_plot) export(roc_plot) export(sigmoid) -import(data.table) import(ggplot2) importFrom(ROCR,performance) importFrom(ROCR,prediction) importFrom(caret,createResample) +importFrom(data.table,data.table) +importFrom(data.table,setkey) importFrom(ggplot2,ggproto) importFrom(grDevices,dev.new) importFrom(grDevices,dev.off) diff --git a/R/classifier_plots.R b/R/classifier_plots.R index 4bc4295..4c85f88 100644 --- a/R/classifier_plots.R +++ b/R/classifier_plots.R @@ -9,7 +9,8 @@ NULL #' @description Produce a suit of classifier diagnostic plots #' @param test.y List of know labels on the test set #' @param pred.prob List of probability predictions on the test set -#' @import data.table ggplot2 +#' @import ggplot2 +#' @importFrom data.table data.table setkey #' @importFrom gridExtra grid.arrange #' @importFrom ROCR performance #' @importFrom ROCR prediction @@ -22,6 +23,9 @@ classifierplots <- function(test.y, pred.prob) { produce_classifier_plots(test.y, pred.prob, show=T) } +.I = .N = NULL +`:=` = function(...) NULL + #' @title classifierplots_folder #' @description Produce a suit of classifier diagnostic plots, saving to disk. #' @param test.y List of know labels on the test set diff --git a/man/accuracy_plot.Rd b/man/accuracy_plot.Rd index ca3035d..e3fef70 100644 --- a/man/accuracy_plot.Rd +++ b/man/accuracy_plot.Rd @@ -18,4 +18,3 @@ accuracy_plot(test.y, pred.prob, granularity = 0.02, show_numbers = T) \description{ Returns a ggplot2 plot object containing an accuracy @ percentile plot } - diff --git a/man/calculate_auc.Rd b/man/calculate_auc.Rd index 2185aa3..3e7e050 100644 --- a/man/calculate_auc.Rd +++ b/man/calculate_auc.Rd @@ -17,4 +17,3 @@ auc \description{ Compute auc from predictions and truth } - diff --git a/man/calibration_plot.Rd b/man/calibration_plot.Rd index 8ffe52d..89bb0c6 100644 --- a/man/calibration_plot.Rd +++ b/man/calibration_plot.Rd @@ -14,4 +14,3 @@ calibration_plot(test.y, pred.prob) \description{ Returns a ggplot2 plot object containing a smoothed propensity @ prediction level plot } - diff --git a/man/classifierplots.Rd b/man/classifierplots.Rd index d01ae46..736187c 100644 --- a/man/classifierplots.Rd +++ b/man/classifierplots.Rd @@ -14,8 +14,6 @@ classifierplots(test.y, pred.prob) \item{pred.prob}{List of probability predictions on the test set} } \description{ -The main functions you want are \code{\link{classifierplots}} or \code{\link{classifierplots_folder}}. - Produce a suit of classifier diagnostic plots } \details{ @@ -26,4 +24,3 @@ Produce a suit of classifier diagnostic plots classifierplots(example_predictions$test.y, example_predictions$pred.prob) } } - diff --git a/man/classifierplots_folder.Rd b/man/classifierplots_folder.Rd index 4c4828c..5596bbb 100644 --- a/man/classifierplots_folder.Rd +++ b/man/classifierplots_folder.Rd @@ -4,7 +4,8 @@ \alias{classifierplots_folder} \title{classifierplots_folder} \usage{ -classifierplots_folder(test.y, pred.prob, folder, height = 5, width = 5) +classifierplots_folder(test.y, pred.prob, folder, height = 5, + width = 5) } \arguments{ \item{test.y}{List of know labels on the test set} @@ -20,4 +21,3 @@ classifierplots_folder(test.y, pred.prob, folder, height = 5, width = 5) \description{ Produce a suit of classifier diagnostic plots, saving to disk. } - diff --git a/man/density_plot.Rd b/man/density_plot.Rd index 1a8683b..e93b5c9 100644 --- a/man/density_plot.Rd +++ b/man/density_plot.Rd @@ -14,4 +14,3 @@ density_plot(test.y, pred.prob) \description{ Returns a ggplot2 plot object containing a score density plot. } - diff --git a/man/example_predictions.Rd b/man/example_predictions.Rd index 47d5479..a18ed44 100644 --- a/man/example_predictions.Rd +++ b/man/example_predictions.Rd @@ -8,4 +8,3 @@ Generated using the gen_example included in the github source } \keyword{data} - diff --git a/man/lift_plot.Rd b/man/lift_plot.Rd index 106fcd1..41e2a9b 100644 --- a/man/lift_plot.Rd +++ b/man/lift_plot.Rd @@ -18,4 +18,3 @@ lift_plot(test.y, pred.prob, granularity = 0.02, show_numbers = T) \description{ Returns a ggplot2 plot object containing an precision @ percentile plot } - diff --git a/man/notation_key_plot.Rd b/man/notation_key_plot.Rd index 5ae4275..9f08251 100644 --- a/man/notation_key_plot.Rd +++ b/man/notation_key_plot.Rd @@ -9,4 +9,3 @@ notation_key_plot() \description{ Produces some definitions as a grid. } - diff --git a/man/positives_plot.Rd b/man/positives_plot.Rd index 921e05b..539792a 100644 --- a/man/positives_plot.Rd +++ b/man/positives_plot.Rd @@ -14,4 +14,3 @@ positives_plot(test.y, pred.prob) \description{ Returns a ggplot2 plot object containing an positives-per-decile plot. } - diff --git a/man/precision_plot.Rd b/man/precision_plot.Rd index aeb4396..2fb3e44 100644 --- a/man/precision_plot.Rd +++ b/man/precision_plot.Rd @@ -18,4 +18,3 @@ precision_plot(test.y, pred.prob, granularity = 0.02, show_numbers = T) \description{ Returns a ggplot2 plot object containing an precision @ percentile plot } - diff --git a/man/propensity_plot.Rd b/man/propensity_plot.Rd index dfc58e9..490f244 100644 --- a/man/propensity_plot.Rd +++ b/man/propensity_plot.Rd @@ -16,4 +16,3 @@ propensity_plot(test.y, pred.prob, granularity = 0.02) \description{ Returns a ggplot2 plot object containing an propensity @ percentile plot } - diff --git a/man/recall_plot.Rd b/man/recall_plot.Rd index c9b0b98..c7b7460 100644 --- a/man/recall_plot.Rd +++ b/man/recall_plot.Rd @@ -18,4 +18,3 @@ recall_plot(test.y, pred.prob, granularity = 0.02, show_numbers = T) \description{ Returns a ggplot2 plot object containing an sensitivity @ percentile plot } - diff --git a/man/roc_plot.Rd b/man/roc_plot.Rd index aa57c30..bf8158d 100644 --- a/man/roc_plot.Rd +++ b/man/roc_plot.Rd @@ -18,4 +18,3 @@ roc_plot(test.y, pred.prob, resamps = 2000, force_bootstrap = NULL) \description{ Produces a smoothed ROC curve as a ggplot2 plot object. A confidence interval is produced using bootstrapping, although it is turned off by default if you have a large dataset. } - diff --git a/man/sigmoid.Rd b/man/sigmoid.Rd index f222623..45dea21 100644 --- a/man/sigmoid.Rd +++ b/man/sigmoid.Rd @@ -12,4 +12,3 @@ sigmoid(x) \description{ Logistic sigmoid function, that maps any real number to the [0,1] interval. Supports vectors of numeric. } -